BeBot - An Anarchy Online and Age Of Conan chat automaton
General => Feedback and Suggestions => Topic started by: Zimble on August 09, 2006, 04:23:25 pm
-
I don't know if this has been mentioned before, but the !server command of Bebot doesn't work on RK3.
In server.php around line 84 the dimension number is read from the bot.conf and the probes.xml provided by funcom is searched for name="dNUMBER"
While this works on Atlantean and Rimor, it doesn't work on "Die neue Welt" coz this server isn't named d3 in probes.xml but dg.
I fixed this by adding another check before the explode function and modified the explode statement:
<?php
$server = $this -> bot -> get_site("http://probes.funcom.com/ao.xml");
if( ($dim = $this -> bot -> dimension) == "3" ) $dim = "g";
$server = explode("name=\"d" . $dim . "\"", $server);
?>
-
Thanx for the report.
Submitted fix to SVN.
The following code should work properly:
$server = $this -> bot -> get_site("http://probes.funcom.com/ao.xml");
$server = explode("name=\"" . $this -> select_dimension() . "\"", $server["content"]);
$server = explode("</dimension>", $server[1]);
And adding the following function
/*
Pick the correct dimention
*/
function select_dimension()
{
switch($this -> bot -> dimension)
{
case '0':
$return = "dt";
break;
case '1':
$return = "d1";
break;
case '2':
$return = "d2";
break;
case '3':
$return = "dg";
break;
}
return $return;
}
-
Thx for the quick fix, Khalem.
Will submitthis to our bot admin, as soon as I catch him ingame :)
-
I put your fix inside the Server.php Khalem. And the Result is:
Warning: Unexpected character in Input: '\' (ASCII = 92) state=1 in D:\MyBots\Thisbot\modules\Server.php
Parse Error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\MyBots\Thisbot\modules\Server.php
This is a Bebot v 0.3.3 on a Windows 2003 Server with the php5 from the Download.
(And Sorry for my bad English.)
-
There was a missing double quote in the second line of the first code block. Already fixed in SVN, updated the quoted code.
Edit: And missing braces.