BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Diablo on March 01, 2008, 07:31:55 am

Title: How to get bot to ignore certain syntax in the relay module.
Post by: Diablo on March 01, 2008, 07:31:55 am
I am needing some help on how to change the relay module so that certain syntax like @ when set wont be relayed to other bots but only shows in the main org bot that it was typed in. I tried putting preg_match in so it wouldnt send the gcr out in front of message would this be best way to do this.
Title: Re: How to get bot to ignore certain syntax in the relay module.
Post by: Temar on March 01, 2008, 08:18:07 pm
a better way would be
Code: [Select]
If($msg[0] == "@")
{
   Return;
}
Prob at top of the function that handles none commands.

You should also use settings so you can easily change it instead of it being coded as@
Title: Re: How to get bot to ignore certain syntax in the relay module.
Post by: Diablo on March 02, 2008, 04:16:43 am
i tried this code but not exactly sure where best place to put in the relay_guild module.
This should check another module for Syntax and if its there should not realy the chat.

Code: [Select]
if (preg_match("/^" . $this -> bot -> settings -> get ('HRelay1', 'nearSyntax') . " (.+)/i", $msg))
SimplePortal 2.3.7 © 2008-2024, SimplePortal