< Day Day Up > |
Hack 76 Set Up an Eggdrop Bot
Eggdrops have been around for quite a few years, so plenty of authors have had time to write Tcl scripts or C modules that make these kinds of bots very powerful. This hack shows you how to install and set up a simple Eggdrop. Eggdrop is the oldest IRC bot still in active development. It supports multiple channels and can be extended using Tcl scripts or C modules—thousands of which can be downloaded freely to perform common tasks, which Eggdrop does not support natively. Downloading, installing, and configuring Eggdrop is relatively simple. The first step is to connect to the server you will run the bot on, probably via SSH or Telnet. When you are connected, you can obtain a copy of the Eggdrop source code. The easiest way to obtain the latest version of the source code is to use wget. If you type wget eggheads.org, the current (stable) version of the Eggdrop code will be downloaded to the current directory, as shown in Figure 12-1. Figure 12-1. Using wget to get the Eggdrop source codeIf your server does not have wget installed or you would rather not use it, you can download the files manually from http://www.eggheads.org and upload the files to the server via FTP or SCP. The Eggdrop source code is distributed as a tarball, so the next thing to do is "untar" it. This is done using the tar command, like so: % tar zxvf eggdrop1.6.15.tar.gz You may need to change the filename if you have downloaded a more recent version. This will copy all of the files in the tarball to a new directory, as shown in Figure 12-2. Figure 12-2. Eggdrop extracted into its own directoryNow change to the new directory: % cd eggdrop1.6.15 If you are curious about Eggdrop, you may want to read the README and INSTALL files. They contain information on installing and running Eggdrop. When you have read these files, you can run Eggdrop's configure script: % ./configure This allows Eggdrop to adjust its settings so it can work correctly on your system. When this has finished, type: % make config This allows Eggdrop to configure the modules it needs. When the default modules have finished compiling, you should see something like Figure 12-3. Figure 12-3. Configuring the required modules with make config% make This will compile the bot, but it may take a few minutes depending on the speed of your server. Now you're ready to install the bot. Type this: % make install and you should see something like Figure 12-4. Figure 12-4. Installing EggdropThis will install Eggdrop into ~/eggdrop—that is, it will create an eggdrop directory in your home directory. cd to this folder, and you are now ready to edit the configuration file for your Eggdrop. 12.5.1 Configuring EggdropThe first step is to open the config file in your favorite editor, for example: % pico -w eggdrop.conf As you look through the file, remember that all the lines that begin with a hash (#) are comments and will not be interpreted by Eggdrop. You can safely ignore most of these if you're in a rush, but they can often provide valuable help when it comes to setting up the more exotic features. Most of Eggdrop's settings are in the form of set variable "value", which assigns the "value" to the variable. For example set nick "Hacky" would set the Eggdrop's nickname to "Hacky." The most important settings follow:
When you have finished editing the file, save the changes and quit back to the shell. You can now start the bot by typing: % ./eggdrop -m eggdrop.conf This launches the bot for the first time. To run it again, type: % ./eggdrop eggdrop.conf —Chris Smith |
< Day Day Up > |