Multiple

From Bebot Wiki 2
Revision as of 21:52, 16 September 2020 by B3b0tUzR (talk | contribs) (Created page with 'Introduction BeBot 0.3.4 and higher allow you to use one directory tree among multiple bots. This way you can easily keep several bots on the same version of modules without muc…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

BeBot 0.3.4 and higher allow you to use one directory tree among multiple bots. This way you can easily keep several bots on the same version of modules without much work. You can even define on a per-bot basis which directories besides the default core/, modules/ custom/core/ and custom/modules/ ones should be used for which bot. Setting up the config files

To share several bots in one directory tree you have to create one config file per bot. The name for those config files must be Botname.Bot.conf, with first letter of the botname in upper case, all other in lower case (this is to make sure that *NIX systems find the config file, under windows the spelling doesn't matter as windows doesn't differentiate between Filename and filename). Further you have to comment the definitions for $table_prefix and $master_tablename out by adding a double slash in front of it. You cannot define those values for prefix and mastertable on a per-bot base anymore, instead the bots will use botname as prefix and botname_tablenames as master table.

The Botname must match exactly the ingame name of the bot (so Bot does not match Bot07). Starting the bots

Instead of starting the bot via simple php StartBot.php, assuming php is the command to your php binary, you have to start the bots via php StartBot.php botname now. The case of botname doesn't matter, it is internally converted to upper-case first, all other chars lower-case. The startup files for the bot will now use the file Botname.Bot.Conf as config file instead of the default Bot.conf ones. Defining custom directories for a bot

It's possible to define additional core and modules directories for each single bot, in addition to the default core/ and modules/ directories, as well as the optional (but used if existing) custom/core/ and custom/modules/ directories. The additional directories are defined as a comma seperated list of directories relative to the base directory of the bot. The variables to define those directories are $core_directories for additional core directories and $module_directories for additional modules directories. If you got the directory modules2 and modules3 besides the default modules one in your bot directory, and want to use both of them as additional modules directories, your config file should contain the line $module_directories = “modules2,modules3”.