collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Bot reboots  (Read 7175 times)

0 Members and 1 Guest are viewing this topic.

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Bot reboots
« on: September 14, 2007, 12:57:21 am »
I am new to bebot but for some reason everytime someone logs into the bot it restarts itself how can I make it stop?

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Bot reboots
« Reply #1 on: September 14, 2007, 01:30:09 am »
Edit the Startbot.php file so that the code
Code: [Select]
while (true)
{
    $last_line = system($php_bin . $php_args . " " . $main_php . " " . $argv[1]);

    if (preg_match("/^The bot has been shutdown/i", $last_line))
    die();
    else
    sleep(1);
}
looks like this:
Code: [Select]
while (true)
{
    $last_line = system($php_bin . $php_args . " " . $main_php . " " . $argv[1]);

//    if (preg_match("/^The bot has been shutdown/i", $last_line))
    die();
//    else
//    sleep(1);
}

That should enable you to see the error that forced the bot to restart. Post that error here.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #2 on: September 14, 2007, 01:42:37 am »
[13-Sep-2007 18:41:54] PHP Fatal error:  Cannot use string offset as an array in C:\Documents and Settings\Kim\Desktop\Stpeter2\modules\Logon_GUILD.php on line 149

thats out of the logfile

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bot reboots
« Reply #3 on: September 14, 2007, 01:58:39 am »
what version 0.4.1?

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #4 on: September 14, 2007, 02:01:21 am »
$bot_version = "0.3.5"; its what my friend sent me I suppose that could be my issue...

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Bot reboots
« Reply #5 on: September 14, 2007, 02:02:21 am »
I am thinking defunct database or old schema for the whois-cache.

In any case I would really recomend running the latest official release.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #6 on: September 14, 2007, 02:02:48 am »
I may just upgrade it..

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #7 on: September 14, 2007, 02:06:37 am »
if i can figure everything out again I kinda had help before heh

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Bot reboots
« Reply #8 on: September 14, 2007, 02:07:16 am »
Please post the 5 lines above and below 149 of your modules/Logon_guild.php-file so we can debug it.

You see it does appear that you're using a modified version of Logon_GUIILD.php because line 149 of the file tagged for 0.3.5 reads '}' and that line would not cause that error.
« Last Edit: September 14, 2007, 02:11:39 am by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bot reboots
« Reply #9 on: September 14, 2007, 02:11:33 am »
or rename the file to .phps and attach it :D

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #10 on: September 14, 2007, 02:15:23 am »
attatched

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Bot reboots
« Reply #11 on: September 14, 2007, 02:35:04 am »
Fixed should be
also changed it so it only says city is unsafe for 40mins which should be long enough for ground part

if your want to change how long city is unsafe edit line 151
if ($result[0][1] == "off" && $result[0][0]+(60*40) > time())
and change the 40 to howmany mins you want

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #12 on: September 14, 2007, 02:39:41 am »
well its not crashing thanks so much :)
« Last Edit: September 14, 2007, 02:44:36 am by Mrs »

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Bot reboots
« Reply #13 on: September 14, 2007, 02:44:47 am »
I'll have a go at a fix then. From the file you posted

Find line 149 in the code. It should be in the block reading

Code: [Select]
// Send city cloak status

$result = $this -> bot -> db -> select("SELECT time, action FROM #___org_city WHERE action = 'on' OR action = 'off' ORDER BY time DESC LIMIT 0, 1");

if ($result[0][1] == "on")
{
$state = "The city cloak is currently <font color=#00FF00>Enabled</font>. It is safe to enter the city";
}
else if ($result[0][1] == "off")
{
$state = "<font color=#FF0000>WARNING!!</font> <font color=#FFFFFF>The city cloak is currently <font color=#FF0000>Disabled</font>. It is NOT safe to enter the city</font>";
}
else
{
$state = "Unable to determine cloak status, Please be cautious when entering the city";
}
$this -> bot -> send_tell($name, $state);

This piece of code is erroneous as it doesn't take into account that the query will return empty if there are no matches for the query. The fix is quite easy:

Code: [Select]
// Send city cloak status

$result = $this -> bot -> db -> select("SELECT time, action FROM #___org_city WHERE action = 'on' OR action = 'off' ORDER BY time DESC LIMIT 0, 1");
if(!empty($result))
{
  if ($result[0][1] == "on")
  {
  $state = "The city cloak is currently <font color=#00FF00>Enabled</font>. It is safe to enter the city";
  }
  else if ($result[0][1] == "off")
  {
  $state = "<font color=#FF0000>WARNING!!</font> <font color=#FFFFFF>The city cloak is currently <font color=#FF0000>Disabled</font>. It is NOT safe to enter the city</font>";
  }
}
else
{
$state = "Unable to determine cloak status, Please be cautious when entering the city";
}
$this -> bot -> send_tell($name, $state);


Do note that this doesn't take into account that ground raids doens't last the full hour it takes for the cloak to be re-enabled as Temars fix did. However it's easier to make a small fix and then add such a fix later.

Edit: Missed a crucial line...
« Last Edit: September 14, 2007, 02:48:59 am by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Mrs

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Bot reboots
« Reply #14 on: September 14, 2007, 02:45:53 am »
its working now thanks guys <3

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 309
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal