BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Glarawyn on November 16, 2006, 09:41:03 pm

Title: Installing BeBot (Windows).
Post by: Glarawyn on November 16, 2006, 09:41:03 pm
To run BeBot you need three things. MySQL, PHP, and the BeBot files. MySQL is an open source database server. PHP is PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Similar in function to ASP, Perl, VBS, etc. BeBot is what you're trying to run. :)

Phase 1: MySQL.
If you can't get MySQL setup and working, you won't be able to get a functioning bot. Start with my     
MySQL n00b guide (http://bebot.link/index.php/topic,384.0.html) to get MySQL setup and ready for BeBot.

Phase 2: BeBot & PHP:
Kahlem has provided a PHP Bundle (http://files.shadow-realm.org/bebot/BeBot-php_v5.1.5.zip) to run with BeBot. The PHP support files have been separated from the BeBot files to ease updating.

You can install the bot in any directory you wish, however I'm going to use C:\BeBot for simplicity.

Extract the bot files (http://files.shadow-realm.org/bebot/BeBot_v0.2.9.zip) to C:\BeBot. Then extact the php bundle (http://files.shadow-realm.org/bebot/BeBot-php_v5.1.5.zip) to the same directory. The contents of c:\BeBot should now look something like:


Using your favorite text editor, edit the files conf/Bot.conf and conf/MySQL.conf to match your AO Account Info, Guild Info, and MySQL configuration.

Start the bot by running the start.bat file. If you did things right, the bot will start up and connect to the AO chat servers.
Title: Re: Installing BeBot (Windows).
Post by: Khalem on November 16, 2006, 10:10:11 pm
Duplicated this at http://bebot.link/wiki/install
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 23, 2006, 06:47:39 am
Ok. I did the mysql as well as I could (Took me a bit) and now I'm stuck on (Drumroll) BeBot!
I configured the .conf files by changing name from .conf to .txt and editing then saving and renaming back to .conf. Doing good so far.
Now I got to run the "Start.bat" file and guess what?

"'php' is not recognized as an internal or external command,
operable program or batch file.

C:\BeBot>pause
Press any key to continue . . ."

It STAYS this way. When I press any key it closes. Making no visible effect.
A few questions;
1) Is it correct that you should run bot on a diferent accaunt? I have a Froob accaunt RK1 for this purpose.
2) Is phase 5 Necesary for BeBot to run? Because I seem to be unable to do it;

"Microsoft Windows XP [Version 5.1.2600]
<C> Copyright blahblahblah

C:\Documents and Settings\Owner>mysql -u orothrim -p bebot < c:\bebot\items.sql;

The system cannot find the file specified.

C:\documents and settings\owner>"

All help aprecciated.
Now I'm going to bed. My bum hurts my eyes are watery and I have a mothelode Headache for sitting here for 4 hours trying to figutre the damn thing out. Blasted scripts!
Title: Re: Installing BeBot (Windows).
Post by: Vhab on November 23, 2006, 07:23:22 am
please edit out those account details asap and change your password asap!

more on topic: it seems you didn't have the php-bundle downloaded or copied to the directory of your bot.
and the mysql error indicates you didn't download mysql.

also, you don't need to (but you can) run the bot on a different account, just a different character.
Title: Re: Installing BeBot (Windows).
Post by: neongen on November 23, 2006, 04:29:10 pm
Quote
'php' is not recognized as an internal or external command,
operable program or batch file.

there you need to go into start.php and edit $php_bin = "php"; to $php_bin = "php.exe";

Quote
C:\Documents and Settings\Owner>mysql -u orothrim -p bebot < c:\bebot\items.sql;

The system cannot find the file specified.

make sure the file is there... the new bebot's don't have it anymore but it's still in the install guide for some reason i don't know  ;)
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 23, 2006, 07:07:57 pm
Quote
more on topic: it seems you didn't have the php-bundle downloaded or copied to the directory of your bot.
and the mysql error indicates you didn't download mysql.

also, you don't need to (but you can) run the bot on a different account, just a different character.

Didn't download? But It took the Create Database and so on commands perfectly.
If I hadn't downloaded it would have said "Cannot find file\script MySQL" or somesuch wouldn't it?
I unzipped the .php bundle to C:\BeBot where I have the Bot files themselves.

Quote
there you need to go into start.php and edit $php_bin = "php"; to $php_bin = "php.exe";

1) It is set to php.exe

Quote
make sure the file is there... the new bebot's don't have it anymore but it's still in the install guide for some reason i don't know  ;)

2) I can live without the item register. Is it a requirement for the bot to run right?
Title: Re: Installing BeBot (Windows).
Post by: Vhab on November 23, 2006, 08:04:34 pm
they changed items module a while back, it no longer uses that itemsdatabase.
so it'll run fine without. just ignore it said that in the guide.
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 23, 2006, 08:18:18 pm
ok I got it.
Now it does start out as a BeBot but on the $Server line when I put in my Nova@localhost it says;

Warning: mysql_connect<>: Unknown MySQL server host 'Nova@localhost' <11001> in C:\BeBot\MySQL.php on line 63
MySQL error <# 0> on query; Cannot connect to the database server!
Unknown MySQL server host 'Nova@localhost' <11001>

C:\BeBot>pause
Press any key to continue...

Now what?
Title: Re: Installing BeBot (Windows).
Post by: Alreadythere on November 23, 2006, 09:44:48 pm
Nova seems to be your mysql user.
localhost is your mysql server.
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 24, 2006, 01:06:46 am
Ok corrected that now it says;

Acces denied for user 'Nova'@'localhost' <Using password: YES)
In C:\BeBot\MySQL.php on line 63

OMG does it never end?
Title: Re: Installing BeBot (Windows).
Post by: edgehead on November 24, 2006, 03:30:13 am
I had the same problem, chances are you forgot to add ; after every command on mysql window (LIKE I DID).

Ex: Phase 4: Create a Database and Database User for BeBot
1. Type CREATE DATABASE databasename; (replace databasename with the name of the database you wish to create)

What I type (EXACTLY) was this: CREATE DATABASE bebot

What I should have typed was: CREATE DATABASE bebot;

Try and see if that makes a difference
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 24, 2006, 04:20:19 am
No its not that. Aparently my password has to be a 41 digit Hexadecimal number and I have no clue what the heck that is.
Title: Re: Installing BeBot (Windows).
Post by: neongen on November 24, 2006, 04:59:21 am
did you do
Type GRANT ALL on databasename.* TO username@localhost; (Again, change databasename and username, keep @localhost)
???

about the paasword i don't know i use password on 7 number
Title: Re: Installing BeBot (Windows).
Post by: Glarawyn on November 24, 2006, 05:27:57 am
In your MySQL.conf, remove @localhost from your user name. You seem to have missed this in my instructions.

For the items.sql, there is big red text that states IMPORTANT: This only applies for BeBot version older than 0.2.4.

As you've skipped some key parts in the instructions already, I would suggest a careful rereading of the instructions for anything you may have missed. That might shed some light on your troubles.

Since your stuck on php not found, did you download and install the php bundle? Do the contents of your bebot directory matches the contents posted? If not, figure out where you went wrong, you may need to move the php bundle files or something.
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 24, 2006, 02:12:36 pm
I am mostly doing this before or after work so I'm somewhat fuzzy.
Patience please. This is my first bot and the first time I've messed with PHP.
I had forgotten what version of BeBot I had installed. Don't know why i didn't look it up.
This is what I did;

Quote
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner>mysql -u root -p
Enter password: *********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 5.0.27-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE Bot;
Query OK, 1 row affected (0.03 sec)

mysql> CREATE USER Nova@localhost;
Query OK, 0 rows affected (0.03 sec)

mysql> SET PASSWORD FOR Nova@localhost = '*******';
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
mysql> SET PASSWORD FOR Nova@localhost = '******************************';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL on Bot.* TO Nova@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

Current settings;

 
Quote
$dbase = "Bot";
    $user = "Nova";
    $pass = "*************************************";
    $server = "localhost";

The password is what is not working properly I think because when I try to log it on:

Quote
(BeBot Logo deleted because of size)
Warning: mysql_connect(): Access denied for user 'Nova'@'localhost' (using password: YES) in C:\BeBot\MySQL.php on line 63
MySQL error (# 0) on query: Cannot connect to the database server!
Access denied for user 'Nova'@'localhost' (using password: YES)

C:\BeBot>pause
Press any key to continue . . .

I have all the files listed.
Title: Re: Installing BeBot (Windows).
Post by: Glarawyn on November 24, 2006, 05:31:18 pm
You aren't using the proper syntax for setting the MySQL password.

SET PASSWORD FOR Nova@localhost = PASSWORD('*******');

The PASSWORD() function will create the 40 character hex whatever for you based on the string you provide the password function. Again, review the instructions carefully to find what you missed as the proper command for setting your MySQL password was included.
Title: Re: Installing BeBot (Windows).
Post by: Nova on November 25, 2006, 01:32:48 am
Doh! It as the fact that the guide went on to a
second line that threw me off.
Its working fine now and after updating the roster (Dang i didn't know we had so many members!) its taking !on-line commands fine.
However its ignoring the !help commands... Is this because there is no !help command or is it buggy?
Also is there a list of commands somewhere?
Title: Re: Installing BeBot (Windows).
Post by: taconis on December 19, 2006, 08:33:01 pm
Win XP SP2, MySQL Server 5, running, PHP 5.2.0 (latest as of today), Apache 2.2, BeBot 2.10,

I too am getting the following when trying to call the bot up...


Warning: dl(): sockets: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=1
PHP    compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
 in C:\php\main.php on line 59
Loading php_sockets.dll failed. Sockets extention required to run this bot

Installed all extensions in my c:\php folder (where I have BeBot and PHP 5), modified the files, etc.  Sticks in a loop until I CTRL+C.  Apache has the stuff loaded, PHP 5 has Apache 2.2 modules loaded with the appropriate apache2blahblah.dll, etc.  What's causing the safty issue during compiling?
Title: Re: Installing BeBot (Windows).
Post by: Khalem on December 19, 2006, 09:05:39 pm
Your sockets.dll was compiled against a different major branch than the one you have installed.
Get a hold of sockets.dll for the php version you have installed, or just use the BeBot php bundle.

If you have the BeBot php Bundle aswell as having php installed on the system, make sure you edit the start scripts start.php and StartBot.bat so they point to the correct php.exe.
Title: Re: Installing BeBot (Windows).
Post by: taconis on December 19, 2006, 09:55:58 pm
Khalem,

I did that.  Both PHP 5.2.0 and BeBot 2.10 are in the directory c:\php.  I installed the BeBot PHP package and the rest of the files properly.  Apache 2.2 is fully operational, so is MySQL5 with me having it open and pointing to the bot's database.   c:\php\Startbot.bat actually calls startbot.php which was not in the actual BeBot packages for v2.10.  Both start.php and startbot.bat are calling the php.exe within the c:\php\ folder.  Main.php, bot.php, and conf.php all point to the proper directory of c:\php as required.

To call the bot manually, I used CMD and went to the c:\php directory and then called php.exe start.php.  I still get the compiler safety message when compiling php_sockets.dll.  I ensured that the php_sockets.dll from the php_extension folder is the one I am using in every single directory.  I also checked PATH to ensure pathing points to the c:\php folder.  php_sockets.dll is in the following directories:  c:\php, c:\php\dlls, c:\php\php_extension, c:\windows, c:\windows\system, c:\windows\system32, and just to make sure, c:\windows\system32\dllcache.

The only thing I see different is BeBot's PHP coding is to PHP 5.1.5 and I am using 5.2.0.  When using BeBot's php.exe (5.1.5) it totally errors out and gives me the lovely "Report error" window.  When using PHP's 5.2.0 php.exe it gives me the compiling error on php_sockets.dll.   If you like, I can de-install PHP 5.2.0 and just install the BeBot PHP bundle and give that a try.  I just can't  understand the compiling error if it's the same file in all those places.
Title: Re: Installing BeBot (Windows).
Post by: Khalem on December 19, 2006, 11:37:56 pm
Actually, what i'd reccomend at this point is simply wiping everything related to PHP and reinstalling only the stock php 5.2

The problem arise when you mix various major versions like 5.1 and 5.2

I'll look into getting the bundle updated and tested with BeBot asap.
SimplePortal 2.3.7 © 2008-2025, SimplePortal