User Tools

Site Tools


user:dm005264:start

Quests Mr_Roboto project

Instructions to create your own bot

This is how I created my bot, which you can find on the #botchan. His name is mr_roboto

First of all...What is a bot??

An IRC bot is a set of scripts or an independent program that connects to Internet Relay Chat as a client, and so appears to other IRC users as another user. An IRC bot differs from a regular client in that instead of providing interactive access to IRC for a human user, it performs automated functions. This definition of a bot is from http://en.wikipedia.org/wiki/IRC_bot

Getting started

The easiest way to start a bot is to use an existing program that's been used and refined for many years. My choice for this was to use an eggdrop bot.

Where do you get the eggdrop program?

I downloaded my eggdrop program from the website www.eggdrop.org.

Download and installation to your shell

  1. Go to the website mentioned above and go to the “Setting up and eggdrop” page
  2. Notice the zip file eggdrop1.6.19+ctcpfix.tar.gz
  3. Open up a session in lab46 and type the command wget and a space
  4. Copy the URL address for eggdrop1.6.19+ctcpfix.tar.gz from the website and paste it in after the wget command and hit enter
    • This will download the zip file to your shell
  5. To unzip the file, type the command gunzip eggdrop1.6.19+ctcpfix.tar.gz
  6. Now, to unzip the .tar file all you have to do is type tar zxvf eggdrop1.6.19+ctcpfix.tar
  7. Type the command cd eggdrop1.6.19, this will put you inside the eggdrop directory
  8. Type the command ./config
    • Wait for the file to configure
  9. Type the command make file
  10. Type the command make
  11. Type the command make install DEST=~/botdir
    • This will create a new directoy name botdir
  12. That completes the installation, now onto modifying your .conf file

Modifying your configuration file

  1. Locate the file eggdrop.conf inside your botdir directory
  2. Rename this file to something like [your bot's name].conf
  3. Open up the config file using VI. An example of the command for this is vi mr_roboto.conf
  4. Now…the config file is large (over 1300 lines long) you are going to have go through this line by line and read what lines to change. The config file is documented very well, so just read the notes and change the lines accordingly
  5. Here are some of the things you'll have to change/modify
    • Line 1: modify this line to the full path to the executable files for you eggdrop
      • Note: Make sure you keep the #! in front of your path name
    • Line 26: change the name of the bot to what you want to name your bot
    • Line 176: Change this to [your bots name].user
    • Line 199: If you want your bot to have a message of the day (MOTD), then make sure this line is un-commented
      • Note: You will have to go into the motd file and personalize the the contents of the MOTD
    • Line 351: Change the owner to yourself
    • Line 408: You must comment this line out or your bot wont work
    • Line 504: Change the channel to #botchan
    • Line 504 to 524: Un-comment each line
    • Line 513:remove all text between the brackets - this line should read auto-op {}
    • Line 796: If you want an alternate bot name then set it here
    • Line 800: set the real name to be displayed on the IRC
    • Line 812: Set default port to 6667
    • Line 824: Set the server name. example for this is set servers {irc.offbyone.lan}
    • Line 1024: change this etting to 1
    • Line 1206: change this to your root directory for file systems
    • Line 1264: Comment this line out or your bot wont run
    • Line 1341: Insert any additional scripts you want your bot to run - example source scripts/blackjack-eng.tcl
      • Note: you must have the scripts you're adding in the scripts directory to actually run

Phew….that covers the modification to the configuration file. Now onto getting you bot up and running on IRC and making yourself the bots master

Getting your bot up and running in an IRC

  1. Open up an IRC screen and type the command /join #botchan
  2. Type the command /names, you should notice your bot's name there
  3. Type the command /dcc chat [bot's name]
    • This will open a new (private) channnel for you and your bot to talk to one another. This is an important step as it will make you the master of your bot.
  4. The bot will ask for your name
  5. Then it will ask for you to create a password
  6. Now type “hello”

Now..Let's give your bot some personality and the ability to talk on his/her own in the channel. We will do this by installing MegaHAL

  1. Perform a wget on the version 2.7 sourcecode
  2. Go to the “documentation” page (scroll to the bottom of the site)
  3. Follow the steps under the Installing(non-Windrop) section

That's it, you should now have a functioning bot in the #botchan

  • Note: if your bot keeps trying to become the op of the channel then just go into your botdir and delete all .chan files. This should take care of the problem.
This wiki page is a "Work in Progress". If/when I find faults with the process then I'll update accordingly
user/dm005264/start.txt · Last modified: 2010/03/08 19:54 by dm005264