This tutorial will help to guide you through the initial
stages of downloading an Eggdrop v1.6.16 IRC bot and giving it
a minimal safe configuration to connect to an IRC server,
accept you as its owner and join its first channel.
With development on it starting in 1993, Eggdrop is one of the
oldest, if not the oldest, IRC robot (or "bot") programs still
in development today. Originally a *nix program, it has been
ported to several other platforms from Windows right through to
the Amiga. It is highly popular throughout IRC. The chances are
that if you see a bot in a channel, it is an Eggdrop.
Does your channel need an Eggdrop? Well, unless yours is a
channel that sees just one or two members for a little while
all at the same time each day, it's almost certain that an
Eggdrop would be of some benefit. Popular uses for Eggdrops
include:
- Providing limited Memoserv/Chanserv functions between knownusers on networks without those services.
- Keeping people you don't want in the channel out.
- Preventing channel takeovers, floods and other hostile/lameactions within a channel.
- Providing a private place for users with access to talkwith each other, via the Partyline
- Logging of the channel 24/7, so constant surveillance ispossible.
Now, before you go running and firing up Firefox, there are
just a couple of requirements before you get going:
- A *nix shell of some sort. (You could run it on your ownbox, but running from a shell is the most common way of runningserious Eggdrops and the one I will predominately deal with inmy tutorials.)
- TCL 8.4 - A scripting language used by Eggdrop scripts andEggdrop's configuration files
Now, log into your shell and get the Eggdrop tarball:
wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.6/eggdrop1.6.16.tar.bz2
Once this has finished downloading (if you don't have wget
you'll have to crack open an ftp client of course) extract it
using:
tar jxvf eggdrop1.6.16.tar.bz2
Everything in the tarball will now be extracted into a
directory called eggdrop1.6.16. Change into this directory and
type the following:
./configure && make config && make
This will create the correct makefiles for your system,
compile the default set of modules and then make Eggdrop
itself. The entire process will take a few minutes the first
time you do it. When all this is done, you just need to
install: (WITHOUT assuming root)
make install
The Eggdrop is now installed in ~/eggdrop. Change into this
directory but don't go running Eggdrop just yet, lest you see:
[11:17] * Please make sure you edit your configuration
file completely.
Right before Eggdrop terminates immediately. We won't be
editing the configuration file absolutely completely here, but
we will edit it enough to get your Eggdrop onto IRC safely.
Open eggdrop.conf in vi/emacs/pico/chisel and stone tablet.
Immediately you will see a line worthy of your attention:
#! /path/to/executable/eggdrop
This is a shebang and means that if you execute this file
from your shell, it will be passed to the file mentioned on
this line to be interpreted. This is especially useful for
running several differently-configured bots from one set of
Eggdrop binaries. Change it to read:
#! /home/yourusername/eggdrop/eggdrop
Substituting your username, of course, with your own login
name. You don't have to scroll down far to find the next thing
to change:
set username "lamest"
The chances are that your shell provider does run identd, the
output from which will appear on IRC instead of this variable,
however this is still sent to thr IRC server and could be a
dead giveaway that you are using Eggdrop should identd not work
for some reason. I usually set it to either the login name for
my shell or the nickname of the bot.
While the admin variable below might look rather an important
setting, I don't really think it is, as it should only be
viewable to people who know who you are anyway unless you are
on a botnet. Set it to what you want and forget about it. After
this are several variables to do with timezone and such that
aren't really all that crucial that you are safe to come back
to when you feel like fine-tuning your configuration.
I think I am safe to make the assumption that since you
downloaded an Eggdrop, you already have a channel in mind to
deploy it in, so the next important line can be set now:
logfile jpk #lamest "logs/lamest.log"
As it is, this will log joins/parts, public chat and
kicks/modes that Eggdrop sees happen in #lamest to
~/eggdrop/logs/lamest.log. Change the channel and filename so,
for example, if we wanted to log #xantium:
logfile jpk #xantium "logs/xantium.log"
Shortly after this will be the line to set where to store
information about known users. Just set it to yourbotnick.user:
set userfile "LamestBot.user"
You'll have to scroll quite a way to find the next line you
may or may not feel you need to alter:
#listen 3333 all
This allows users to login using a telnet connection and can
be useful, say, if DCC is being a bit troublesome for some of
your users, or if you don't have an IRC client and want to log
in. (I often used it to talk in my channel from my college, for
example) If you want to use it, you will need to uncomment
(remove the # sign from the beginning of the line) and very
crucially CHANGE THE PORT NUMBER. You can bet your butt to a
barndance that some other person will have used port 3333 on
your shell provider, so you will need to pick a different one.
It will need to be above 1024, and there is no guarantee that
someone else will not have taken that as well. The only way to
be sure is to try connecting after you've started your bot and
seeing if you get a connection (and if so, to the right bot).
Scrolling down quite a way, you come to what is one of the
most important lines:
#set owner "MrLame, MrsLame"
This line contains the usernames of people who wield ultimate
power over the bot, even more power by default than those who
are made owners using the partyline command. It needs to be
uncommented and set to your irc nickname. More than one
nickname can be stored on this line to make several owners, but
I would advise that if you must make other owners, make them
using the chattr command, as that way they can be removed
easily if things go wrong.
Not far below this is a die line. These were thankfully put
in by Eggdrop developers to stop people just compiling and
running Eggdrops without a second thought of how to actually
configure them. The following line needs to be either commented
out or deleted to allow Eggdrop to run:
die "Please make sure you edit your config file completely."
Scrolling far down once again you will eventually find the
line that says where Eggdrop will store information about
channels it goes in:
set chanfile "LamestBot.chan"
As with the assumption about which channel the bot will be
put in, I will assume that you must have a name in mind for
your bot by now. Set it to thatnickname.chan. Now we will
create a channel with minmal settings for your bot to go in
automatically when it connects to IRC, which we will call
#xantium (I have added handy comments to explain it all):
channel add #xantium {
chanmode "+nt" # We'll enforce no messages to the channel
from people who aren't in it, and only ops can change the topic.
idle-kick 0 # We don't want to go booting people just
because they don't talk..
stopnethack-mode 0 # Setting this to 1 can cause nice
havoc with services
revenge-mode 0 # This can cause havoc as it causes
eggdrop to take up grudges with people who are nasty to it
ban-time 180 # I always set this to three hours as it
pretty nicely covers an average online session for a person
exempt-time 60
invite-time 60
aop-delay 5:30
flood-chan 20:60 # 20 lines in a minute is ample. I find
the default 10 a tad too little.
flood-deop 3:10
flood-kick 3:10
flood-join 5:60
flood-ctcp 3:60
flood-nick 5:60
}
There. (if you can't tell, I based that from eggdrop.conf
but adapted it a bit) Now, at long last, we get to officially
name the bot:
set nick "Lamestbot"
set altnick "Llamab?t"
The first is the first choice of nickname the bot will
use. The second is used if the first choice is already in use,
by a ghost, say. The question mark is substituted for a random
number from 0-9. I called my Eggdrop Bungle. It's all go in
this part of the configuration, as right away we have another
line needing attention:
set realname "/msg LamestBot hello"
Ofcourse in its default form this is another hallmark of
an Eggdrop and needs changing now. Change it to anything you
wish. A little below this is the default server list:
set servers {
you.need.to.change.this:6667
another.example.com:7000:password
}
Pretty self-explanatory. Just change the lines inside the
curly braces with as many or as few IRC servers as you want
eggdrop to attempt to connect to. When it starts up, the bot
will try to connect to the first one, and then if that fails,
will cycle its way through the list until it comes to one that
works.
Notes are a pretty good feature of Eggdrop and allow users
to leave messages to other users who aren't online, or to send
an instant message to users who are online and connected to the
bot. This line will set where notes should be stored and should
be set in a similar fashion as for the chan and user files:
set notefile "LamestBot.notes"
After this is another die line that needs commenting out or
deleting. A little after this is a commented line to choose
what method of encryption you'd like to use on the passwords
stored in the user file. Since blowfish is pretty much the only
option available at the moment, you're pretty safe to just
uncomment this line; Eggdrop will not start unless you do:
#loadmodule blowfish
That pretty much concludes the minimum editing that needs
to be done to eggdrop.conf in order for it to work properly.
Save it, exit your text editor and type in the following:
./eggdrop -m eggdrop.conf
This will create a new userfile and start eggdrop. In
future if you want to start eggdrop just type:
./eggdrop
Now you quickly need to identify to your new bot. If you
have picked telnet, telnet to the bot on the port you picked
and enter NEW when asked for your name. If your bot is on IRC
as well as yourself, just type:
/msg yourbotnick hello
Into the IRC client. Now think of a password and type:
/msg yourbotnick yourpasswordhere
You will now be all set to DCC chat to your bot to log in.
That is all for this tutorial. You should now have a
working bot that is on IRC and in the channel of your choice.
You should be able to log into the partyline and the bot should
recognise you as its master. Next time I will discuss adding
your first users, the various flags available, and
banning bad guys.
<hr />
Written by shrapnelsack
Edited by jehnx
September 2, 2004
This article was originally published by CyberArmy.net in the CyberArmy Library.
|