BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.4 support => Topic started by: Metaphblade on January 28, 2008, 07:05:58 am

Title: linux (slackware) and bebot
Post by: Metaphblade on January 28, 2008, 07:05:58 am
For about a week now, i have been trying to setup a bot on my new slackware box.  i have been VERY unsucessful.  I can actually start the scripts, however, i dont get very far into it, and i get errors, and the bot shuts down.

When running Main.php (this is what startdebug.bat runs, so i ran it so it didnt loop), i get the following error.

Code: [Select]
?>PHP Notice:  Undefined variable: log_path in /orbbot/Main.php on line 144
PHP Notice:  Undefined variable: bot_name in /orbbot/Main.php on line 144
PHP Notice:  Undefined variable: dimension in /orbbot/Main.php on line 144
PHP Notice:  Undefined variable: bot_name in /orbbot/Main.php on line 151
MySQL database connection test successfull
PHP Notice:  Undefined property:  MySQL::$close in /orbbot/Sources/MySQL.php on line 188
PHP Fatal error:  Class 'AOChat' not found in /orbbot/Main.php on line 152
root@bladeslinux:/orbbot# php StartBot.php
PHP Notice:  Undefined offset:  1 in /orbbot/StartBot.php on line 74

any ideas on this one?
Title: Re: linux (slackware) and bebot
Post by: Alreadythere on January 28, 2008, 12:29:18 pm
One thing first: you shouldn't run the bot as root, create a different user and use that to run the bots. Much saver.

The first couple of notices all point to one common problem. The variables of the Bot.conf aren't set, looks like the bot cannot open it. Or maybe they are commented out somehow?

The fatal error about AOChat points in a similar direction, for some reason php cannot create the AOChat instance. Either an error in the file or a problem of accessing the right file. Are all rights to the files correct? Perhaps you have to retry with a new clean download of the bot. The MySQL error could be something similar.

The notice you get as you call StartBot.php can be ignored. I'll add a check to remove that in the next version.
Title: Re: linux (slackware) and bebot
Post by: Glarawyn on January 28, 2008, 05:56:35 pm
Extract your bot to a directory...

cd into the directory cd /home/user/mybebot

run php StartBot.php

Everything should start fine if php has all the required php modules.
Title: Re: linux (slackware) and bebot
Post by: Metaphblade on January 28, 2008, 10:55:59 pm
Extract your bot to a directory...

cd into the directory cd /home/user/mybebot

run php StartBot.php

Everything should start fine if php has all the required php modules.

This is actually how i am running the bot.
cd botname
php Main.php

errors pop up


Had schoold today, and rest of the week, and work all week, so i probably wont be able to mess with this much more till friday night. 
Title: Re: linux (slackware) and bebot
Post by: Metaphblade on February 06, 2008, 08:44:01 am
well....i got the bot to run with Main.php.  only a few hiccups, few commands such as !is, and a few others weren't working.  ill troubleshoot those later.  my main concern is, when i start the bot with

php Startbot.php
i get an error message saying that this bot needs mysql to run, however, when i run
php Main.php
it access the mysql database just fine.

any thoughts on this?

****edit****
this is also on a current download of the SVN.  all commands and regular start works fine using this version on my winblows box.
Title: Re: linux (slackware) and bebot
Post by: Alreadythere on February 06, 2008, 11:28:36 am
Sounds like the php.ini in the bot root directory doesn't load the mysql plugin in your config. Make sure it loads the mysql module.
Title: Re: linux (slackware) and bebot
Post by: Glarawyn on February 06, 2008, 05:20:26 pm
My experience on Linux systems is it's best to nuke the php.ini distributed with BeBot. :)
Title: Re: linux (slackware) and bebot
Post by: Tichy on February 09, 2008, 12:25:16 pm
The php.ini shipped with BeBot specifies a new extension path. This will never work on linux systems using prebuild packages. Just comment the line in BeBot's php.ini:

Code: [Select]
; Mainly for windows where additional modules are always required
;extension_dir = ./php_extension/

Title: Re: linux (slackware) and bebot
Post by: Metaphblade on February 17, 2008, 09:46:24 pm
The php.ini shipped with BeBot specifies a new extension path. This will never work on linux systems using prebuild packages. Just comment the line in BeBot's php.ini:

Code: [Select]
; Mainly for windows where additional modules are always required
;extension_dir = ./php_extension/



well....i commented that, then added php.ini to the bot (was using the one with linux), uncommented extension=mysql.so.  now i dont get the sql error, but i get another error.

Code: [Select]
AOChat class needs the BCMath extension to work.
PHP Notice:  Undefined offset:  1 in /orbbot/StartBot.php on line 75

this is what is in that area of code.

Code: [Select]
line 74 $last_line = system($php_bin . $php_args . " " . $main_php . " " . $argv[1]);

line 76     if (preg_match("/^The bot has been shutdown/i", $last_line))

there is no code on line 75
Title: Re: linux (slackware) and bebot
Post by: Alreadythere on February 17, 2008, 10:09:14 pm
bcmath is default in any php config I think.

And the notice is due to the argv[1], it's most likely not set. Adding a check for parameters is on my todo list ;)
Title: Re: linux (slackware) and bebot
Post by: porter on February 18, 2008, 09:30:29 pm
bcmath is default in any php config I think.

Not true. Before compiling PHP you need to remember to configure it with --enable-bcmath - it is entirely possible that the PHP version the original poster has does not include BCMath. I have not used Slackware in, uhh, don't know, this century at least, so not sure how they package PHP or anything but if you did not compile PHP yourself you might want to check if they have additional extensions for PHP available.

[edit] To clarify the above, PHP source includes BC Math since 4.04 or so but different binary distributions may not have it compiled in. Apparently it is always compiled in Window$ versions.
SimplePortal 2.3.7 © 2008-2024, SimplePortal