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
-
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..
-
Which prefix do you want to have optional and definable? The !gcr in front of each line relayed?
-
i dont see why any 1 would want to turn off or change !grc is for bot use only
-
One reason would be the bots using different command prefixes.
-
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..
-
Should that command be instead of relaying all chat over the bots?
-
yer he mean only relay when prefix @ or wateva is at beginning
-
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..
-
Nyth you got this prefix working yet? im loking for it atm too
-
You can make your own script without using the relay module. Something like
<?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], 0, false);
}
}
}
?>
Add bots as leader and !r blahblah should return [Botame]Nogoal: blahblah
-
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>.