1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2//EN">
4 <title>Bobot++ - an IRC bot
</title>
8 <h1>Bobot++ - an IRC bot
</h1>
10 <p>First, if you don't know what is a bot or if you don't know what
11 is IRC, you're at the wrong place, sorry :-)
</p>
15 <p>The
<em>bobot++
</em> is an IRC bot written in C++. This is the
16 evolution of the
<em><a
17 href=
"http://www.via.ecp.fr/~hugo/bobot.html">bobot
</a></em>
18 that I wrote in C with
<a
19 href=
"http://www.via.ecp.fr/~hugo/">Bartman
</a>.
</p>
21 <p>The
<em>bobot
</em> was a powerful bot, but it was limited to an
22 unique channel, and an unique bot per process. The
23 <em>bobot++
</em> is designed to support as many channels as you
24 want (in the limit of
20 channels, but this limit is set by the
25 servers). Moreover, it will support multithreading easily (all
26 the objects are thread-safe).
</p>
28 <p>Here is a non comprehensive list of the
<em>bobot++
</em>'s
32 <li>No backdoor: there is no backdoors in the
33 <em>bobot++
</em>. You are free to believe me or not, but
34 unlike many other bots, this one has no backdoor. Note that
35 there is an hidden command, but this command is not designed to
36 take control of the bot,
</li>
37 <li>Multichannel: A
<em>bobot++
</em> can join as many channels
39 <li>Flood control: It will ignore people flooding it,
</li>
40 <li>Output rate control and priority handling: The
41 <em>bobot++
</em> will send its commands to the server at the
42 highest possible rate (ie as fast as possible without making
43 an ``excess flood''). The most important commands (MODE's,
44 etc.) are sent first,
</li>
45 <li>Time dependant commands: you can ban people for a fixed
46 amount of time. This is really useful in order not to fill the
47 banlist, [NOT YET FINISHED]
</li>
48 <li>Complex online help system: each user can have the list of
49 the commands he can execute. Each command has its description
50 in the help system,
</li>
51 <li>Four user levels (user, trusted user, friend and master),
52 three different protections (no kick, no ban and no deop) and
53 possible auto-op. Note that trusted user is created to permit
54 the use of wildcards on dangerous commands such as
55 <tt>kick
</tt>, or
<tt>ban
</tt>,
</li>
56 <li>Support for combined join and channel op of
2.9 servers on
57 IRCNet (this feature will be suppressed from the servers, but
58 it may remain useful...),
</li>
59 <li>Logging of commands and events,
</li>
60 <li>``Intelligent'' ban and deban,
</li>
61 <li>Password protection on accounts, expiration dates on user
63 <li>Anti-spoof: one can not acquire operator priviledges spoofing
67 <h2>Downloading the bobot++
</h2>
69 <p>You can get the latest version of the bobot++ from this site
70 <em>only
</em>. Here is the current version:
</p>
72 <p><a href=
"bobot++.1.0.tgz">Download the
1.0 version
</a></p>
73 <p><a href=
"bobot++.1.2.tgz">Download the
1.2 version
</a></p>
74 <p><a href=
"bobot++.1.4.tgz">Download the
1.4 version
</a></p>
76 <p>Note that revision numbers
1.1 and
1.3 were development
81 <p>Changes since version
1.2:
</p>
84 <li>Fixed a memory leak in the
<tt>UserList::load()
</tt>
86 <li>Added antispoofing code (the bot pings before
88 <li>Added password protection of user accounts.
</li>
89 <li>Added expiration on user accounts
</li>
92 <h2>Compiling the bobot++
</h2>
94 <p>Compiling the
<em>bobot++
</em> is rather simple. You will only
95 need an Un*x-like system and a C++ compiler supporting the
96 Standard Template Library (STL).
</p>
98 <p>The
<em>bobot++
</em> compiles fine under the following
99 operating systems:
</p>
102 <li>Linux
2.0.x and g++ version
2.7.2.3,
</li>
103 <li>HP-UX version
9.x and
10.x and g++ version
2.7.2,
</li>
104 <li>SunOS
4.1 and g++.
</li>
107 <p>It should compile easily on many other POSIX compliant
110 <p>First, you will have to edit the
<tt>Makefile
</tt> if your C++
111 compiler is not g++. Change the line:
</p>
115 <p>With some Un*ces, you will have to link the program with some
116 extra libraries. Change the line:
</p>
120 <p>For example, you will need this line with Solaris:
</p>
122 <pre>LIBS=-lsocket -lnsl
</pre>
124 <p>Then you should be ready to compile the program. Type
125 <tt>make
</tt> at the prompt. If you get an error, please try and
126 fix it before emailing me...
</p>
128 <p>Now, you should have a executable file named
<tt>bobot++
</tt>
129 in the directory. This is it! We will have to configure the bot,
132 <h2>Configuring the bobot++
</h2>
134 <h4>General configuration
</h4>
136 <p>Edit the example file
<tt>bot.conf
</tt> to suit your needs. The
137 comments in the file should be self explanatory...
</p>
139 <p>Here is an example:
</p>
146 server = irc.eurecom.fr
149 server = salambo.enserb.u-bordeaux.fr
151 channel = #test2 key
</pre>
153 <p>The bot will be named
<em>Bobot
</em>, more precisely
154 <em>Bobot!bot@your.machine.com
</em>. Its command char will be
155 '!'. It will find its user list in the file
<tt>bot.users
</tt>,
156 and it will have three servers in its server list. The log will
157 be written to the file
<tt>log
</tt>. It will join two channels:
158 #test1 and #test2 with
<tt>key
</tt> as the channel key
159 (remember, the +k mode for channels...).
</p>
161 <p>If you omit one of these configuration options, a default value
164 <p>Comments begin with ``#'' (at the first column only), and here
165 is the meaning of all configuration options. Note that there are
171 <th>Default value
</th>
175 <td>NICK=
<nickname
><br>
176 NICKNAME=
<nickname
></td>
178 <td>This is the nickname of the bot
</td>
181 <td>USERNAME=
<username
></td>
183 <td>The username of the bot, if there is no
<tt>identd
</tt> daemon
</td>
186 <td>IRCNAME=
<ircname
><br>
187 REALNAME=
<ircname
></td>
188 <td>I'm a bobot++!
</td>
189 <td>The ircname of the bot
</td>
192 <td>CMDCHAR=
<command
char
><br>
193 COMMAND=
<command char
></td>
195 <td>The command char of the bot
</td>
198 <td>USERLIST=
<file
name
></td>
200 <td>The userlist file
</td>
203 <td>LOGFILE=
<file
name
></td>
205 <td>The log file (may be set to
<tt>/dev/null
</tt> if you do
206 not want to log...
</td>
209 <td>SERVER=
<server
name
> [
<port
> [
<password
>]]
</td>
211 <td>The server the bot will try to connect to, on the port
212 specified, and optionally with a password. You can put any
213 number of SERVER lines
</td>
216 <td>CHANNEL=
<channel
name
> [
<channel
key
>]
</td>
218 <td>The channel the bot will join on startup. You can put any
219 number of CHANNEL lines
</td>
223 <h4>You are the master of the bot
</h4>
225 <p>Yes! But the bot does not know who you are yet. Edit the file
226 <tt>bot.users
</tt> (or whatever your userlist file is) and put
227 in a line like this one:
</p>
229 <pre><your adress
>:#*:
4:
0:
0:-
1:*NONE*
</pre>
231 <p>where
<your adress
> is composed with your IRC address. It
232 should be something like that:
</p>
234 <pre>*!*username@*.domain.com
</pre>
236 <p>if you connect on IRC from
<tt>machine.domaine.com
</tt>, with
237 <tt>username
</tt> as login.
</p>
239 <p>For me, this is
<tt>*!*bernard@*.cma.fr
</tt>.
</p>
241 <p>Now, you can run the bot:
</p>
245 <p>Note that there are certain command line options that you can
248 <pre>./bobot++ -h
</pre>
250 <h2>Using the
<em>bobot++
</em></h2>
252 <h4>Adding people on the userlist
</h4>
254 <p>Of course, you will want to add people on the userlist, as well
255 as other bots. The
<tt>adduser
</tt> command is for you, then!
258 <pre>!adduser
<nick
>|
<mask
> <channel
mask
> <level
> <prot
> <aop
></pre>
260 <p>Note that ``!'' is the command char of the bot, and it may be
261 different according to the configuration you chose.
<br>
262 The meaning of the different options is rather simple:
</p>
266 <td align=
"center"><nick
></td>
267 <td>The nickname of the person to add. The bot will generate a
268 mask matching this person. If the mask is not accurate
269 enough, you should use...
</td>
272 <td align=
"center"><mask
></td>
273 <td>...to select the mask you really want. I remind you that
274 the mask is a regular expression designed to match
275 <em>nick!username@hostname
</em></td>
278 <td align=
"center"><channel
mask>
</td>
279 <td>This is a mask representing channels where this account is
280 available. You can put ``*'' for every channels, ``#*'' for
281 every non-local channels, etc.
</td>
284 <td align=
"center"><level
></td>
285 <td><table width=
"100%" border=
"1">
288 <td>No level - Impossible to execute commands. This is
289 for bots, for example.
</td>
293 <td>User level - Will be able to execute many of the
294 commands, but will not be able to use masks on kicks
299 <td>Trusted user level - Exactly the same commands as
300 the ``User'' level, except that the user will be able
301 to use masks on bans and kicks.
</td>
305 <td>Friend level - Can do everything on the bot, except
306 stopping it. Be careful of who your friends are :-)
</td>
310 <td>Master level - Can do everything on the bot.
</td>
316 <td align=
"center"><protection
></td>
317 <td><table width=
"100%" border=
"1">
320 <td>No protection - for nearly everybody.
</td>
324 <td>No ban - it will be impossible to ban the user,
325 directly or indirectly.
</td>
329 <td>No kick - if the user is kicked, there will be a
334 <td>No deop - The bot will insure that the user can not
335 be deopped. Useful for bots.
</td>
341 <td align=
"center"><aop
></td>
342 <td><table width=
"100%" border=
"1">
345 <td>No auto-op on join.
</td>
349 <td>Auto-op on join. For bots, and optionnaly other
350 users. It depends on the policy of your channel.
</td>
357 <p>Here are two examples:
</p>
359 <pre>!adduser eb #*
2 1 0
360 !adduser *!*test@
138.195.*.* #test
0 3 1
363 <p>We first add ``eb'' (me!) to the userlist, for every non-local
364 channel, at level
2 (trusted user), with no-ban protection and
367 <p>Then we add every user matching ``*!*test@
138.195.*.*'' to the
368 userlist for channel ``#test'', with level
0 (no level),
369 protection
3 (no-deop) and auto-op on join. It is probably
372 <p>Finally, we save the changes to the userlist. Note that this is
373 not mandatory, since the userlist is saved when the bot
374 <tt>!die
</tt>s, but if the bot is killed or if there is a bug
375 (yes, there
<em>are
</em> bugs :-), all your changes would not
378 <h4>Issuing a command (like for example a kick)
</h4>
380 <p>The
<em>bobot++
</em> supports two types of commands: those who
381 affect a channel (kick, ban, topic...) and those who don't.
</p>
383 <p>For commands which need a channel name, the channel name can be
384 optionnaly put after the name of the command. This is mandatory
385 if the command is made directly to the bot, with a private
388 <p>Suppose the bot is on two channels,
<tt>#test1
</tt> and
389 <tt>#test2
</tt>. You are on channel
<tt>#test1
</tt>. Here is the
390 behavior of the bot:
</p>
394 <td><tt>#test1
> !kick foo reason
</tt></td>
395 <td>This will kick
<em>foo
</em> out of channel
396 <tt>#test1
</tt>.
</td>
399 <td><tt>#test1
> !kick #test1 foo reason
</tt></td>
400 <td>This will also kick
<em>foo
</em> out of channel
401 <tt>#test1
</tt>.
</td>
404 <td><tt>#test1
> !kick #test2 foo reason
</tt></td>
405 <td>This will kick
<em>foo
</em> out of channel
406 <tt>#test2
</tt>.
</td>
409 <td><tt>-
> *bot* !kick #test1 foo reason
</tt></td>
410 <td>This will kick
<em>foo
</em> out of channel
411 <tt>#test1
</tt>.
</td>
414 <td><tt>-
> *bot* !kick #test2 foo reason
</tt></td>
415 <td>This will kick
<em>foo
</em> out of channel
416 <tt>#test2
</tt>.
</td>
419 <td><tt>-
> *bot* !kick foo reason
</tt></td>
420 <td>This will
<em>not
</em> work. The bot has no way to know to
421 which channel this command applies to.
425 <p>Is this clear enough? This is rather compelling, I know, but I
426 have not found a better way to do this.
</p>
428 <h4>Spying the bot
</h4>
430 <p>I hate people that kick others
<em>via
</em> the bots, and using
431 a private message to the bot. There is no good way to really
432 know what others do. Furthermore, some private messages can be
433 sent to the bot and this can be funny. That is why I made a
434 command to spy bot's private messages.
</p>
436 <p>There is a ``spylist'' on the bot that every user can read with
437 the command
<tt>!spylist
</tt>. To be added to the spylist, you
438 should use the
<tt>!spymessage
</tt> command. To be removed, this
439 is the
<tt>!rspymessage
</tt> command.
</p>
441 <p>Note that password control on the bot is not yet implemented,
442 so there is no danger of knowing the password of other people. I
443 will improve the spylist later in order not to be able to see
444 others' password.
</p>
446 <h4>Intelligent ban and deban
</h4>
448 <p>Note what happens if you try:
</p>
459 <p>Fine, isn't it? If we didn't do that, the server would not
460 accept the last ban. Try also
<tt>!deban *
</tt> (use it when the
461 banlist is full!).
</p>
463 <h4>Getting help on other commands
</h4>
465 <p>The
<tt>!help
</tt> command without arguments will give you all
466 the commands you can issue. For a master, this will give
467 you (this may change in the future):
</p>
469 <pre>-Bobot- Available topics for you are:
470 -Bobot- ACTION ADDUSER ADDSERVER BAN CHANNELS CYCLE DEBAN DELSERVER DEOP
471 DIE HELP INVITE JOIN KICK KICKBAN LOCK NAMES NEXTSERVER NICK
472 NSLOOKUP OP PART RECONNECT RSPYMESSAGE SAVE SAY SERVER SERVERLIST
473 SPYLIST SPYMESSAGE TOPIC UNLOCK USERLIST WHO WHOIS
474 -Bobot- Use HELP
<command
> for help about
<command
></pre>
476 <p>If you want help about the
<tt>!kick
</tt> command, use
477 <tt>!help kick
</tt>:
</p>
479 <pre>-Bobot- Help for KICK:
480 -Bobot- KICK [
<channel
>]
<mask
>|
<nick
> [
<reason
>]
481 -Bobot- Kicks
<mask
> or
<nick
> out of
<channel
>, because of
<reason
>.
482 -Bobot- You need to be a trusted user to use a
<mask
>.
483 -Bobot- End of help.
</pre>
485 <p>Then you have the tools to explore the
<em>bobot++
</em> in
486 details. Good luck!
</p>
488 <h2>Bugs, questions, etc.
</h2>
490 <p>If you find a bug or a strange behaviour of the bot, please try
491 to reproduce it, and then send me a mail describing the problem
492 <em>in details
</em>.
</p>
494 <p>If you have suggestions about new features, please tell
495 me. If you added features yourself, send me your patch!
</p>
497 <p>Note that I will not answer to configuration or compilation
500 <h2>Plans for the future
</h2>
502 <p>Here is what I plan to add to the
<em>bobot++
</em>:
</p>
505 <li>Scripting support with Guile, the GNU Scheme
507 <li>Bot control via telnet, or a java applet;
</li>
508 <li>DCC Send and Get (we will be able to use the bot as a
510 <li>Shitlist, like on the
<em>bobot
</em>;
</li>
511 <li>Dynamic settings;
</li>
512 <li>Other ideas?
</li>
515 <h2>Why use Guile?
</h2>
517 <p>Guile is the GNU Scheme interpreter. In a future release of the
518 <em>bobot++
</em>, I plan to add scripting support using this
521 <p>So, why did I chose Guile, instead of Tcl or Python?
</p>
523 <p>One of the main features of Guile is that it will be easy to
524 extend the interpreter in order to translate Python, Tcl or
525 Perl to Scheme code. So, you will have the choice of the
526 language! If you prefer Python instead of Perl or Tcl, use
527 Python. If you prefer CTax (a language similar to C), all right!
528 I hope that religious wars opposing those languages will soon be
531 <p>Moreover, as Guile is GNU code, it is
<em>really
</em> a free
532 software, and will keep this status.
</p>
534 <p>Finally, it is an excellent product, so why shouldn't we use
539 <address><a href=
"mailto:bernard@isia.cma.fr">Etienne
540 BERNARD
</a></address>
542 <!-- Created: Fri Mar 6 18:45:32 CET 1998 -->
544 Last modified: Sat Mar
21 13:
32:
54 CET
1998