L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2008, 10:53:46 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Coding a /tell relay question
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Coding a /tell relay question  (Read 561 times)
0 Members and 1 Guest are viewing this topic.
Hyde
Rookie
**
Offline Offline

Posts: 35


Coding a /tell relay question
« on: August 26, 2007, 07:53:43 PM »

On our old bot I had a plugin that would take message input from pre-determined people and echo that message on orgchat and guest chat without giving any reply back to the source.

We used this to display Infonet and Elitenet relays in orgchat. I did some other stuff to them as well to reformat them (so that elitenet and infonet messages looked virtually identical as well as to include a simple profanity filter).

It is key that the bot not ever send any reply back to these senders, even in the event of error. Otherwise you get chat loops.

What do I need to do to make sure I intercept the message and never respond to it if it comes from certain names?
Logged

Doctorhyde/Jexyll/Goraud@RK2
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1023


Re: Coding a /tell relay question
« Reply #1 on: August 27, 2007, 04:05:33 AM »

Try something like the code below, tells is used to catch all incoming tells that don't match a command. You need to check the sender, and if it's the right one relay it. If the function tells() returns true the handler for incoming tells won't send back any access denied or help lines.

Code:
<?php
$infonet 
= new InfoNet($bot);

$commands["tells"]["infonet"] = &$infonet;

/*
The Class itself...
*/
class InfoNet
{
        var 
$bot;

        function 
InfoNet(&$bot)
        {
                
$this -> bot = &$bot;
        }

        function 
tells($name, $msg)
        {
                if (
$name == "Infonet")
                {
                        
$this -> bot -> send_gc($msg);
                        return 
true;
                }
                return 
false;
        }
}
?>

Logged
Hyde
Rookie
**
Offline Offline

Posts: 35


Re: Coding a /tell relay question
« Reply #2 on: December 02, 2007, 11:50:30 PM »

I finally got around to doing this. Attaching the initial (seems to be working) version.

Includes a primitive customizable profanity filter and will parse out infonet and elitenet formats to make them a less spammy on orgchat.
Logged

Doctorhyde/Jexyll/Goraud@RK2
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Coding a /tell relay question
« Reply #3 on: February 07, 2008, 05:00:22 PM »

Hiya folks, been awhile Smiley I'm upgrading my bot since I still run it for my old guild though I don't play anymore. Starting it from scratch. Tried this announcer and it doesn't seem to do anything. I am still getting tells from infonet but the module never seems to react to it. Still am getting familiar with this bot and all the changes (used to 2.x) so is there anything I need to enable or some security setting I need to do?
Logged

Eternalist
General of The Syndicate
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Coding a /tell relay question
« previous next »
 
Jump to:  

Recent
Help with online info in ...
by Barlyman
[Today at 07:56:24 PM]

BeBot v0.5.3 released (de...
by Temar
[Today at 07:51:18 PM]

Security
by Alreadythere
[September 06, 2008, 10:02:42 AM]

Probs with relay from gue...
by Temar
[September 06, 2008, 09:03:06 AM]

Raid spam in guild chat
by Temar
[September 06, 2008, 09:01:18 AM]

Org Relaying
by Nytridr
[September 06, 2008, 01:34:35 AM]

Link 2 Guilds via 2 Bots?
by Temar
[September 05, 2008, 04:22:40 PM]

SVN download
by clashbot
[September 05, 2008, 05:12:59 AM]

TWC
by Temar
[September 05, 2008, 12:27:23 AM]

How to find the guild ID?...
by Irinir
[September 03, 2008, 02:58:54 PM]
Stats
Members
Total Members: 965
Latest: morisey
Stats
Total Posts: 10414
Total Topics: 1413
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 5
Guests: 22
Total: 27
egrath
blackspell
paranoiak
Zeephonz
Barlyman

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.787 seconds with 28 queries. (Pretty URLs adds 0.044s, 4q)
Loading...