BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => BeBot Hyborian modules => Topic started by: kaeus on July 17, 2008, 09:01:47 pm

Title: Guild Recruitment
Post by: kaeus on July 17, 2008, 09:01:47 pm
Well, seeing as I like the feature to show class distribution and members in a guild, I figured I'd use these to show possible recruits.

To edit guild info, you need to edit the info() function. Formatting can be changed at the top, or manually done with font commands.  I left my guild's info in there as an example.

Simply tell users to send a tell to the bot with '!ginfo'.

Also supports commands '!ginfo members' to get a member list (member list of the bot) and '!ginfo classes' to get a class distribution. These can be used within the info class like this:
<a href='chatcmd:///tell kbot !ginfo members'>List of Members</a>

Possible Updates:
-Pulling guild info from a txt file much like guides.
-Looking to possibly finish the '!recruit' command to post a recruitment link in OOC.
Title: Re: Guild Recruitment
Post by: madrulf on July 17, 2008, 10:13:14 pm
I have a script similar. I disabled all the guest functions in the bot since AOC doesn't support chatrooms the same way as AO did. Created a new !apply command that people can type to add themselves as a guest, and modified the messages sent to the user. A notice is made in the guild channel that someone has applied, and the guild channel is reminded every 20 minutes until the applicant is removed or is promoted to member (by speaking in guild chat by the autoadduser script generally). I can post it tonight after work, but I'd have to clean it up some as it has my guild's name and whatnot hardcoded.

I'm waiting for someone to discover how to have the bot itself send guild invitations so that I can let any member invite applicants without needing Guild Invitation powers (as it unfortunately always comes with Kick and other abilities). Though, I'm sure I've read somewhere that those commands aren't a part of the chat server.  :-\
Title: Re: Guild Recruitment
Post by: Vrykolas on July 17, 2008, 11:56:31 pm
Sadly I can confirm that the bot can't invite to guild as that is handled by the game client and not the chat server :(
Title: Re: Guild Recruitment
Post by: madrulf on July 18, 2008, 03:31:04 am
That's the thing, I saw something about Age of Conan running 3 servers for every realm. One is the game server, another is the chat server and then the third is like a community/interaction server. If you noticed how sometimes you can't join parties or see that you're in a guild, and guild members do not appear on your friends list -- this is a case where that community server has crashed. Whatever this server may be called, I'm dubbing it a 'community' server for the sake of this conversation. The point is: the community server handles guild and party related functions.

While hunting down a PHP bot over a week ago before Noer got this all working with a modified BeBot, I was looking at some of the other threads on both US and EU forums. I recall reading somewhere that another dev managed to connect to both the chat server and this community server with one toon, while still playing with a different toon on the same account. Now I don't know what sort of bot that was or even if it was at the bot stage at all. I wonder if it would even be worth it for anyone in this community to try to create a second connection in the same PHP bot to manage both chat and guild functions. Sounds like a lot of work, and sadly I'm more of a scripter than a developer.

This really is off discussion though, and probably belongs in another thread.  :D
Title: Re: Guild Recruitment
Post by: kaeus on July 18, 2008, 05:54:14 am
Would that be similar to a dimension, or is that off too?
Title: Re: Guild Recruitment
Post by: kardsen on July 18, 2008, 07:13:27 am
Look up  AOC CHAT.   It is a out of game chat program,  as far as I am aware it does not connect to the game server.  yet I am able to send  /guild invite PLAYER  commands to it and it accepts them.

So someone out there has figured out how to get around this.

And yes, I can connect using AOC CHAT on one character. and play on another.  :)
Title: Re: Guild Recruitment
Post by: Noer on July 18, 2008, 10:02:55 am
There is currently research being done on how to communicate with the community/dimension server. However its a lot more dodgy than connecting to the chat server and we have no idea how Funcom is gonna react to it.
Title: Re: Guild Recruitment
Post by: Vain on July 19, 2008, 01:40:01 am
The source for AOC chat is availalbe. I tried to take a peak but my version of Visual Studio is an older version than the one it was created in...  :(

I notice AOC chat can chat via tells and:
PlayField = /ooc
Guild
RegionStygia





Title: Re: Guild Recruitment
Post by: Noer on July 19, 2008, 01:48:13 am
The source for AOC chat is availalbe. I tried to take a peak but my version of Visual Studio is an older version than the one it was created in...  :(

I notice AOC chat can chat via tells and:
PlayField = /ooc
Guild
RegionStygia

AOC Chat can doing more, nothing less than what BeBot and AOChat can. Its the same protocols they use.
Title: Re: Guild Recruitment
Post by: kardsen on July 19, 2008, 02:56:12 am
with that said, the bot if ranked high enough in the guild should be able to send a /guild invite command.  :o
Title: Re: Guild Recruitment
Post by: Vain on July 19, 2008, 08:56:47 am
with that said, the bot if ranked high enough in the guild should be able to send a /guild invite command.  :o

ok, what would i needto change to get the bot to advertise for guild recruitment in ooc chat say every 1.5 hours?
Title: Re: Guild Recruitment
Post by: Vhab on July 19, 2008, 09:12:35 am
with that said, the bot if ranked high enough in the guild should be able to send a /guild invite command.  :o

ok, what would i needto change to get the bot to advertise for guild recruitment in ooc chat say every 1.5 hours?


Don't do it. Public channels are holy and getting your bot to use them is the first step to getting banned.
I know I'll personally petition all bots I see making use of the public channels.
Title: Re: Guild Recruitment
Post by: Vain on July 19, 2008, 09:46:04 am
with that said, the bot if ranked high enough in the guild should be able to send a /guild invite command.  :o

ok, what would i needto change to get the bot to advertise for guild recruitment in ooc chat say every 1.5 hours?


Don't do it. Public channels are holy and getting your bot to use them is the first step to getting banned.
I know I'll personally petition all bots I see making use of the public channels.

ok, i wasnt aware of the holyness  ;D
I wont.
Title: Re: Guild Recruitment
Post by: kaeus on July 19, 2008, 08:26:00 pm
Why would having my bot say something I would say be bad?  Even if I have to manually type the command to get the bot to say it.  I dont see the logic in it being sacred.  Either I tell people to ask the bot, or it just posts guild info itself like I would have done.  I dont see a problem if there is no automated timer.
Title: Re: Guild Recruitment
Post by: GBH on July 19, 2008, 09:49:26 pm
For those of us long in the tooth and having used bots for years in Anarchy Online it was the #1 rule which FC never spoke of.

Never, ever use a bot to mass tell/message/talk on any channel ever. There were work-arounds for mass announce bots which were purely subscription and even those, on occasion, were banned for spam.

As bot owners we HAVE to be very careful and responsible in running these bots. It is only because FC decide to turn a blind eye that we are allowed to use them at all. Anything that would likely lead to trouble must be avoided or we risk jeopardising all the bots, not just Bebot.

As I believe Vhab once mentioned, FC could disable all the bots in existence with a tiny change to the protocol in such a way that we could never use bots. Take the advice of someone as experienced and knowledgeable as Vhab on whats a good idea and what isn't - he might not like to boast about it, but he probably knows as much about bots and FC's tolerances as anyone - if not more than most people every will.

Buff
Title: Re: Guild Recruitment
Post by: Vhab on July 20, 2008, 12:24:12 pm
Alright, I'll give the long answer, the reason is pretty simple.

If you personally spam the public channel and people object to it, you might get petitioned.
In this case a GM will come up, ask you to stop spamming. You'll apologize and stop spamming.

However, when your bot spams the channel and a GM comes up. The bot doesn't know a GM is asking it to stop spamming, so it'll just continue.
A GM is left with only 1 choice at this point, ban your account.

Also, think about it if everyone setup a bot 24/7 to advertise their guild.
Using macro's, the spamming is only limited to the amount of time a recruiter is online. But bots can cover the channel 24/7.
Now imagine every guild on the server sending an advertisement message every 30 minutes.

Yes, that's alot of spam. Funcom won't be pleased.
In the worst case, they'll just shut down bot access altogether.
Don't spoil it for the rest and just stay clear of the public channels.

Ps. thanks for the kind words GBH :)
Title: Re: Guild Recruitment
Post by: kardsen on July 22, 2008, 09:43:38 pm
Here's what I do.

You have a handful of people spam in the public channels.
The people you have spam the chat channels make the following script.

Place the following in a .txt file.  name it spam.txt for example
Quote
/OOC <a href="text://CLICK HERE FOR INFORMATION ABOUT US FROM OUR CHAT BOT.<br><br><a href='chatcmd:///tell guildcrier !ginfo view'>Click Here.<br></a>">Devotion: Accepting Members</a>

They will place this file in the Age Of Conan/scripts/   folder

once in game the people with the script can type   /spam.txt

It will auto put that link into the OOC chat, with a link to the bot.



Title: Re: Guild Recruitment
Post by: Jiheld on March 23, 2009, 09:01:07 am
Hi,

After some requests, i post here our Guildinfo script.

I modified the script abit. I putted the leaders and officers in it, online/offline.

Quote
'<?php
/*
* GuildInfo, by Kaeus
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class GuildInfo extends BaseActiveModule
{

   function __construct(&$bot)
   {
      parent::__construct(&$bot, get_class($this));
      
      $this -> register_command('all', 'ginfo', "ANONYMOUS");

      $this -> bot -> core("colors") -> define_scheme("GI", "highlight", "yellow");
      $this -> bot -> core("colors") -> define_scheme("GI", "normal", "white");
      $this -> bot -> core("colors") -> define_scheme("GI", "info", "lightgreen");
      $this -> bot -> core("colors") -> define_scheme("GI", "red", "red");
      $this -> bot -> core("colors") -> define_scheme("GI", "blue", "blue");

      $this -> help['description'] = 'Helps with guild recruitment.';
      $this -> help['command']['ginfo']="Displays guild's info tab.";
      $this -> help['command']['ginfo members']="Displays a list of members in the guild.";
      $this -> help['command']['ginfo classes']="Displays a list of classes in the guild.";
      $this -> help['command']['grecruit']="Displays a recruitment link in OOC (usable only with priveleges).";
   }

   function command_handler($name, $msg, $origin)
   {
      if (preg_match('/^ginfo/i', $msg, $info)) {
         $words = trim(substr($msg, strlen('ginfo')));
         if ($words == "members")
         {
            return $this -> memberslist();
         } else if($words == "classes") {
            return $this -> memberscount();
         } else {
            return $this -> info();
         }
      } else if(preg_match('/^grecruit/i', $msg, $info)) {
         //return "Command under development";
         $msg = $this -> recruit();
         $channel = $this -> bot -> core("chat") -> lookup_group("Playfield");
         return "Currently under development: ".$channel;
      } else {
         $this -> bot -> send_help($name);
      }
   }
   
   /*
   Guilds Info
   */
   function info()
   {
      $txt.= "##GI_red##_-E M P-_##end##\n\n";
      
      
      $txt.= "##purple##Leaders:##end##\n\n";
      $online = $this -> bot -> core("online") -> get_online_state('Jiheld');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Jiheld Im interested in joining _-E M P-_'>Jiheld</a>##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Ronmel');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Ronmel Im interested in joining _-E M P-_'>Ronmel</a>##end##\n\n";
      $txt.= "##purple##Leaders Alts:##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Mustage');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Mustage Im interested in joining _-E M P-_'>Mustage</a>##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Ronmello');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Ronmello Im interested in joining _-E M P-_'>Ronmello</a>##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Balashi');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Balashi Im interested in joining _-E M P-_'>Balashi</a>##end##\n\n";
      
      $txt.= "##purple##Officers:##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Cheyenne');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Cheyenne Im interested in joining _-E M P-_'>Cheyenne</a> - Officer##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Blui');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Blui Im interested in joining _-E M P-_'>Blui</a> - Officer##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Haiwan');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Haiwan Im interested in joining _-E M P-_'>Haiwan</a> - Officer##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Froxer');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Froxer Im interested in joining _-E M P-_'>Froxer</a> - Officer##end##\n";
      $txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.enragedpolarbears.com##end##\n\n";
      $txt.= "##GI_red##City:##end## ##GI_highlight##Full Tier II (include towers and walls). Tier III keep##end##\n\n";
      
      $txt.= "##GI_red##Recruitment:##end## ##yellow## We looking for people older then the age of 18 and from level 70+ Active people that want to raid and have fun.##end##\n\n";
      $txt.= "##Red## [Low]: We have enough.##end## ##yellow## [Medium]: We could use 1.##end## ##green##[High]: need 2 or more.##end##\n\n";
      $txt.= "##purple##Assissin:##end## ##yellow##[Medium]##end##\n";
      $txt.= "##purple##Barbarian:##end## [Closed]##end##\n";
      $txt.= "##purple##Bear Shaman:##end## ##red##[Low]##end##\n";
      $txt.= "##purple##Conqueror:##end## ##yellow##[Medium]##end##\n";
      $txt.= "##purple##Dark Templer:##end## ##red##[Low]##end##\n";
      $txt.= "##purple##Demonologist:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Guardian:##end## ##red##[Low]##end##\n";
      $txt.= "##purple##Herald of Xotli:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Necromancer:##end## ##Red##[Low]##end##\n";
      $txt.= "##purple##Priest of Mitra:##end## ##red##[Low]##end##\n";
      $txt.= "##purple##Ranger:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Tempest of set:##end## ##Yellow##[Medium]##end##\n\n";
      
      $txt.= "##GI_red##Guild Info:##end##\n";
      $txt.= "##GI_info##";
      $txt.= "Enraged Polarbears is curently progressing through the 24 people raid material of AoC, and we are curently in need of a few selected recruits among our ranks.\n

Our main goal is to form a stable and solid relatively small raiding team with people that will get to know each other and have fun together. This is, in our opinion, the only way a guild can stack together and succeed, and the only way one won't feel just another pawn of the guild's leadership. We plan on making members feel at home and welcome. We also plan on encouraging people to take part in the guild's doings, not only in the raiding part but also the planning ones. We will ask for your opinion, your best thought strategy, your participation in the guild's politics, we will be happy when you speak your mind and provide constructive feedback at our forum. \n

We will also face with respect any prospective applicants, trials and members. There will not be any form of abusing at all, none harassing/pseudo-professional elitist attitude and so on and forth. We are fully aware of the true importance of this game, which is close to zero, and our priority -hands down- will be to have fun and make people in the raid happy so they will be eager to raid with us again, irregardless of the epics. \n

That of course doesn't mean we will slack behind and go casual, rather the opposite. We are a semi-hardcore guild with high if not very high end-game goals that are to be achieved, meaning that we have a good selection system and only keep players good enough to achieve those goals. \n

In any case, anyone who decides to apply, please visit our website for an application. Or just have a chat with one of us. http://www.enragedpolarbears.com \n

If you reached here, bravo! and thank you for your time and hope to see all of you soon online! \n\n";
      $txt.= "<a href='chatcmd:///tell embot !ginfo members'>List of Members</a>\n";
      $txt.= "<a href='chatcmd:///tell embot !ginfo classes'>List of Classes</a>\n";
      $txt.= "##end##";
      
      
      return $this -> bot -> core("tools") -> make_blob("_-E M P-_", $txt);
   }
   /*
   Still working on this, for now just some random debugging stuff I was trying
   */
   function recruit()
   {   
      $blob = "EMP is Recruiting!: '";
      $blob.= $this -> info();
      $blob.= " Playfield ID: ";
      return $blob;
      
   }
   
   /*
   Need to revize so it just uses core
   */
   function memberslist()
   {
      $blob = "";
      $count = 0;
      $result = $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " . MEMBER . " ORDER BY nickname ASC");
      if (!empty($result))
      {
         $inside = "##blob_title##:::: <botname>'s Member List ::::##end##\n\n";
         foreach ($result as $val)
         {
            $count++;
            $inside .= "##blob_text##• " . $val[0];
            if ($val[1] > 0)
            {
               $inside .= ", last seen at " . gmdate($this -> bot -> core("settings") -> get("Time", "FormatString"), $val[1]);
            }
            else
            {
               $inside .= ", never seen online";
            }
            $inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " . $val[0], "[Whois]")."\n";
         }
         $blob = " :: " . $this -> bot -> core("tools") -> make_blob("click to view", $inside);
      }
      return $count . " Guild Members:" . $blob;
   }
   
   /*
   Need to revize so it just uses core
   */
   function memberscount()
   {
      $blob = "";
      $total = 0;
      
      $buddies = count($this -> bot -> aoc -> buddies);
      //Get a list of professions
      $profession_list = "'".$this->bot->core('professions')->get_professions("', '")."'";
      $counts = $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
            FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
             WHERE user_level = " . MEMBER . " AND t2.class IN ($profession_list) GROUP BY class");
            
      foreach ($this -> bot->core('professions')->get_profession_array() as $prof)
         $count[$prof] = 0;
      if (!(empty($counts)))
      {
         foreach ($counts as $profcount)
         {
            $count[$profcount[0]] += $profcount[1];
            $total += $profcount[1];
         }
      }
      
      $inside = "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
      $inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
      foreach ($count as $key => $value)
         $inside .= "\n• ".$key." = ##blob_title##".$value."##end##";
      $blob = " :: " . $this -> bot -> core("tools") -> make_blob("click to view", $inside);

      return $total . " Guild Classes:" . $blob;
   }
}
?>

Offcourse you need to change the names and the guild text. Also the guildname, because the script is made for my guild.

Good luck with it.

Jih.
Title: Re: Guild Recruitment
Post by: Krica on March 25, 2009, 03:11:25 pm
thanks mate,very good job  ;)
Title: Re: Guild Recruitment
Post by: Drizzurdeen on April 01, 2009, 05:27:30 pm
thx al lot for this script .... perfekt work ... runs perfekt :D
Title: Re: Guild Recruitment
Post by: almas on August 28, 2009, 02:49:56 pm
Hi
I have tried to modify this script to our guild needs. but I get this error message when I try to start the bot:
Parse error: syntax error, unexpected T_STRING in C:\BeBot\custom\modules\ginfo.
php on line 84

Hope that someone can help me. I am a noob with php. This is how my script looks like:
Code: [Select]
<?php
/*
* GuildInfo, by Kaeus
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class 
GuildInfo extends BaseActiveModule
{

   function 
__construct(&$bot)
   {
      
parent::__construct(&$botget_class($this));
      
      
$this -> register_command('all''ginfo'"ANONYMOUS");

      
$this -> bot -> core("colors") -> define_scheme("GI""highlight""yellow");
      
$this -> bot -> core("colors") -> define_scheme("GI""normal""white");
      
$this -> bot -> core("colors") -> define_scheme("GI""info""lightgreen");
      
$this -> bot -> core("colors") -> define_scheme("GI""red""red");
      
$this -> bot -> core("colors") -> define_scheme("GI""blue""blue");

      
$this -> help['description'] = 'Helps with guild recruitment.';
      
$this -> help['command']['ginfo']="Displays guild's info tab.";
      
$this -> help['command']['ginfo members']="Displays a list of members in the guild.";
      
$this -> help['command']['ginfo classes']="Displays a list of classes in the guild.";
      
$this -> help['command']['grecruit']="Displays a recruitment link in OOC (usable only with priveleges).";
   }

   function 
command_handler($name$msg$origin)
   {
      if (
preg_match('/^ginfo/i'$msg$info)) {
         
$words trim(substr($msgstrlen('ginfo')));
         if (
$words == "members")
         {
            return 
$this -> memberslist();
         } else if(
$words == "classes") {
            return 
$this -> memberscount();
         } else {
            return 
$this -> info();
         }
      } else if(
preg_match('/^grecruit/i'$msg$info)) {
         
//return "Command under development";
         
$msg $this -> recruit();
         
$channel $this -> bot -> core("chat") -> lookup_group("Playfield");
         return 
"Currently under development: ".$channel;
      } else {
         
$this -> bot -> send_help($name);
      }
   }
   
   
/*
   Guilds Info
   */
   
function info()
   {
      
$txt.= "##GI_red##Sinister Awakening##end##\n\n";
      
      
      
$txt.= "##purple##Leaders:##end##\n\n";
      
$online $this -> bot -> core("online") -> get_online_state('Wulgo');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Wulgo Im interested in joining SA'>Wulgo</a>##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Brachus');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Brachus Im interested in joining SA'>Brachus</a>##end##\n\n";
      
      
$txt.= "##purple##Officers:##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Ashata');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Ashata Im interested in joining...'>Ashata</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Hrotgar');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Hrotgar Im interested in joining...'>Hrotgar</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Skammkell');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Skammkell Im interested in joining...'>Skammkell</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Xhil');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Xhil Im interested in joining...'>Xhil</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Wilhelmtell');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Wilhelmtell Im interested in joining...'>Wilhelmtell</a> - Officer##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.sinister-awakening.com##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##GI_highlight##Full Tier III Guild City (& Full Tier I Battlekeep)##end##\n\n";
      
$txt.= "##GI_red##Recruitment:##end## ##yellow## We are looking for people over the age of 17 and from level 40+ active people for both pve and pvp.##end##\n\

      
      
$txt.= "<a href='chatcmd:///tell botsa !ginfo members'>List of Members</a>\n";
      
$txt.= "<a href='chatcmd:///tell botsa !ginfo classes'>List of Classes</a>\n";
      
$txt.= "##end##";
      
      
      
return $this -> bot -> core("tools") -> make_blob("Sinister Awakening"$txt);
   }
   
/*
   Still working on this, for now just some random debugging stuff I was trying
   */
   
function recruit()
   {   
      
$blob "Sinister Awakening is recruiting!: '";
      
$blob.= $this -> info();
      
$blob.= " Playfield ID: ";
      return 
$blob;
      
   }
   
   
/*
   Need to revize so it just uses core
   */
   
function memberslist()
   {
      
$blob "";
      
$count 0;
      
$result $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " MEMBER " ORDER BY nickname ASC");
      if (!empty(
$result))
      {
         
$inside "##blob_title##:::: <botname>'s Member List ::::##end##\n\n";
         foreach (
$result as $val)
         {
            
$count++;
            
$inside .= "##blob_text##• " $val[0];
            if (
$val[1] > 0)
            {
               
$inside .= ", last seen at " gmdate($this -> bot -> core("settings") -> get("Time""FormatString"), $val[1]);
            }
            else
            {
               
$inside .= ", never seen online";
            }
            
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " $val[0], "[Whois]")."\n";
         }
         
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);
      }
      return 
$count " Guild Members:" $blob;
   }
   
   
/*
   Need to revize so it just uses core
   */
   
function memberscount()
   {
      
$blob "";
      
$total 0;
      
      
$buddies count($this -> bot -> aoc -> buddies);
      
//Get a list of professions
      
$profession_list "'".$this->bot->core('professions')->get_professions("', '")."'";
      
$counts $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
            FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
             WHERE user_level = " 
MEMBER " AND t2.class IN ($profession_list) GROUP BY class");
            
      foreach (
$this -> bot->core('professions')->get_profession_array() as $prof)
         
$count[$prof] = 0;
      if (!(empty(
$counts)))
      {
         foreach (
$counts as $profcount)
         {
            
$count[$profcount[0]] += $profcount[1];
            
$total += $profcount[1];
         }
      }
      
      
$inside "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
      
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
      foreach (
$count as $key => $value)
         
$inside .= "\n• ".$key." = ##blob_title##".$value."##end##";
      
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);

      return 
$total " Guild Classes:" $blob;
   }
}
?>

Title: Re: Guild Recruitment
Post by: Arawacian on August 28, 2009, 06:06:54 pm
change this line in your script:
 
     $txt.= "##GI_red##Recruitment:##end## ##yellow## We are looking for people over the age of 17 and from level 40+ active people for both pve and pvp.##end##\n\

to

      $txt.= "##GI_red##Recruitment:##end## ##yellow## We are looking for people over the age of 17 and from level 40+ active people for both pve and pvp.##end##\n";

I think that should do the trick.... not sure though im noob too
Title: Re: Guild Recruitment
Post by: almas on August 28, 2009, 07:06:05 pm
That worked. Thanks for the help
Title: Re: Guild Recruitment
Post by: keirou on October 05, 2009, 03:58:39 am
Is it possible to align text and change font or its size in age of conan

Basically the guild name i want centered and in the hyborian font
also is there a way since we have the !alts command and there is a table of a persons alt in the sql to modify the online offline to referance if a player is on any of their alts?

currently i am using this as a crude method
Code: [Select]
      $online = $this -> bot -> core("online") -> get_online_state('Morgahne');
      $txt.= "##GI_highlight##".$online['content']." :: Morgahne";
$txt.= "##Silver## [";
$txt.= "##GI_highlight##Morgaena:";
$online = $this -> bot -> core("online") -> get_online_state('Morgaene');
$txt.= "##GI_highlight##".$online['content']."##Silver##]##end##\n";
$txt.= "##end##\n";
Title: Re: Guild Recruitment
Post by: keirou on October 08, 2009, 01:41:31 pm
With the help of a guild member I was able to modify this script so it now tells you if the leader / officers are online (AND on what character)

Code: [Select]
<?php
/*
* GuildInfo
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class 
GuildInfo extends BaseActiveModule
{

   function 
__construct(&$bot)
   {
      
parent::__construct(&$botget_class($this));
      
      
$this -> register_command('all''ginfo'"ANONYMOUS");

      
$this -> bot -> core("colors") -> define_scheme("GI""highlight""yellow");
      
$this -> bot -> core("colors") -> define_scheme("GI""normal""white");
      
$this -> bot -> core("colors") -> define_scheme("GI""info""lightgreen");
      
$this -> bot -> core("colors") -> define_scheme("GI""red""red");
      
$this -> bot -> core("colors") -> define_scheme("GI""Silver""Silver");

      
$this -> help['description'] = 'Helps with guild recruitment.';
      
$this -> help['command']['ginfo']="Displays guild's info tab.";
      
$this -> help['command']['ginfo members']="Displays a list of members in the guild.";
      
$this -> help['command']['ginfo classes']="Displays a list of classes in the guild.";
      
$this -> help['command']['grecruit']="Displays a recruitment link in OOC (usable only with priveleges).";
   }

   function 
command_handler($name$msg$origin)
   {
      if (
preg_match('/^ginfo/i'$msg$info)) {
         
$words trim(substr($msgstrlen('ginfo')));
         if (
$words == "members")
         {
            return 
$this -> memberslist();
         } else if(
$words == "classes") {
            return 
$this -> memberscount();
         } else {
            return 
$this -> info();
         }
      } else if(
preg_match('/^grecruit/i'$msg$info)) {
         
//return "Command under development";
         
$msg $this -> recruit();
         
$channel $this -> bot -> core("chat") -> lookup_group("Playfield");
         return 
"Currently under development: ".$channel;
      } else {
         
$this -> bot -> send_help($name);
      }
   }
   
   
/*
   Guilds Info
   */
   
function info()
   {
      
$txt.= "##GI_red##GUILD NAME HERE##end##\n\n";
 $txt.= "##end##\n";      
      
      
$txt.= "##highlight##Leader:##end##\n\n";
$online $this -> officercheck("GUILD LEADER NAME");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
 $txt.= "##end##\n";      
      
$txt.= "##highlight##Officers:##end##\n";
$online $this -> officercheck("OFFICER 1");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
     
$online $this -> officercheck("OFFICER 2");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 3");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 4");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 5");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";  
$online $this -> officercheck("OFFICER 6");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";  
 $txt.= "##end##\n"
      
$txt.= "##GI_red##Website:##end## ##GI_info## WWW. YOUR WEBSITE HERE .COM##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##Silver##WHAT YOUVE BUILT##end##\n\n";
      
$txt.= "##GI_red##Raids:##end## ##Silver##WHAT YOUVE KILLED##end##\n\n";
      
$txt.= "##GI_red##Recruitment:##end## ##Silver##SPECIAL REQUIREMENTS??.##end##\n\n";
 $txt.= "##end##\n";
      
$txt.= "##highlight##Assassin:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Barbarian:##end## ##Red## [Closed]##end##\n";
      
$txt.= "##highlight##Bear Shaman:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Conqueror:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Dark Templer:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Demonologist:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Guardian:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Herald of Xotli:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Necromancer:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Priest of Mitra:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Ranger:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Tempest of Set:##end## ##Red##[Closed]##end##\n\n";
 $txt.= "##end##\n";
      
      
$txt.= "##GI_red##Guild Info:##end##\n";
      
$txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 1\n\n";
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 2\n\n";
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 3\n\n";
      
$txt.= "##end##";
      
      
      return 
$this -> bot -> core("tools") -> make_blob("WHAT YOU WANT THE BOT TO TELL THE PLAYER"$txt);
   }
   
/*
   Still working on this, for now just some random debugging stuff I was trying
   */
   
function recruit()
   {   
      
$blob "Guild Name is Recruiting!: '";
      
$blob.= $this -> info();
      
$blob.= " Playfield ID: ";
      return 
$blob;
      
   }

/*
Checks online list for presence of officer of $name
Returns online status, and if online, name of current main/alt
*/
function officercheck($name)
{
$online $this -> bot -> db -> select("SELECT t1.nickname FROM "
"#___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc=1");

$found FALSE;
if (!empty($online))
{
foreach ($online as $player)
{
if(isset($this -> listed[$channel][$player[0]]))
Continue;

$main $this -> bot -> core("alts") -> main($player[0]);

if ($name == $main)
{
$online_state $this -> bot -> core("online") -> get_online_state($this -> bot -> core("chat") -> get_uname($player[0]));
$retstr " - " $this -> bot -> core("chat") -> get_uname($player[0]);
$found TRUE;
break;
}
else if ($name == $this -> bot -> core("chat") -> get_uname($player[0]))
{
$online_state $this -> bot -> core("online") -> get_online_state($main);
$retstr " - " $main;
$found TRUE;
break;
}
}
if ($found == FALSE)
{
$online_state $this -> bot -> core("online") -> get_online_state($name);
$retstr " - " $name;
}
}
return array($online_state$retstr);
}
   
   
/*
   Need to revize so it just uses core
   */
   
function memberslist()
   {
      
$blob "";
      
$count 0;
      
$result $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " MEMBER " ORDER BY nickname ASC");
      if (!empty(
$result))
      {
         
$inside "##blob_title##:::: <botname>'s Member List ::::##end##\n\n";
         foreach (
$result as $val)
         {
            
$count++;
            
$inside .= "##blob_text##&#8226; " $val[0];
            if (
$val[1] > 0)
            {
               
$inside .= ", last seen at " gmdate($this -> bot -> core("settings") -> get("Time""FormatString"), $val[1]);
            }
            else
            {
               
$inside .= ", never seen online";
            }
            
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " $val[0], "[Whois]")."\n";
         }
         
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);
      }
      return 
$count " Guild Members:" $blob;
   }
   
   
/*
   Need to revize so it just uses core
   */
   
function memberscount()
   {
      
$blob "";
      
$total 0;
      
      
$buddies count($this -> bot -> aoc -> buddies);
      
//Get a list of professions
      
$profession_list "'".$this->bot->core('professions')->get_professions("', '")."'";
      
$counts $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
            FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
             WHERE user_level = " 
MEMBER " AND t2.class IN ($profession_list) GROUP BY class");
            
      foreach (
$this -> bot->core('professions')->get_profession_array() as $prof)
         
$count[$prof] = 0;
      if (!(empty(
$counts)))
      {
         foreach (
$counts as $profcount)
         {
            
$count[$profcount[0]] += $profcount[1];
            
$total += $profcount[1];
         }
      }
      
      
$inside "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
      
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
      foreach (
$count as $key => $value)
         
$inside .= "\n&#8226; ".$key." = ##blob_title##".$value."##end##";
      
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);

      return 
$total " Guild Classes:" $blob;
   }
}
?>
Title: Re: Guild Recruitment
Post by: freakyfreak on April 04, 2010, 07:29:45 pm
How can I post this script in Global Chat.
Is there any possibility?
Title: Re: Guild Recruitment
Post by: ST34LTH on April 04, 2010, 08:05:44 pm
dont think u can post this in Global but u can call it from another script, e.g

make a script that has the commant /tell <botname> !ginfo. so when someone clicks on it, it will send them the guild information
Title: Re: Guild Recruitment
Post by: Monk4y on April 04, 2010, 09:18:13 pm
Create a txt file called rec.txt in your scripts game directory and copy this text to it:

Code: [Select]
<a href="text://mfs<br><br><br><br><br><a href='chatcmd:///tell INSERTBOTNAME !ginfo'>Click here<br></a>">INSERTGUILDNAME is Recruiting!</a>
Save it (dont forget to change INSERTBOTNAME and INSERTGUILDNAME)

Then simply type /rec.txt in global and you got your global add. (assuming your bot is up and the ginfo module is present :p)

Title: Re: Guild Recruitment
Post by: freakyfreak on April 07, 2010, 03:44:49 pm
Thx Monk4Y,
The script works fine.

One Question, What shoul i paste in the Guildinfo.php that the Bot tells me who clicked on the message

Code: [Select]
      $txt.= "GUILD INFO SECTION 2\n\n";
    $txt.= "##end##\n";
    $txt.= "##Silver##";
      $txt.= "GUILD INFO SECTION 3\n\n";
      $txt.= "##end##";
     
     
      return $this -> bot -> core("tools") -> make_blob("WHAT YOU WANT THE BOT TO TELL THE PLAYER", $txt)

Here is the line where the bot post it in the "tell"
Title: Re: Guild Recruitment
Post by: freakyfreak on August 10, 2010, 08:52:48 pm
Thx Monk4Y,
The script works fine.

One Question, What shoul i paste in the Guildinfo.php that the Bot tells me who clicked on the message

Code: [Select]
      $txt.= "GUILD INFO SECTION 2\n\n";
    $txt.= "##end##\n";
    $txt.= "##Silver##";
      $txt.= "GUILD INFO SECTION 3\n\n";
      $txt.= "##end##";
     
     
      return $this -> bot -> core("tools") -> make_blob("WHAT YOU WANT THE BOT TO TELL THE PLAYER", $txt)

Here is the line where the bot post it in the "tell"

Can anyone help me.
I don´t have any clue
SimplePortal 2.3.7 © 2008-2024, SimplePortal