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?
December 02, 2008, 11:30:43 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 656 times)
0 Members and 1 Guest are viewing this topic.
Hyde
Rookie
**
Offline Offline

Posts: 46


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: 1085


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: 46


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
!items database
by Zeephonz
[Today at 08:05:21 PM]

Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11146
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 18
Total: 20
Elesar1
Vain

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