collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: How to get bot to ignore certain syntax in the relay module.  (Read 4248 times)

0 Members and 1 Guest are viewing this topic.

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
How to get bot to ignore certain syntax in the relay module.
« 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.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: How to get bot to ignore certain syntax in the relay module.
« Reply #1 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@

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
Re: How to get bot to ignore certain syntax in the relay module.
« Reply #2 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))

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 107
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal