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

Title: Another Bebot on RK3 fix - server.php
Post 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:
Code: [Select]
<?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);
?>

Title: Re: Another Bebot on RK3 fix - server.php
Post by: Khalem on August 09, 2006, 05:21:01 pm
Thanx for the report.

Submitted fix to SVN.
The following code should work properly:
Code: [Select]
$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
Code: [Select]
/*
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;
}
Title: Re: Another Bebot on RK3 fix - server.php
Post by: Zimble on August 09, 2006, 06:58:36 pm
Thx for the quick fix, Khalem.
Will submitthis to our bot admin, as soon as I catch him ingame :)
Title: Re: Another Bebot on RK3 fix - server.php
Post by: Sammajos on August 11, 2006, 04:53:45 pm
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.)

Title: Re: Another Bebot on RK3 fix - server.php
Post by: Khalem on August 11, 2006, 11:42:32 pm
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.
SimplePortal 2.3.7 © 2008-2024, SimplePortal