BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Nesi on February 11, 2005, 03:53:11 pm

Title: Command without the ! possible and how?
Post by: Nesi on February 11, 2005, 03:53:11 pm
Hello

Got the Bot running on ! as a command syntax. I new want to make a command that responds without the syntax now how do i go about doing that :)?

else if (preg_match("/^" . $this -> bot -> commpre . "test(.+)$/i", $msg, $info))
            $this -> test($name, $info[1]);

Think i wold need to change the "commpre" into something, but what??
Title: Command without the ! possible and how?
Post by: Blondengy on February 11, 2005, 07:04:32 pm
I'm afraid that if you want this command to respond to tells or privategroup messages it is not (yet) possible.

If you want it to reply to guildchat however it is possible:

At the top:
Code: [Select]
 $myModule = new MyModule();

  $commands["gmsg"][$guild_name][] = &$myModule;


Then in the class:
Code: [Select]
   /*
      This gets called on a msg in the group
    */
    function gmsg($name, $group, $msg)
    {
      if (preg_match("/^thiscommand/", $msg))
      {
        // Code in here.
      }
    }



If you DO need a command that replys to a tell/privgroup without useing the command syntax I'll make a little workaround for you. ;)
Title: Command without the ! possible and how?
Post by: craized on February 13, 2005, 02:48:24 am
I could be wrong about this, as I haven't taken the time to understand the bot, but you could try taking the "!" and changing it to "" in Bot.conf.
Title: Command without the ! possible and how?
Post by: Blondengy on February 13, 2005, 05:48:02 pm
Yes, but the way I understood it Nesi wants the bot to run on the "!" syntax for all commands but one.
Title: Command without the ! possible and how?
Post by: craized on February 14, 2005, 08:38:47 am
Ahh, my mistake, but if you wanted it in privategroup, I believe you can do it using the same workaround as for guild chat, ex.
Code: [Select]

$myModule = new MyModule();

$commands["pvgroup"][][] = &$myModule;


then

Code: [Select]


   /*
      This gets called on a msg in the group
    */
    function prvgroup($name, $group, $msg)
    {
      if (preg_match("/^thiscommand/", $msg))
      {
        // Code in here.
      }
    }




I don't have a copy of the template, so I can't quite remeber if prvgroup is corrent, but the module template does offer a way to listen to all private group chat. As for tells, your'e out of luck for now, unless you do in fact want to do away with your syntax for good.
Title: Command without the ! possible and how?
Post by: Nesi on February 14, 2005, 06:23:22 pm
Made it work by adding another command syntax to the bot :)

Needed it for a loot filter/logger for apfbot and guildbot :)

Works in all channels.
Thanks for the replys
SimplePortal 2.3.7 © 2008-2024, SimplePortal