f32b98c534d504dd04343872c208231958f8e2c3
[clinton/bobotpp.git] / bobot++.texinfo
1 \input texinfo @c -*- texinfo -*-
2 @c %**start of header
3 @setfilename bobot++.info
4 @settitle Bobot++: A Schemeable IRC Bot
5 @setchapternewpage on
6 @c %**end of header
7
8 @ifinfo
9 This file documents Bobot++ by Clinton Ebadi and Etienne Bernard
10 (original author, no longer works on program).
11
12 Copyright 2002 Clinton Ebadi
13
14 Permission is granted to copy, distribute and/or modify this document
15 under the terms of the GNU Free Documentation License, Version 1.1 or
16 any later version published by the Free Software Foundation; with no
17 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
18 Texts.
19
20 @end ifinfo
21
22 @titlepage
23 @title Bobot++: A Schemeable IRC Bot
24 @author Clinton Ebadi
25
26 @page
27 @vskip Opt plus 1filll
28 Copyright @copyright{} 2002 Clinton Ebadi
29
30 Permission is granted to copy, distribute and/or modify this document
31 under the terms of the GNU Free Documentation License, Version 1.1 or
32 any later version published by the Free Software Foundation; with no
33 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
34 Texts.
35
36 @end titlepage
37
38 @node Top, Introduction, (dir), (dir)
39 @comment node-name, next, previous, up
40
41 @ifinfo
42 This document describes Bobot++ by Clinton Ebadi and Etienne Bernard
43 (original author, no longer works on program).
44
45 This document applies to version 2.1.0 of the program named
46 Bobot++
47
48 Copyright 2002 Clinton Ebadi
49
50 Permission is granted to copy, distribute and/or modify this document
51 under the terms of the GNU Free Documentation License, Version 1.1 or
52 any later version published by the Free Software Foundation; with no
53 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
54 Texts.
55 @end ifinfo
56
57 @menu
58 * Introduction::
59 * Configuration::
60 * Scripting::
61 * Concept Index::
62 * Function Index::
63 * Variable Index::
64 @end menu
65
66 @node Introduction, Configuration, Top, Top
67 @chapter Introduction
68
69 This manual feels abused and neglected because it has almost no
70 content.
71
72 @node Configuration, Scripting, Introduction, Top
73 @chapter Configuration
74
75 Bobot++ is easy to configure. The configuration file format may be
76 changing in the 2.1 series, so it is not documented for now. See the
77 @file{examples} directory for an example configuration.
78
79 @menu
80 * Configuration File Syntax::
81 * Configure File Placement::
82 @end menu
83
84 @node Configuration File Syntax, Configure File Placement, Configuration, Configuration
85 @section Configuration File Syntax
86
87 Not here yet.
88
89 @node Configure File Placement, , Configuration File Syntax, Configuration
90 @section Configuration File Placement
91
92 Bobot++ will look in @file{/etc/bobotpp/default/} for its default
93 config if none is specified on the command line. Put the configuration
94 files you want to be loaded by default in this directory. If you are
95 not root or you want to have your own personal configration, put it in
96 @file{~/.bobotpp/config/default/}.
97
98 @node Scripting, Concept Index, Configuration, Top
99 @chapter Scripting
100
101 Bobot++'s most powerful feature is its scripting system. You write
102 scripts using Guile Scheme. This manual does not cover how to use
103 Guile or how to learn Scheme. @xref{Top, , Guile Reference Manual,
104 guile, The Guile Reference Manual}, for the Guile reference manual and
105 @url{http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html} for
106 a good tutorial on Scheme.
107
108 Note that in previous versions the scripting commands where in the
109 form @code{bot-@var{function}}. They are now in the form
110 @code{bot:@var{function}}. The old names are still available, but are
111 deprecated and will be removed in Bobot++ 2.4. The command
112 @command{perl -pi -e ``s/bot-/bot:/g'' @var{your-files}} should be enough to
113 convert your code to use the new functions.
114
115 @menu
116 * Adding New Commands::
117 * Hooks::
118 @end menu
119
120 @node Adding New Commands, Hooks, Scripting, Scripting
121 @section Adding New Commands
122
123 Not here yet.
124
125 @node Hooks, , Adding New Commands, Scripting
126 @section Hooks
127
128 Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII
129 hooks and tiny fugue (a MUD bot) hooks. The basic idea of a hook if
130 that you match a text against regular expression and call a function
131 if text in a message matches that regex. The different types of hooks
132 provided by Bobot++ correspond to the different classes of messages
133 that Bobot++ can recieve. A Hook also has several properties,
134 including its priority and whether or not it is a fallthrough
135 hook. Higher priority hooks are executed before lower priority hooks
136 and fallthrough hooks are executed before non-fallthrough hooks. A
137 fallthrough hook can match and processing of hooks will continue; as
138 soon as the first non-fallthrough hooks matches processing of hooks
139 stops.
140
141 @menu
142 * Creating a Hook::
143 * Hook Types::
144 @end menu
145
146 @node Creating a Hook, Hook Types, Hooks, Hooks
147 @subsection Creating a Hook
148
149 To add a new hook you use the function
150 @code{bot:addhook}. @code{bot:addhook} is prototyped as
151 @code{(bot:addhook type regex function pri fall)}. @code{type}
152 specifies the type of hook (the types of hooks are listed in @ref{Hook
153 Types}). @code{regex} is a standard regular expression. If
154 @code{regex} is matched, @code{function} will be
155 called. @code{function} will take a different number of args depending
156 on the hook type. @code{pri} specifies the priority of the
157 hook--higher priority hooks are executed first. This argument is
158 optional and defaults to @code{0}. @code{fall} is @code{#t} if the
159 hook is a fallthrough hook and @code{#f} is the hook is not a
160 fallthrough hook. This arg is also optional and default to @code{#t}.
161
162 @node Hook Types, , Creating a Hook, Hooks
163 @subsection Hook Types
164
165 Here is a list of the various hooks are notes on each one. The general
166 format of a hook is:
167
168 @itemize @bullet
169 @item
170 @code{hooks/name} (this is the Scheme variable name of the hook)
171 @itemize @minus
172 @item
173 Description of the hook
174 @item
175 # of args
176 @itemize @minus
177 @item
178 @code{arg1}: desc
179 @item
180 @code{arg2}: desc
181 @item
182 ...
183 @item
184 @code{argN}: desc
185 @end itemize
186 @end itemize
187 @end itemize
188
189 That said, here is the list of available hooks:
190
191 @itemize @bullet
192 @item
193 @code{hooks/action}
194 @itemize @minus
195 @item
196 Description of the hook
197 @item
198 # of args
199 @itemize @minus
200 @item
201 @code{arg1}: desc
202 @end itemize
203 @end itemize
204
205 @end itemize
206 @itemize @bullet
207 @item
208 @code{hooks/nickname}
209 @itemize @minus
210 @item
211 Description of the hook
212 @item
213 # of args
214 @itemize @minus
215 @item
216 @code{arg1}: desc
217 @end itemize
218 @end itemize
219
220 @end itemize
221 @itemize @bullet
222 @item
223 @code{hooks/signoff}
224 @itemize @minus
225 @item
226 Description of the hook
227 @item
228 # of args
229 @itemize @minus
230 @item
231 @code{arg1}: desc
232 @end itemize
233 @end itemize
234
235 @end itemize
236 @itemize @bullet
237 @item
238 @code{hooks/ctcp}
239 @itemize @minus
240 @item
241 Description of the hook
242 @item
243 # of args
244 @itemize @minus
245 @item
246 @code{arg1}: desc
247 @end itemize
248 @end itemize
249
250 @end itemize
251 @itemize @bullet
252 @item
253 @code{hooks/ctcp-reply}
254 @itemize @minus
255 @item
256 Description of the hook
257 @item
258 # of args
259 @itemize @minus
260 @item
261 @code{arg1}: desc
262 @end itemize
263 @end itemize
264
265 @end itemize
266 @itemize @bullet
267 @item
268 @code{hooks/disconnect}
269 @itemize @minus
270 @item
271 Description of the hook
272 @item
273 # of args
274 @itemize @minus
275 @item
276 @code{arg1}: desc
277 @end itemize
278 @end itemize
279
280 @end itemize
281 @itemize @bullet
282 @item
283 @code{hooks/flood}
284 @itemize @minus
285 @item
286 Description of the hook
287 @item
288 # of args
289 @itemize @minus
290 @item
291 @code{arg1}: desc
292 @end itemize
293 @end itemize
294
295 @end itemize
296 @itemize @bullet
297 @item
298 @code{hooks/invite}
299 @itemize @minus
300 @item
301 Description of the hook
302 @item
303 # of args
304 @itemize @minus
305 @item
306 @code{arg1}: desc
307 @end itemize
308 @end itemize
309
310 @end itemize
311 @itemize @bullet
312 @item
313 @code{hooks/join}
314 @itemize @minus
315 @item
316 Description of the hook
317 @item
318 # of args
319 @itemize @minus
320 @item
321 @code{arg1}: desc
322 @end itemize
323 @end itemize
324
325 @end itemize
326 @itemize @bullet
327 @item
328 @code{hooks/kick}
329 @itemize @minus
330 @item
331 Description of the hook
332 @item
333 # of args
334 @itemize @minus
335 @item
336 @code{arg1}: desc
337 @end itemize
338 @end itemize
339
340 @end itemize
341 @itemize @bullet
342 @item
343 @code{hooks/part}
344 @itemize @minus
345 @item
346 Description of the hook
347 @item
348 # of args
349 @itemize @minus
350 @item
351 @code{arg1}: desc
352 @end itemize
353 @end itemize
354
355 @end itemize
356 @itemize @bullet
357 @item
358 @code{hooks/mode}
359 @itemize @minus
360 @item
361 Description of the hook
362 @item
363 # of args
364 @itemize @minus
365 @item
366 @code{arg1}: desc
367 @end itemize
368 @end itemize
369
370 @end itemize
371 @itemize @bullet
372 @item
373 @code{hooks/message}
374 @itemize @minus
375 @item
376 Description of the hook
377 @item
378 # of args
379 @itemize @minus
380 @item
381 @code{arg1}: desc
382 @end itemize
383 @end itemize
384
385 @end itemize
386 @itemize @bullet
387 @item
388 @code{hooks/notice}
389 @itemize @minus
390 @item
391 Description of the hook
392 @item
393 # of args
394 @itemize @minus
395 @item
396 @code{arg1}: desc
397 @end itemize
398 @end itemize
399
400 @end itemize
401 @itemize @bullet
402 @item
403 @code{hooks/public}
404 @itemize @minus
405 @item
406 Description of the hook
407 @item
408 # of args
409 @itemize @minus
410 @item
411 @code{arg1}: desc
412 @end itemize
413 @end itemize
414
415 @end itemize
416 @itemize @bullet
417 @item
418 @code{hooks/public-notice}
419 @itemize @minus
420 @item
421 Description of the hook
422 @item
423 # of args
424 @itemize @minus
425 @item
426 @code{arg1}: desc
427 @end itemize
428 @end itemize
429
430 @end itemize
431 @itemize @bullet
432 @item
433 @code{hooks/raw}
434 @itemize @minus
435 @item
436 Description of the hook
437 @item
438 # of args
439 @itemize @minus
440 @item
441 @code{arg1}: desc
442 @end itemize
443 @end itemize
444
445 @end itemize
446 @itemize @bullet
447 @item
448 @code{hooks/timer}
449 @itemize @minus
450 @item
451 Description of the hook
452 @item
453 # of args
454 @itemize @minus
455 @item
456 @code{arg1}: desc
457 @end itemize
458 @end itemize
459
460 @end itemize
461 @itemize @bullet
462 @item
463 @code{hooks/topic}
464 @itemize @minus
465 @item
466 Description of the hook
467 @item
468 # of args
469 @itemize @minus
470 @item
471 @code{arg1}: desc
472 @end itemize
473 @end itemize
474
475 @end itemize
476
477
478 @node Concept Index, Function Index, Scripting, Top
479 @unnumbered Concept Index
480 @printindex cp
481
482 @node Function Index, Variable Index, Concept Index, Top
483 @unnumbered Function Index
484 @printindex fn
485
486 @node Variable Index, , Function Index, Top
487 @unnumbered Variable Index
488 @printindex vr