BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Module Requests => Topic started by: Nytridr on August 31, 2007, 10:16:20 am

Title: prefix for relaying
Post by: Nytridr on August 31, 2007, 10:16:20 am
would like to see the ability to turn on/off using prefix's to relay over the relay bot.  and able to define what the prefix will be..

Title: Re: prefix for relaying
Post by: Alreadythere on September 03, 2007, 08:50:55 pm
Which prefix do you want to have optional and definable? The !gcr in front of each line relayed?
Title: Re: prefix for relaying
Post by: Temar on September 03, 2007, 11:05:38 pm
i dont see why any 1 would want to turn off or change !grc is for bot use only
Title: Re: prefix for relaying
Post by: Alreadythere on September 03, 2007, 11:40:38 pm
One reason would be the bots using different command prefixes.
Title: Re: prefix for relaying
Post by: Nytridr on September 03, 2007, 11:50:54 pm
I am not talking about the !gcr command..

okay your talking in org chat.. and if you have a prefix set up.. then anything you say would stay in org chat instead of being relayed.

So say you want to say something to the rest of the group you would put
@hello everyone hows eveyrone doing?

Everyone would get the above message across the linked bots..
Title: Re: prefix for relaying
Post by: Alreadythere on September 04, 2007, 12:08:49 am
Should that command be instead of relaying all chat over the bots?
Title: Re: prefix for relaying
Post by: Temar on September 04, 2007, 01:48:42 am
yer he mean only relay when prefix @ or wateva is at beginning
Title: Re: prefix for relaying
Post by: Nytridr on September 04, 2007, 02:49:31 am
Should that command be instead of relaying all chat over the bots?

have it where it can be set either way..in the settings..   and be able to shut it on and off..

Title: Re: prefix for relaying
Post by: Pharexys on October 03, 2007, 03:52:38 pm
Nyth you got this prefix working yet? im loking for it atm too
Title: Re: prefix for relaying
Post by: Nogoal on October 04, 2007, 10:14:05 am
You can make your own script without using the relay module. Something like

Code: [Select]
<?php

$prerelay 
= new prerelay($bot);

$commands["gc"]["r"] = &$prerelay;
$commands["tell"]["pr"] = &$prerelay;


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




/*
Constructor:
Hands over a reference to the "Bot" class.
*/
function prerelay (&$bot)
{
$this -> bot = &$bot;

$this -> bot -> accesscontrol -> create('tell''pr''LEADER');

$this -> help['description'] = "Plugin to enable communication between 2 org bots without using relay";
}



/*
This gets called on a tell with the command
*/
function tell($name$msg)
{
if (preg_match("/^" $this -> bot -> commpre "pr (.+)$/im"$msg$info))
{
$this -> bot -> send_gc($info[1]);

}
}

/*
This gets called on a msg in the guildchat with the command
*/
function gc($name$msg)
{
if ((preg_match("/^" $this -> bot -> commpre "r (.+)$/im"$msg$info))

{

$this -> bot -> send_tell(Botname_from_other_org,"<pre>pr [<botname>]".$name.": ".$info[1], 0false);
}
}




}
?>

Add bots as leader and !r blahblah should return [Botame]Nogoal: blahblah
Title: Re: prefix for relaying
Post by: Pharexys on October 11, 2007, 10:26:51 am
I made it with database.

* Put Alliance1.php and Bot.php in your /custom/modules/
* Does not work if you run 2 bots on same database, fast fix is to change name of database to one of bots. Exemple from bots to bots1.
* As said by Nogoal, you need add bots to Leader Group.
Commands:
[tell] !bot <botname> - Adds <botname to database.
[tell] !botlist - Shows all Bots and theyr Organization.
[tell] !botremove <botname> - Removes <botname from database.
[GC] !r <msg> - To chat with Allied Guilds.

TO DO:
* Couldnt get the show of Guilds to work properly, it shows the guild name it sends msg too at this moment.

Fixes:
*Got the Guild name showing and removed the add of guildname needed. Made it automatly :D
*Fixed a typo that made bot restart.

PLEASE REDOWNLOAD IT AND IF YOU ALREADY ADDED BOTS TO DATABASE, REMOVE THEM WITH !Botremove, and Re-add them with the new command, !bot <botname>.



SimplePortal 2.3.7 © 2008-2025, SimplePortal