BeBot - An Anarchy Online and Age Of Conan chat automaton
General => Feedback and Suggestions => Topic started by: keirou on March 10, 2009, 02:26:32 am
-
[GROUP] [MSG] [Third Time Lucky] Bustydemons: if you get a tank i can bring my ToS to help with option 2 and 3
[GROUP] [MSG] [Third Time Lucky] <remoteformat id="113577031" category="100" key="m@@!?CE%Uu+8Kxa9-B?\" knubot="0" ><parameter value="6;<remoteformat id="3" category="50100" key="oQ0sL&quot;D@uZi8ygL4Yty@" knubot="0" ></remoteformat>" /></remoteformat>
This is what happens when
[10:23] [Guild] [Bustydemons]: if you get a tank i can bring my ToS to help with option 2 and 3
[10:23] [Guild] Caelnach will be vulnerable for attack in 24 hours.
happens in game.
any way it can be cleaned up in bot log? or even removed?
-
*bump*
-
Not sure if it could easily be cleaned up, but filtering shouldn't be that hard. You'd have to add a check on inc_gsmg() for chat of no user starting with <remoteformat I guess.
Try adding the following after the line $args[2] = utf8_decode($args[2]); and before the directly following line if (isset($this -> commands["gmsg"][$group]) || $group == $this -> guildname || ($this -> game == "aoc" && $group == "~Guild")) in the inc_gmsg() function:
if ($args[1] == 0 && $this -> game == "aoc" && $group == "~Guild")
{
$parts = explode(" ", $args[2]);
if ($parts[0] == '<remoteformat')
return;
}
This code is untested though.
-
without sounding like a complete noob... how?
-
Make a backup of Sources/Bot.php
Open Sources/Bot.php in a text editor, notepad will do for this.
Add my code at the place mentioned above - first search for function inc_gmsg, then for the lines mentioned. Make sure you are at the right position.
After inserting the code save the file and restart the bot.
Good luck ;)
-
so
/*
* Incoming group message (Guildchat, towers etc)
*/
function inc_gmsg($args)
{
$found = false;
$group = $this -> core("chat") -> lookup_group($args[0]);
if (!$group)
{
$group = $this -> core("chat") -> get_gname($args[0]);
}
$args[2] = utf8_decode($args[2]);
if (isset($this -> commands["gmsg"][$group]) || $group == $this -> guildname || ($this -> game == "aoc" && $group == "~Guild"))
becomes
/*
* Incoming group message (Guildchat, towers etc)
*/
function inc_gmsg($args)
{
$found = false;
$group = $this -> core("chat") -> lookup_group($args[0]);
if (!$group)
{
$group = $this -> core("chat") -> get_gname($args[0]);
}
$args[2] = utf8_decode($args[2]);
if ($args[1] == 0 && $this -> game == "aoc" && $group == "~Guild")
{
$parts = explode(" ", $args[2]);
if ($parts[0] == '<remoteformat')
return;
}
if (isset($this -> commands["gmsg"][$group]) || $group == $this -> guildname || ($this -> game == "aoc" && $group == "~Guild"))
-
Yes.
-
bump!
any luck with this?