L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2008, 01:23:05 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Helpful posts > Topic: Bebot on linux
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Bebot on linux  (Read 2008 times)
0 Members and 1 Guest are viewing this topic.
Sojourner
Freshman
*
Offline Offline

Posts: 12


WWW
Bebot on linux
« on: August 30, 2005, 12:39:15 PM »

Had to flip through a couple posts on here and look for some stuff on the web to get up and running, so thought I'd try to make a single post for what I had to do to get up and running on a linux box.

First off, I'm no where close to a *nix guru of any sort.  Using a linux box for our org bots and web pages was a first go at using linux for me.   So, any corrections, simplifications, or helpful hints anyone has is appreciated.

Second, the box I installed on is runng Ubuntu, a flavor of Debian Linux.  So, some commands may differen based on your version.  But, hopefully this will be helpful.


Here we go:

1) Make sure you have php4-cli and php4-mysql installed
   $ dpkg -l | grep php

   You want to see -
      ii  php4-cli       4.3.10-10ubunt command-line interpreter for the php4 script
      ii  php4-mysql     4.3.10-10ubunt MySQL module for php4

   If you don't have either of them, install them
      $ sudo apt-get install php4-cli
      $ sudo apt-get install php4-mysql



2) Make sure you have the mysql server installed
   $ dpkg -l | grep mysql

   You want to see -
      ii  mysql-server-4 4.1.10a-2ubunt mysql database server binaries

   If you don't have it, install it
      $ sudo apt-get install mysql-server-4.1


3) Make sure you have unzip installed to unzip the files we download
   $ dpkg -l | grep unzip

   You want to see -
      ii  unzip          5.51-2ubuntu1. De-archiver for .zip files

   Otherwise install it
      $ sudo apt-get install unzip



4) Download the bebot files and the items db for it.  Commands here are for the current link to v0.2.1.1 and items db for 15.8.4, the exact url may change, double check Here first.
   From the directory you want to install bebot in:
      $ wget http://bebot.fieses.net/files/bebot_v0211.zip
      $ wget http://bebot.fieses.net/files/items150804.zip


   Once the files are downloaded, unzip the main bot files
      $ unzip bebot_v0211.zip

   Then, unzip the items database.  When you get the warning about overwriting the file, allow it
      $ unzip items150804.zip -d bebot


5) Configure the mysql database
   Log into mysql
      $ mysql -u root

   Create the database.  I called mine bebot (don't forget the semi-colon at the end of the line)
      mysql> CREATE DATABASE bebot;

   Make the new database the one you're issuing commands to
      mysql> USE bebot;

   Upload the items db file into the database.  
   I put my bebot directory in my home directory, so I used:
      mysql> SOURCE /home/MyUserName/bebot/items.sql;

   You'll get a ton of lines updated messages, and then everything is loaded

   Create a user in mysql that the bot can logon with
   This command gives the user "bebot" access to all tables on database bebot
   If they log in from the local host with the password 'bebotpassword'
   Again, don't forget the semi-colon on the second line but not the first
      mysql> GRANT ALL PRIVILEGES ON bebot.* TO 'bebot'@'localhost'
          -> IDENTIFIED BY 'bebotpassword' WITH GRANT OPTION;


6) Configure the bot's start.php file
   Use vi or gedit, or what ever editor program you use to configure these two lines
   The exact path to php may be slightly different for you
      $php_bin = "/usr/bin/php";
      $main_php = "./main.php";


7) Configure the Bot.conf file in the conf directory
   Most everything in there has self-explanatory comments.
   You can also look Here for information on configuring it for a radibot, or Here for a Guildbot


8) Configure the MySQL.conf file in the conf directory
   If you used all of the examples above, word for word, it would look like this:
       $dbase = "bebot";
       $user = "bebot";
       $pass = "bebotpassword";
       $server = "localhost";

9) Start the bot to make sure it works
   From the bebot directory:
      $ php ./start.php

10) If the bot loads, logs on, and everything is good, shut it down and finish up.  If not, you'll have to do some troubleshooting


11) Mark or move modules you don't want the bot to load.
   Look in the modules directory.  Any modules you don't want to bot to use/load you can rename to start with a _
      change Sever.php to _Server.php for example

   Or, I created an "Unused" directory in the module directory and moved the unwanted ones there, so I don't have to even look at them


12) Download any additional modules you want to load
   Look Here to see what is available


13) ((Optional)) Rename start.php to RAIDBOT.php, or something more easily recognized.  
   I run the bot in the background, so to kill it from command line, have to grep the ps to get the pid
   start.php seemed a bit generic to me, so I have it a name I can easily look for and certainly will not be used
      by anything I load in the future.


14) Start the bot again
   From the bebot directory:
      $ php ./RAIDBOT.php
   

15) If you get errors, go back and troubleshoot the modules, since you got it to work correctly earlier.  If it loads, you can kill it one last time and use this command to run it in the background and continue running even after you log off your sever:
   $ nohup php ./RAIDBOT.php &


16) Set up the Bot members
   If you're running a raid bot, Bot Admin does not equal bot member, so:
      Log onto the game with whoever you made bot admin
      "/tell BotName !member YourName"

      You can then add other members, andmins, and such manually

   If you're running a guild bot, once it starts up, it takes a couple minutes to get all the data from
      funcom's site, and then you should be good.
Logged
Blondengy
BeBot Creator and Founder
Administrator
Rookie
********
Offline Offline

Posts: 50


Bebot on linux
« Reply #1 on: August 31, 2005, 03:24:15 AM »

Nice tutorial there. I like it.
Quote from: "Sojourner"
I run the bot in the background, so to kill it from command line, have to grep the ps to get the pid

You might consider running the bot in "screen". That is a virtual console that you can connect to and disconnect from:

Code:
Start a new screen:
  screen -S mybot

Disconnect from the screen:
  Ctrl+a then d

Reconnect to the screen:
  screen -r mybot

To terminate a screen:
  log onto the screen
  terminate bot with Ctrl+c incase its still running (or use !shutdown)
  Type "exit"


This way when running the bot on a server and just beeing able to connect to the server via ssh you can always just log onto the screen an see what your bot is doing. When done just disconnect from it again and the bot will continue running and dumping its info into the screen's console.
Logged
Sojourner
Freshman
*
Offline Offline

Posts: 12


WWW
Bebot on linux
« Reply #2 on: August 31, 2005, 11:57:05 AM »

Hmm, I've only got cli on the box, no XWindow / GUI / etc.

Does the screen command still apply?  Commands don't work on the box I have, no man for it, can't seem to find anything online (screen too generic of a search word)
Logged
Blondengy
BeBot Creator and Founder
Administrator
Rookie
********
Offline Offline

Posts: 50


Bebot on linux
« Reply #3 on: August 31, 2005, 06:14:45 PM »

If you got a Debian system (like Ubuntu):
Code:
sudo apt-get install screen


Its purely console based... slim and next to no extra CPU/Mem usage... Very usefull for running console apps through shh on a linux machine. I have 3 BeBot versions and several other proggys running over it... (if you just use "screen" to start a screen without the "-S name" you can reconnect to the screen using "screen -r pid_of_screen"... or just "screen -r" incase you only have one screen running. If you have more than one screen running "screen -r" will bring you a list of all screens you can reconnect to.
Here the manpage of it: click
Logged
Shelly
Freshman
*
Offline Offline

Posts: 11


Bot Check for Linux
« Reply #4 on: September 05, 2005, 08:46:57 AM »

I created a small perl script to make sure my bot is running and haven't seen anything like it on the boards, so I am sharing it here.  Cool

Shelly

bot_check.pl
#!/usr/bin/perl

# Author: Shelly
# Notes:
# 1. Replace all "YourBotName" with what ever the name of your bot.
# 2. Replace your_account\@your_mail_host with the email address you want to recieve your
# logs and notifications at.
# 3. I also place the bot in it's own directory (YourBotName), but save the logs in bebot's home directory.
# This way I can run multiple bots.
# 4. Crontab Entry for Fedora Core/ Vixie Cron
# 0/10 * * * * cd /home/bebot; ./bot_check.pl >/dev/null

#
##
### Check for AO Bots and restart if necessary
##
## bebot 12007 11929 0 11:45 pts/0 00:00:00 php -f YourBotName/start.php
#

$mdate = `date +%b-%d-%Y`;

$z = `ps -ef |grep YourBotName |grep -v grep`;
chop($z);
if ($z eq "")
{
system("mail your_account\@your_mail_host -s \"Starting YourBotName bot on web1\" </home/bebot/YourBotName.log");
system("mv /home/bebot/YourBotName.log /home/bebot/YourBotName.log-${mdate}");
system("cd /home/bebot; /usr/local/bin/php -f /home/bebot/YourBotName/start.php > /home/bebot/YourBotName.log &");
}
Logged
Zarkingu
Rookie
**
Offline Offline

Posts: 34


Re: Bebot on linux
« Reply #5 on: January 27, 2006, 10:49:12 PM »

I've just thrown my old Win2003 server out the window and got a brand new Kubuntu server up and running. I've come as far as to the bot login, but getting an error when the bot it authenticating.

Code:
AOChat: not expecting login.

Any clues as to what might be wrong?

This is what I got installed:
php4-cli  4.4.0-3
php4-mysql 4.4.0-3

mysql-server 4.0.24 10ubuntu2 mysql database server binaries
Logged

Zarkingu 210 MP RK2
Khalem
BeBot Founder
Administrator
Grandmaster
********
Offline Offline

Gender: Male
Posts: 670



WWW
Re: Bebot on linux
« Reply #6 on: January 27, 2006, 11:37:25 PM »

http://bebot.shadow-realm.org/index.php/topic,274.0.html
Logged

BeBot Founder and Fixer Kingpin
Madman coder and destroyer of good code
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > Helpful posts > Topic: Bebot on linux
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 0
Guests: 17
Total: 17

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.198 seconds with 29 queries. (Pretty URLs adds 0.033s, 4q)
Loading...