Update to version 2.9.3a
[tropbot.git] / README.txt
1 -------------------------------------------------------------------------------
2   TropBot v2.9
3   Documentation written by Francois Fleuret
4   Contact <francois.fleuret@inria.fr> for comments & bug reports
5   Check http://www.eleves.ens.fr:8080/home/fleuret for latest version
6 -------------------------------------------------------------------------------
7
8 -------------------------------------------------------------------------------
9 I - INTRODUCTION --------------------------------------------------------------
10 -------------------------------------------------------------------------------
11
12 TropBot is an IRC bot for UNIX system. If you don't know what is IRC,
13 you should get some infos about it before trying to use TropBot.
14
15 Many IRC Bots exist, and most of them are just extensions of
16 "classical" bots like VladBot. TropBot was written from scratch, in
17 C++. My goal was at first to make a short and easy to extend bot, just
18 a small thing used in emergency cases on the #france channel on
19 EFNet. After few months, TropBot became a real bot, with many
20 features. He's still a fast and small bot, but he can defend a channel
21 by himself. The version 2.2.0 was so stable that I have run one on
22 #france for longer than one month with no reboot (when I finally
23 killed it it was just to run a newer version). The last version
24 (2.9.0) runs under Purify(tm) with no error.
25
26 -------------------------------------------------------------------------------
27 II - TROPBOT CAPABILITIES -----------------------------------------------------
28 -------------------------------------------------------------------------------
29
30 TropBot has all the main functions of an IRC bot. First, he has a list
31 of friends. A friend is a pattern which matches nick!user@host
32 stuff. Each of those pattern is associated with a level beetween 1 and
33 4. Anybody matching one of those pattern will be considered to have
34 the associated level.
35
36 * Level 1 (FRIEND) allows someone to use the simplest functions of the
37 bot (asking for the level of people, the shit-list, etc.)
38
39 * Level 2 (OP) is the op level. With this level, one will get the +o
40 automatically after a short delay, and will be allowed to use the
41 shit-list (see below).
42
43 * Level 3 (DEFENCE) is almost the same thing as level 2, except that
44 the person will gain the +o without delay. This level is reserved to
45 other bots of the channel. That way, during collide-attacks, the
46 TropBot will re-op them faster.
47
48 * Level 4 (MASTER) is the highest level and allows the person to use
49 all the functions (like adding friends, etc.)
50
51 The shit-list is a list of people who shouldn't be in the
52 channel. Each entry of this list is a pattern, associated with a delay
53 and a comment. Each time someone matching the pattern enters the
54 channel, he will be banned & kicked with the comment. This feature is
55 usefull against unpleasant people.
56
57 Since v2.0.0, the TropBot has a smart handling of ban-list. He has in
58 memory a copy of the ban list, so he is able to detect people entering
59 the channel using hack and kick them; and he is also able to ban or
60 unban only the required banid and avoid redudant +b/-b change mode.
61
62 TropBot has also a anti-flood procedure. Each person sending more than
63 4 lines in 2 s will be kicked. TropBot detects all kind of lines
64 (PRIVMSG, NOTICE, NICK and even JOIN). It's pretty hard to make a good
65 flood-detection algorithm. TropBot's one is far from perfection, but
66 works quite nicely. If you have smart ideas to improve it, please mail
67 me (I wrote a site-flood detection, but didn't include it ... I also
68 made a routine that counts the number of caractere lines on the
69 screen, but this kind of algorithm kick both bad and good guys :-))
70
71 Since v2.3.4 TropBot accepts passwords for users on unsafe sites
72 (i.e. sites where other people can fake their login). It's done in a
73 very primitive way, so I guess one should use them only in critical
74 situations. To use a command when you are a user with passwd, you just
75 have to add &passwd before all command. In any case, the bot won't be
76 able to recognize you after a split.
77
78 Since v2.5.5, TropBot accepts DCC CHAT connections; those are direct
79 socket connections, with no use of servers. This has few interests :
80 the connection is most of the time faster, you can keep the connection
81 even if splits occurs and if the bot and you are not on the same part
82 of the net, there are no flood detection and you won't loose the
83 connection even if the bots send you a lot of datas, etc. This kind of
84 connection is great for commands like "who" "help" "shitlist" etc.
85
86 Since v2.8.0, TropBot has new features to handle big channels. First,
87 it has in memory a list of 'restricted' sites. The bot will detect and
88 kick/ban any group of users who are on the same machine. The main idea
89 is to protect the channel from clone bots. The second important
90 feature is the 'cop-mode'. When this mode is switch ON, the bot will
91 detect any graphical effect (caps, reverse, mIrc colors, beeps,
92 art-chars, repeated chars, etc.), wil also ban any user who is kicked
93 3 times or more in less than 10 minutes, and will ban all site where
94 more than 3 people are banned.
95
96 The v2.9.0 is a more stable version, debugged using Purify(tm)
97
98 -------------------------------------------------------------------------------
99 II - HOW TO INSTALL TROPBOT ---------------------------------------------------
100 -------------------------------------------------------------------------------
101
102 I assume you've already downloaded & detared all the stuff, so you are
103 supposed to have some files like tblic.cc, tblic.h, tropbot.cc,
104 Makefile, etc. You just have to do a "make -k", and after a short
105 compilation, you should obtain a tropbot executable file. I developped
106 this program on both a Linux system, SunOS and SOLARIS (with gcc
107 2.7.*), I really don't know what can happen on other systems ... hope
108 it will work :-) If it doesn't, I fear I can't help you, I'm
109 definitively NOT a UNIX wizard :-P
110
111 -------------------------------------------------------------------------------
112 III - HOW TO RUN TROPBOT ------------------------------------------------------
113 -------------------------------------------------------------------------------
114
115 The main goal of a bot is to stay in a channel 24h/day to keep the +o
116 privileges so that he can give them to his friends when they enter the
117 channel. To do that, a bot must run on a station which is connected to
118 the net all the time.
119
120 To run the TropBot, you need a tropbot binary (obtained after
121 compilation). Then, just type "./tropbot" to run it. If you don't
122 indicate any parameter, you will run a tropbot with the nickname
123 "TropBot", connected to the server "sil.polytechnique.fr" on the port
124 6667, and this bot will go to the channel "#tropbot". So, the best way
125 to run a TropBot is the following :
126
127        nohup ./tropbot -n nickname -c "#channel" -h server
128
129 The 'nohup' UNIX command will make the bot go on running even after
130 you log out, and the parameters will set the nickname, the channel and
131 the server (you MUST use your local servers, AFTER you have got an
132 autorization from an IRCop ! Using a bot on a server without
133 autorization can make you be killed or even K-lined. Being K-lined
134 means that you'll never be able to use this server again).
135
136       NEVER PUT A BOT ON A SERVER WITH NO AUTHORIZATION FROM AN IRCOP
137
138 The options you can use in the command lines are the following :
139
140  -c <#channel>       sets the channel
141  -d <delay in s>     sets the reconnection delay
142  -h <hostname>       sets the server name
143  -j <jam nickname>   sets the pattern nick for collision
144  -l <user>           sets the user in the user@host stuff
145  -n <nickname>       sets the nickname
146  -o <friends file>   loads config file
147  -od <op delay>      set the delay before +o of level 2 people
148  -p <port number>    sets the server port
149  -?                  shows help
150
151 Most of those options are quite clear. The -d option allowed you to
152 modify the delay the bot will wait before he tries to reconnect after
153 he lost his connection. The -j option is used to give the bot a
154 "generic nickname". The form of such a nickname is a caractere string
155 with some '?' which will be replaced with random digits before
156 use. That way the bot is able to generate random nicks if the nick you
157 gave him is already used, or after a nick collision (by default the
158 jam nick is "TB-????"). The -o option is used to load a configuration
159 file (see below).
160
161 -------------------------------------------------------------------------------
162 IV - TROPBOT CONFIGURATION FILE -----------------------------------------------
163 -------------------------------------------------------------------------------
164
165 If you use the '-o' option, or the 'load' command on IRC, the TropBot
166 will load a configuration file (.tropbotrc by default, but can be
167 changed by both the '-o' option and the 'load'/'save' commands).
168
169 The configuration file contains two kinds of lines. The "FRIEND"
170 lines, who indicate a new friend, and the "SHIT" lines, who indicate
171 who is supposed to be shit-listed.
172
173 If you want this bot to op all people from united kingdom, just put in
174 the configuration file the following line :
175
176 FRIEND 2 *!*@*.uk
177
178 This way, the bot will give a level 2 to all people whose
179 nick!user@host matches *!*@*.uk, and a level 2 is an op level.
180
181           YOU MUST BE IN THIS LIST TO MAKE THE BOT RECOGNIZE YOU
182
183 If you want the bot to shit-list all people from Ecole Polytechnique
184 in France for 2 days (172800 s), with the comment "I don't like people
185 with strange hats", just add :
186
187 SHIT *!*@*.polytechnique.fr 172800 I don't like people with strange hats
188
189 You can add a password in the configuration file just as a third
190 parameter. For example
191
192 FRIEND 2 *!*@*.fr trululu
193
194 will make all people from France able to execute functions with a
195 level 2 if they use the password trululu.
196
197 You can also specify a list of restricted sites. For example, if you
198 want to avoid to have more than one personne on a same adress
199 containing "ppp", just put
200
201 RESTRICTED *!*@*ppp*
202
203 -------------------------------------------------------------------------------
204 V - TROPBOT FUNCTIONS ---------------------------------------------------------
205 -------------------------------------------------------------------------------
206
207 The functions you can use on a TropBot depend with your level in his
208 list. For functions that accept both <nick> or <pattern> parameter, a
209 pattern must contain at least one '@' and one '!' or the bot will
210 consider it as a nickname.
211
212 LEVEL 1 FUNCTIONS :
213
214 "www" prints the URL of my home page, where you can find the latest
215 version of TropBot
216
217 "level [<nick>]" prints the level of the given person (or your own
218 level if you don't give any parameter).
219
220 "shitlist [<nick>!<pattern>]" (alias "sl") prints the shit-list, or
221 the shits matched by a given pattern, or the shits that match a nick.
222
223 LEVEL 2 & 3 FUNCTIONS :
224
225 "alert" (alias "a") will put the channel in +m, shit the site who
226 flooded the more during the last seconds, will kick all the nick on
227 this site, and then will put the channel -m. This command is VERY
228 usefull against clone bots.
229
230 "antifloodoff <duration>" (alias "ao") will make suppress the
231 anti-flood system for the given duration. This feature is interesting
232 when the bot lagged because of network troubles.
233
234 "cop" switch the cop-mode on/off
235
236 "ctcpreply" (alias "cr") switch the ctcp replies
237
238 "anticlones" (alias "ac") switch the "restricted-sites" stuff
239
240 "deban { list of patterns }" (alias "db") remove from the ban-list all
241 the entries who match one of the pattern
242
243 "filterkick <nick>!<pattern> [<comment>]" (alias "fk") will kick all
244 the people matching the pattern, or on the same site as the given nick
245
246 "home" sends back to the home channel
247
248 "join <#channel>" makes the bot leave the current channel and join
249 #channel
250
251 "op [{ nicks list }]" makes the bot give you the +o if no list is
252 given, and give the +o to the given nicks if there is a list
253
254 "pruneban <number>" (alias "pb") check the ban-list and keeps only the
255 <number> first bans
256
257 "punshit { <pattern> list }" (alias "pus") removes all the pattern
258 that matches <pattern> from the shit-list (so "punshit *" will clear
259 the shit-list).
260
261 "shit <nick>!<pattern> [<duration> [<comment>]]" (alias "s") adds a
262 pattern in the shit-list for a given duration. Each time a person
263 matching this pattern enters the channel, he will be banned & kicked
264 (with the given comment). If the parameter is a nickname, the bot will
265 compute a nick!user@host pattern by itself (matching all the person
266 with the same login, on the same site). The duration is the string
267 like #d#h#m#s where the # are integer numbers. For example, 2d4h means
268 2 days and 4 hours.
269
270 "shithost <nick> <duration> <comment>" (alias "sh") adds a pattern
271 that matches all the person from the <nick>'s host. Usefull for
272 providers'people who can easily change their login in the login@host
273 but have to hangup to change the modem/machine name.
274
275 "shitsite <nick> <duration> <comment>" (alias "ss") adds a pattern
276 that matches all the person from the <nick>'s site.
277
278 "synch" makes the bot give the +o to all the people in the channel
279 with a level greater than 2 (usefull when you want to re-synchronize a
280 channel after hacks/splits, etc.)
281
282 "unshit { <nick>!<pattern> list }" (alias "us") removes patterns from
283 the shit-list, or all the pattern who match a given user.
284
285 LEVEL 4 FUNCTIONS :
286
287 "save [<file>]" saves the configuration file
288
289 "load [<file>]" loads the configuration file
290
291 "reset" kills the connection, randoms the nickname, reconnects, and
292 rejoins.
293
294 "friend <pattern> <level> [<passwd>]" adds someone in the friend list
295 with the given level and passwd if specified
296
297 "clone [<nick>]" starts a new session with the given nick or a random
298 one
299
300 "die" kills the bot
301
302 "server <hostname> [<port>]" set the server name and the port number
303 (6667 by default)
304
305 "controlchar <char>" set the control character
306
307 "opdelay <delay in s>" set the delay before +o when level 2 enter the
308 channel
309
310 "debandelay <delay in s>" set the delay before -b in case of +b by
311 split
312
313 USING PASSWORDS :
314
315 If you have the password abcdef, to use a command with your level, you
316 just have to add &abcdef before any command. For example,
317
318 /msg TropBot &abcdef op
319
320 will make the bot op you.
321
322 USING DCCHAT :
323
324 With a DCC CHAT connection to tropbot, you can send all the commands
325 you use to send with /msg or with the control character in public. The
326 bot will send you back the answers throught the DCC CHAT too.
327
328 You gain two new commands, which can be used only in DCC CHAT :
329
330 "users" (alias "u") that gives you the nick!user@host of all the
331 people connected to the bot with DCC CHAT at the same time.
332
333 "talk <msg>" (alias "t") that send a message to all the people
334 connected with DCC CHAT.
335
336 -------------------------------------------------------------------------------
337 VI - CONCLUSION/BUGS ----------------------------------------------------------
338 -------------------------------------------------------------------------------
339
340 A bot is a complex program. This one, even if it's not very long has
341 to deal with many buffers and strings operations. Such kind of program
342 can't be 100% safe. I hope current version is stable, but I fear some
343 buggs are still creeping somewhere. The last version was checked with
344 Purify and is supposed to be kinda stable.
345
346 -------------------------------------------------------------------------------
347 - AUTHOR ----------------------------------------------------------------------
348 -------------------------------------------------------------------------------
349
350 Francois Fleuret
351
352 E-mail :  <francois.fleuret@inria.fr>.
353 IRCNICK : THX-1138 (EFNet, eureopean part, #france channel)
354
355 I really DON'T appreciate questions about compilation, and I HATE
356 questions whose answers are in this file. I appreciate suggestions and
357 bug reports :P
358
359 -------------------------------------------------------------------------------
360 - ACKNOWLEDGEMENT -------------------------------------------------------------
361 -------------------------------------------------------------------------------
362
363 Linux, GCC, Emacs and XFree86 people ... I love you men ! :-)
364
365 Jim Frost <jimf@world.std.com> for http://world.std.com/~jimf/sockets.html
366
367 -------------------------------------------------------------------------------