6b59e728 |
1 | This is bobot++.info, produced by makeinfo version 4.7 from |
2e20c3e1 |
2 | bobot++.texinfo. |
3 | |
4 | This file documents Bobot++ by Clinton Ebadi and Etienne Bernard |
5 | (original author, no longer works on program). |
6 | |
2e18045a |
7 | Copyright 2002,2004,2005 Clinton Ebadi |
2e20c3e1 |
8 | |
9 | Permission is granted to copy, distribute and/or modify this document |
10 | under the terms of the GNU Free Documentation License, Version 1.1 or |
11 | any later version published by the Free Software Foundation; with no |
12 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
13 | Texts. |
14 | |
15 | \1f |
16 | File: bobot++.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) |
17 | |
18 | This document describes Bobot++ by Clinton Ebadi and Etienne Bernard |
19 | (original author, no longer works on program). |
20 | |
c7d9fb19 |
21 | This document applies to version 2.1.5 of the program named Bobot++ |
2e20c3e1 |
22 | |
c7d9fb19 |
23 | Copyright 2002,2004 Clinton Ebadi |
439869bf |
24 | |
25 | Permission is granted to copy, distribute and/or modify this document |
26 | under the terms of the GNU Free Documentation License, Version 1.1 or |
27 | any later version published by the Free Software Foundation; with no |
28 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover |
29 | Texts. |
30 | |
2e20c3e1 |
31 | * Menu: |
32 | |
33 | * Introduction:: |
ad529fde |
34 | * Configuration:: |
e07b6b46 |
35 | * Using the Bot:: |
ad529fde |
36 | * Scripting:: |
37 | * Concept Index:: |
38 | * Function Index:: |
39 | * Variable Index:: |
2e20c3e1 |
40 | |
c7d9fb19 |
41 | --- The Detailed Node Listing --- |
42 | |
43 | Configuration |
44 | |
45 | * Configuration Files:: |
46 | * Configuration File Placement:: |
47 | |
48 | Configuration Files |
49 | |
50 | * bot.conf:: |
c8f13c06 |
51 | * bot.users:: |
c7d9fb19 |
52 | |
53 | bot.conf |
54 | |
55 | * server syntax:: |
56 | * channel syntax:: |
57 | |
58 | Using Bobot++ |
59 | |
6b59e728 |
60 | * Starting the Bot:: |
c7d9fb19 |
61 | * User Levels:: |
c8f13c06 |
62 | * Protection:: |
63 | * Automatic Op:: |
6b59e728 |
64 | * Built-In Commands:: |
c7d9fb19 |
65 | |
66 | Scripting |
67 | |
68 | * Adding New Commands:: |
69 | * Hooks:: |
70 | * Scheme User Levels:: |
71 | * Sending Messages:: |
72 | * Misc Scripting Stuff:: |
73 | |
74 | Hooks |
75 | |
76 | * Creating a Hook:: |
77 | * Hook Types:: |
78 | |
79 | Sending Messages |
80 | |
81 | * High Level Message Functions:: |
82 | * Low Level Message Functions:: |
83 | |
2e20c3e1 |
84 | \1f |
ad529fde |
85 | File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top |
2e20c3e1 |
86 | |
6b59e728 |
87 | 1 Introduction |
88 | ************** |
2e20c3e1 |
89 | |
5a8b0ec6 |
90 | This manual feels abused and neglected because it has almost no content. |
2e20c3e1 |
91 | |
ad529fde |
92 | \1f |
e07b6b46 |
93 | File: bobot++.info, Node: Configuration, Next: Using the Bot, Prev: Introduction, Up: Top |
ad529fde |
94 | |
6b59e728 |
95 | 2 Configuration |
96 | *************** |
ad529fde |
97 | |
c8f13c06 |
98 | Bobot++ is easy to configure. See the `examples' directory for an |
99 | example configuration. |
ad529fde |
100 | |
101 | * Menu: |
102 | |
c7d9fb19 |
103 | * Configuration Files:: |
104 | * Configuration File Placement:: |
ad529fde |
105 | |
106 | \1f |
c7d9fb19 |
107 | File: bobot++.info, Node: Configuration Files, Next: Configuration File Placement, Prev: Configuration, Up: Configuration |
ad529fde |
108 | |
6b59e728 |
109 | 2.1 Configuration Files |
110 | ======================= |
ad529fde |
111 | |
e171dcce |
112 | * Menu: |
113 | |
114 | * bot.conf:: |
c8f13c06 |
115 | * bot.users:: |
e171dcce |
116 | |
117 | \1f |
c8f13c06 |
118 | File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files |
e171dcce |
119 | |
6b59e728 |
120 | 2.1.1 bot.conf |
121 | -------------- |
e171dcce |
122 | |
c8f13c06 |
123 | * Menu: |
124 | |
125 | * server syntax:: |
126 | * channel syntax:: |
127 | |
128 | `bot.conf' contains key value pairs separated by `='. |
c7d9fb19 |
129 | |
130 | `<key> = <value>' |
131 | |
132 | Comments are started with a `#' and cause the entire line to be |
133 | ignored. _Note that this only works when the `#' is the first character |
134 | of the line_. |
135 | |
136 | bot.conf is the main configuration file for a Bobot++. The available |
e171dcce |
137 | configuration variables are listed below in the format "VARIABLE |
138 | <default-value>: description" |
139 | |
140 | * NICKNAME <Bobot>: The nickname of the bot (NICK is an alias for |
141 | NICKNAME) |
142 | |
143 | * USERNAME <bobot>: The IRC username of the bot |
144 | |
145 | * CMDCHAR <!>: The character that prefixes commands given to the bot |
146 | (COMMAND is an alias for CMDCHAR) |
147 | |
148 | * IRCNAME <I'm a bobot++!>: The IRC name (or 'real name') of the bot |
149 | (REALNAME is an alias for IRCNAME) |
150 | |
151 | * USERLIST <bot.users>: Name of the file where the userlist is stored |
152 | |
153 | * SHITLIST <bot.shit>: Name of the file where the shitlist is stored |
154 | |
c7d9fb19 |
155 | * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this |
156 | to `/dev/null' to disable logging). |
157 | |
158 | * SERVER <None>: This specifies the server to connect to. Note that |
159 | this has a special syntax. |
160 | |
161 | * CHANNEL <None>: This specifies a channel the bot will join when it |
162 | starts up. This also has a special syntax. |
163 | |
164 | |
c7d9fb19 |
165 | \1f |
166 | File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf |
167 | |
6b59e728 |
168 | 2.1.1.1 server syntax |
169 | ..................... |
c7d9fb19 |
170 | |
171 | SERVER = SERVER_NAME [PORT [PASSWORD]] |
172 | |
173 | This will make Bobot++ attempt to connect to SERVER_NAME on port |
174 | PORT with the password PASSWORD. SERVER_NAME should be the address of |
175 | the server. PORT and PASSWORD are optional. You may use more than one |
176 | server line; Bobot++ will attempt to connect to the first one and, if |
177 | it fails, will connect to the next one in the list. There is also a |
178 | command to cause the bot to cycle servers. At the present time Bobot++ |
179 | cannot connect to more than one server at a time. This is a planned |
180 | feature of 3.0 (which is a very long way away; the current structure of |
181 | the program would make it very difficult to add support for connecting |
182 | to multiple servers at a time in a usable manner). |
183 | |
184 | \1f |
185 | File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf |
186 | |
6b59e728 |
187 | 2.1.1.2 channel syntax |
188 | ...................... |
c7d9fb19 |
189 | |
190 | CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY |
191 | |
192 | You may have any number of channel lines. When Bobot++ starts it will |
193 | attempt to join and gain ops in every channel listed. It will join NAME |
194 | and set the channel modes to INITIAL_MODES (e.g. "nt") if it is able to |
195 | gain operator status. It will then maintain MODES_TO_KEEP. If the |
196 | channel requires a key to enter simply set CHANNEL_KEY. Every argument |
197 | except for NAME is optional. |
198 | |
199 | A few example lines: |
200 | |
201 | `CHANNEL = #foo:nt:nt:bar' |
202 | |
203 | The bot will join `#foo' with the channel key `bar' and will then |
204 | maintain the modes `nt'. |
205 | |
206 | `CHANNEL = #bar:::' |
e171dcce |
207 | |
c7d9fb19 |
208 | The bot will join `#bar' and will not set any modes nor will it |
209 | attempt to maintain any modes. |
ad529fde |
210 | |
c8f13c06 |
211 | \1f |
212 | File: bobot++.info, Node: bot.users, Prev: bot.conf, Up: Configuration Files |
213 | |
6b59e728 |
214 | 2.1.2 bot.users |
215 | --------------- |
c8f13c06 |
216 | |
217 | `bot.users' is the default file name of the userlist. It may be changed |
218 | in `bot.conf'. The file contains lines with the format: |
219 | |
220 | `MASK:CHANNEL:LEVEL:PROTECTION:AUTO-OP' |
221 | |
222 | * MASK is the host mask (e.g. `*!*username |
223 | .domain.com') of the user |
224 | |
225 | * CHANNEL is a channel mask of the channels that the user has |
226 | priviliges to use the bot in (e.g. `*' for all channels, `#*' for |
227 | all non-local channel, `#foo*' for all channels starting with |
228 | "foo," `#bar' for channel "#bar" only, etc.) |
229 | |
230 | * LEVEL is the user level of the user (*Note User Levels::). |
231 | |
232 | * PROTECTION is the protection level of the user (*Note |
233 | Protection::). |
234 | |
235 | * AUTO-OP is set to control whether a user is automatically given |
236 | operator priviliges on channel entry (*Note Automatic Op::). |
237 | |
238 | |
ad529fde |
239 | \1f |
c7d9fb19 |
240 | File: bobot++.info, Node: Configuration File Placement, Prev: Configuration Files, Up: Configuration |
ad529fde |
241 | |
6b59e728 |
242 | 2.2 Configuration File Placement |
243 | ================================ |
ad529fde |
244 | |
5a8b0ec6 |
245 | Bobot++ will look in `/etc/bobotpp/default/' for its default config if |
246 | none is specified on the command line. Put the configuration files you |
247 | want to be loaded by default in this directory. If you are not root or |
c7d9fb19 |
248 | you want to have your own personal configuration, put it in |
ad529fde |
249 | `~/.bobotpp/config/default/'. |
250 | |
251 | \1f |
e07b6b46 |
252 | File: bobot++.info, Node: Using the Bot, Next: Scripting, Prev: Configuration, Up: Top |
253 | |
6b59e728 |
254 | 3 Using Bobot++ |
255 | *************** |
e07b6b46 |
256 | |
5a8b0ec6 |
257 | FIXME: stuff here... |
e07b6b46 |
258 | |
259 | * Menu: |
260 | |
6b59e728 |
261 | * Starting the Bot:: |
e07b6b46 |
262 | * User Levels:: |
c8f13c06 |
263 | * Protection:: |
264 | * Automatic Op:: |
6b59e728 |
265 | * Built-In Commands:: |
e07b6b46 |
266 | |
267 | \1f |
6b59e728 |
268 | File: bobot++.info, Node: Starting the Bot, Next: User Levels, Prev: Using the Bot, Up: Using the Bot |
269 | |
270 | 3.1 Starting the Bot |
271 | ==================== |
272 | |
273 | The bot is usually installed with the binary name `bobotpp'. It accepts |
274 | the following command line arguments: |
275 | |
276 | * `[--help][-h]' - Shows detailed help and exits |
277 | |
278 | * `[--version][-v]' - Shows version information and exits |
279 | |
280 | * `[--no-background][-b]' - Run bobot++ in the foreground |
281 | |
282 | * `[--config-file file][-f]' - Use file instead of `bot.conf' |
283 | |
284 | * `[--config-dir dir][-d]' - Use dir as dir to load config file from |
285 | |
286 | * `[--config dir][-c]' - Search your config path (defaults to |
287 | `$HOME/.bobotpp/config/' and then `/etc/bobotpp/') for dir and |
288 | then loads your config data using dir |
289 | |
290 | * `[--sys-config dir][-s]' - Looks for config in `/etc/bobotpp/dir'. |
291 | Note that the user dir is still searched first |
292 | |
293 | * `[--user-config dir][-u]' - Looks for config in |
294 | `$HOME/.bobotpp/config/dir/'. Note that the system dir is still |
295 | searched after this if dir is not found. |
296 | |
297 | * `[--debug][-D]' Makes Bobot++ print debugging info and run in the |
298 | foreground |
e07b6b46 |
299 | |
6b59e728 |
300 | |
301 | The default configuration is read from |
302 | `$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if |
303 | the user config is not found. |
304 | |
305 | The bot defaults to running in the background as a daemon. |
306 | |
307 | \1f |
308 | File: bobot++.info, Node: User Levels, Next: Protection, Prev: Starting the Bot, Up: Using the Bot |
309 | |
310 | 3.2 User Levels |
311 | =============== |
e07b6b46 |
312 | |
c8f13c06 |
313 | There are several user levels available in Bobot++ to provide gradated |
314 | access to commands. `!adduser' and `bot.users' use the numeric code; |
315 | Scheme uses the textual name for the level. By default (if no catch-all |
316 | setting is found in *Note bot.users::.) a user is not even a |
317 | `bot:user-none' and cannot execute *any* commands, even commands |
318 | available to `bot:user-none'. |
319 | |
320 | 0. `bot:user-none' - No *built-in* commands may be executed _by |
321 | default_ (commands may be added from Scheme that can be executed |
322 | by users of level none and the level required to execute a command |
323 | may be changed from Scheme). |
324 | |
325 | 1. `bot:user-user' - Will be able to execute most commands but not |
326 | all and cannot use masks on kicks and bans. |
327 | |
328 | 2. `bot:user-trusted' - For built-ins with a default configuration |
329 | this user has access to the same set of commands as an `user' but |
330 | may use masks on kicks and bans. Scheme commands may be added |
331 | which require a user to be of this level. |
332 | |
333 | 3. `bot:user-friend' - In the default configuration a user who is a |
334 | friend will be able to do everything short of stopping the bot. |
335 | Again, there may be user added commands that require a higher user |
336 | level. |
337 | |
338 | 4. `bot:user-master' - This is the highest user level and has access |
339 | to every feature of the bot. |
340 | |
341 | |
342 | \1f |
343 | File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Using the Bot |
344 | |
6b59e728 |
345 | 3.3 Protection |
346 | ============== |
c8f13c06 |
347 | |
348 | A user added via Scheme, the `bot.users' file, or `!adduser' may be |
349 | protected from being deoped, kicked, or banned. There are currently no |
350 | symbolic levels in Scheme; just use the numeric code. |
351 | |
352 | 0. No protection |
353 | |
354 | 1. No ban. If a user is banned the bot will unban him.. |
355 | |
356 | 2. No kick. The user may still be kicked but the bot will kickban the |
357 | user who kicked the protected user. |
358 | |
359 | 3. No deop. The bot will ensure that the user always maintains |
360 | operator status. |
361 | |
362 | |
363 | \1f |
6b59e728 |
364 | File: bobot++.info, Node: Automatic Op, Next: Built-In Commands, Prev: Protection, Up: Using the Bot |
c8f13c06 |
365 | |
6b59e728 |
366 | 3.4 Automatic Op |
367 | ================ |
c8f13c06 |
368 | |
369 | A user may be automatically given operator status upon entering a |
370 | channel. Set the AOP field to "0" to disable auto-op or "1" to enable |
371 | auto-op. |
e07b6b46 |
372 | |
6b59e728 |
373 | \1f |
374 | File: bobot++.info, Node: Built-In Commands, Prev: Automatic Op, Up: Using the Bot |
375 | |
376 | 3.5 Built-In Commands |
377 | ===================== |
378 | |
379 | Bobot++ has many built-in commands that make it useful without |
380 | scripting support. The reference leaves off the command char; remember |
381 | to use whatever you defined the command char to be in `bot.conf'. If a |
382 | command needs the channel name then you must specify the channel as the |
383 | first argument to the command when private messaging the bot a command. |
384 | |
385 | COMMAND NEEDS CHANNEL MIN LEVEL TO USE DESCRIPTION |
386 | `action' `do' Yes USER Causes the bot |
387 | to perform the |
388 | action `do' in |
389 | the current |
390 | channel. |
391 | `adduser' |
392 | `addserver' |
393 | `addshit' |
394 | `alias' |
395 | `ban' |
396 | `banlist' |
397 | `channels' |
398 | `cycle' |
399 | `dcclist' |
400 | `deban' |
401 | `delserver' |
402 | `deluser' |
403 | `delshit' |
404 | `deop' |
405 | `die' |
406 | `do' |
407 | `execute' *Only available |
408 | if scripting |
409 | support is |
410 | enabled* |
411 | `help' |
412 | `ident' |
413 | `invite' |
414 | `join' |
415 | `keep' |
416 | `kick' |
417 | `kickban' |
418 | `load' |
419 | `loadscript' *Only available |
420 | if scripting |
421 | support is |
422 | enabled* |
423 | `lock' |
424 | `mode' |
425 | `msg' |
426 | `names' |
427 | `nextserver' |
428 | `nick' |
429 | `nslookup' |
430 | `op' |
431 | `part' |
432 | `password' |
433 | `reconnect' |
434 | `rspymessage' |
435 | `save' |
436 | `say' |
437 | `server' |
438 | `serverlist' |
439 | `setfloodrate' |
440 | `setversion' |
441 | `shitlist' |
442 | `spylist' |
443 | `spymessage' |
444 | `stats' |
445 | `tban' |
446 | `tkban' |
447 | `topic' |
448 | `unlock' |
449 | `userlist' |
450 | `who' |
451 | `whois' |
452 | |
e07b6b46 |
453 | \1f |
454 | File: bobot++.info, Node: Scripting, Next: Concept Index, Prev: Using the Bot, Up: Top |
ad529fde |
455 | |
6b59e728 |
456 | 4 Scripting |
457 | *********** |
ad529fde |
458 | |
5a8b0ec6 |
459 | Bobot++'s most powerful feature is its scripting system. You write |
ad529fde |
460 | scripts using Guile Scheme. This manual does not cover how to use Guile |
461 | or how to learn Scheme. *Note Guile Reference Manual: (guile)Top, for |
462 | the Guile reference manual and |
6b59e728 |
463 | `http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html' for a |
ad529fde |
464 | good tutorial on Scheme. |
465 | |
439869bf |
466 | Note that in previous versions the scripting commands where in the |
467 | form `bot-FUNCTION'. They are now in the form `bot:FUNCTION'. The old |
468 | names are still available, but are deprecated and will be removed in |
c8f13c06 |
469 | Bobot++ 3.0. New commands are only available with the `bot:' prefix. |
470 | The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough |
471 | to convert your code to use the new functions. |
439869bf |
472 | |
473 | * Menu: |
474 | |
475 | * Adding New Commands:: |
476 | * Hooks:: |
e07b6b46 |
477 | * Scheme User Levels:: |
478 | * Sending Messages:: |
91dddabd |
479 | * Misc Scripting Stuff:: |
439869bf |
480 | |
481 | \1f |
482 | File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting |
483 | |
6b59e728 |
484 | 4.1 Adding New Commands |
485 | ======================= |
439869bf |
486 | |
5a8b0ec6 |
487 | Adding a new command is simple. To register a new command use |
e07b6b46 |
488 | `bot:addcommand'. The prototype for `bot:addcommand' is |
489 | `(bot:addcommand name func needs-channel? num-of-args min-level)'. The |
490 | `name' is a string representing the name of the command being added. |
491 | `func' is a function accepting `num-of-args' arguments. |
492 | `needs-channel?' is a bool that is true if the function needs the |
493 | channel name as its first arg, and false otherwise. `num-of-args' is |
494 | the number of args `func' will take and must be within zero (0) and |
495 | twenty (20). `min-level' is one of the *Note Scheme User Levels::. A |
496 | user must be at least a `min-level' user to use the new command. None |
497 | of the arguments are guaranteed to be passed; if they aren't they are |
498 | set to the empty string `""'. An example of a new command would be: |
e07b6b46 |
499 | |
fed59248 |
500 | (define (hello channel name) |
501 | (if (string=? name "") |
502 | (bot:say channel "Hello world!") |
503 | (bot:say channel (string-append "Hello " name "!"))) |
6b59e728 |
504 | |
fed59248 |
505 | (bot:addcommand "hello" hello #t 2 0) |
e07b6b46 |
506 | |
fed59248 |
507 | This will display "Hello World!" if called as `!hello' and "Hello |
508 | World `USER'" if called as `!hello USER'. |
439869bf |
509 | |
510 | \1f |
e07b6b46 |
511 | File: bobot++.info, Node: Hooks, Next: Scheme User Levels, Prev: Adding New Commands, Up: Scripting |
439869bf |
512 | |
6b59e728 |
513 | 4.2 Hooks |
514 | ========= |
439869bf |
515 | |
5a8b0ec6 |
516 | Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII |
6530edbf |
517 | and tiny fugue (a MUD bot) hooks with a little bit of extra stuff added |
518 | in. The basic idea of a hook if that you match a text against regular |
519 | expression and call a function if text in a message matches that regex. |
520 | The different types of hooks provided by Bobot++ correspond to the |
521 | different classes of messages that Bobot++ can recieve. A Hook also has |
522 | several properties, including its priority and whether or not it is a |
523 | fallthrough hook. Higher priority hooks are executed before lower |
524 | priority hooks and fallthrough hooks are executed before |
525 | non-fallthrough hooks of the same priority. A fallthrough hook can |
526 | match and processing of hooks will continue; as soon as the first |
527 | non-fallthrough hooks matches processing of hooks stops. |
439869bf |
528 | |
529 | * Menu: |
530 | |
531 | * Creating a Hook:: |
532 | * Hook Types:: |
533 | |
534 | \1f |
535 | File: bobot++.info, Node: Creating a Hook, Next: Hook Types, Prev: Hooks, Up: Hooks |
536 | |
6b59e728 |
537 | 4.2.1 Creating a Hook |
538 | --------------------- |
439869bf |
539 | |
5a8b0ec6 |
540 | To add a new hook you use the function `bot:addhook'. `bot:addhook' is |
541 | prototyped as `(bot:addhook type regex function pri fall name)'. `type' |
542 | specifies the type of hook (the types of hooks are listed in *Note Hook |
543 | Types::). `regex' is a standard regular expression. If `regex' is |
544 | matched, `function' will be called. `function' will take a different |
545 | number of args depending on the hook type. `pri' specifies the priority |
546 | of the hook--higher priority hooks are executed first. This argument is |
547 | optional and defaults to `0'. `fall' is `#t' if the hook is a |
548 | fallthrough hook and `#f' is the hook is not a fallthrough hook. This |
549 | arg is also optional and default to `#t'. `name' is the optional name |
550 | of the hook that defaults to "DEFAULT". If you set the name then you |
551 | can have more than one hook that matches the same regexp, as long as |
552 | they have the same name. E.g. in a log script you could have the |
553 | regexps for the log function all be `".*"' and set their names to |
fd7440f1 |
554 | `"log"' to avoid a conflict with other hooks. |
439869bf |
555 | |
556 | \1f |
557 | File: bobot++.info, Node: Hook Types, Prev: Creating a Hook, Up: Hooks |
558 | |
6b59e728 |
559 | 4.2.2 Hook Types |
560 | ---------------- |
439869bf |
561 | |
5a8b0ec6 |
562 | Here is a list of the various hooks are notes on each one. The general |
563 | format of a hook is: |
439869bf |
564 | |
565 | * `hooks/name' (this is the Scheme variable name of the hook) |
566 | - Description of the hook |
567 | |
fed59248 |
568 | - ARG1 ARG2 ... ARGN |
569 | - ARG1: desc |
439869bf |
570 | |
fed59248 |
571 | - ARG2: desc |
439869bf |
572 | |
573 | - ... |
574 | |
fed59248 |
575 | - ARGN: desc |
439869bf |
576 | |
e07b6b46 |
577 | That said, here is the list of available hooks: FIXME: write docs |
439869bf |
578 | |
579 | * `hooks/action' |
fed59248 |
580 | - This hook is triggered when someone performs an action. |
439869bf |
581 | |
fed59248 |
582 | - FROM, TO, ACTION |
583 | - FROM: this is the address of the person that performed |
0b7a49e2 |
584 | the action in the form `NICK ! USER @ HOST' (without the |
fed59248 |
585 | spaces). |
586 | |
587 | - TO: This is the target of the action, which is either a |
588 | channel or the Bot's nick. |
589 | |
590 | - ACTION: This is the text of the action. E.g. if someone |
591 | did `* foobar does baz', then ACTION would be the string |
592 | `"does baz"'. |
439869bf |
593 | |
439869bf |
594 | * `hooks/nickname' |
595 | - Description of the hook |
596 | |
597 | - # of args |
598 | - `arg1': desc |
599 | |
439869bf |
600 | * `hooks/signoff' |
601 | - Description of the hook |
602 | |
603 | - # of args |
604 | - `arg1': desc |
605 | |
439869bf |
606 | * `hooks/ctcp' |
607 | - Description of the hook |
608 | |
609 | - # of args |
610 | - `arg1': desc |
611 | |
439869bf |
612 | * `hooks/ctcp-reply' |
613 | - Description of the hook |
614 | |
615 | - # of args |
616 | - `arg1': desc |
617 | |
439869bf |
618 | * `hooks/disconnect' |
619 | - Description of the hook |
620 | |
621 | - # of args |
622 | - `arg1': desc |
623 | |
439869bf |
624 | * `hooks/flood' |
625 | - Description of the hook |
626 | |
627 | - # of args |
628 | - `arg1': desc |
629 | |
439869bf |
630 | * `hooks/invite' |
631 | - Description of the hook |
632 | |
633 | - # of args |
634 | - `arg1': desc |
635 | |
439869bf |
636 | * `hooks/join' |
637 | - Description of the hook |
638 | |
639 | - # of args |
640 | - `arg1': desc |
641 | |
439869bf |
642 | * `hooks/kick' |
643 | - Description of the hook |
644 | |
645 | - # of args |
646 | - `arg1': desc |
647 | |
439869bf |
648 | * `hooks/part' |
649 | - Description of the hook |
650 | |
651 | - # of args |
652 | - `arg1': desc |
653 | |
439869bf |
654 | * `hooks/mode' |
655 | - Description of the hook |
656 | |
657 | - # of args |
658 | - `arg1': desc |
659 | |
439869bf |
660 | * `hooks/message' |
661 | - Description of the hook |
662 | |
663 | - # of args |
664 | - `arg1': desc |
665 | |
439869bf |
666 | * `hooks/notice' |
667 | - Description of the hook |
668 | |
669 | - # of args |
670 | - `arg1': desc |
671 | |
439869bf |
672 | * `hooks/public' |
673 | - Description of the hook |
674 | |
675 | - # of args |
676 | - `arg1': desc |
677 | |
439869bf |
678 | * `hooks/public-notice' |
679 | - Description of the hook |
680 | |
681 | - # of args |
682 | - `arg1': desc |
683 | |
439869bf |
684 | * `hooks/raw' |
685 | - Description of the hook |
686 | |
687 | - # of args |
688 | - `arg1': desc |
689 | |
439869bf |
690 | * `hooks/timer' |
691 | - Description of the hook |
692 | |
693 | - # of args |
694 | - `arg1': desc |
695 | |
439869bf |
696 | * `hooks/topic' |
697 | - Description of the hook |
698 | |
699 | - # of args |
700 | - `arg1': desc |
701 | |
0b7a49e2 |
702 | * `hooks/dcc/begin' |
703 | - This hook is triggered when a user begins a DCC CHAT with the |
704 | bot. |
705 | |
706 | - FROM |
707 | - FROM: This is the user's address in the form |
708 | `nick!user@host'. |
709 | |
710 | * `hooks/dcc/message' |
711 | - This hook is triggered when a user sends a message to the bot |
712 | through a DCC CHAT |
713 | |
714 | - FROM MESSAGE |
715 | - FROM: This is the user's address in the form |
716 | `nick!user@host'. |
717 | |
718 | - MESSAGE: This is the message the user sent to the bot. |
439869bf |
719 | |
e07b6b46 |
720 | \1f |
721 | File: bobot++.info, Node: Scheme User Levels, Next: Sending Messages, Prev: Hooks, Up: Scripting |
722 | |
6b59e728 |
723 | 4.3 Scheme User Levels |
724 | ====================== |
e07b6b46 |
725 | |
5a8b0ec6 |
726 | There are five levels that a user may be when interfacing with a bot: |
e07b6b46 |
727 | NONE, USER, TRUSTED_USER, FRIEND, MASTER. The Scheme variables for the |
728 | user levels are `bot:user-none', `bot:user-user', `bot:user-trusted', |
729 | `bot:user-friend', and `bot:user-master'. See *Note User Levels:: for |
730 | more information on User Levels. |
731 | |
732 | When adding a new command, think about who should be able to use it. |
733 | Is your command a general purpose command that helps the channel (e.g. |
734 | `!seen') that everyone should be able to use? Or is it something that |
735 | should be restricted? See *Note User Levels:: for information on what |
736 | level users can do what with the built in bot commands and think about |
737 | what level a user your command is targetted towards. You must be _very_ |
738 | careful when giving new commands to lower level users because you can |
739 | do basically everything the bot can do with a script. As the scripting |
740 | interface becomes more powerful, you must think more about what users |
741 | can use new commands you add. |
742 | |
743 | \1f |
91dddabd |
744 | File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Scheme User Levels, Up: Scripting |
e07b6b46 |
745 | |
6b59e728 |
746 | 4.4 Sending Messages |
747 | ==================== |
e07b6b46 |
748 | |
5a8b0ec6 |
749 | There are several types of messages you can send with Bobot++ from |
e07b6b46 |
750 | scripts. There is the simple, but rather limited, `bot:say', |
751 | `bot:action' and `bot:msg', and the more powerful, but lower level, |
752 | `bot:send-MESSAGE' functions. Most bots will probably only need the |
753 | higher level functions, but for the sake of why-not Bobot++ lets you |
ce02032f |
754 | use the lower level functions (in progress). |
e07b6b46 |
755 | |
756 | * Menu: |
757 | |
758 | * High Level Message Functions:: |
759 | * Low Level Message Functions:: |
760 | |
761 | \1f |
762 | File: bobot++.info, Node: High Level Message Functions, Next: Low Level Message Functions, Prev: Sending Messages, Up: Sending Messages |
763 | |
6b59e728 |
764 | 4.4.1 "High Level" Message Functions |
765 | ------------------------------------ |
e07b6b46 |
766 | |
5a8b0ec6 |
767 | ... |
e07b6b46 |
768 | |
769 | \1f |
770 | File: bobot++.info, Node: Low Level Message Functions, Prev: High Level Message Functions, Up: Sending Messages |
771 | |
6b59e728 |
772 | 4.4.2 "Low Level" Message Functions |
773 | ----------------------------------- |
e07b6b46 |
774 | |
5a8b0ec6 |
775 | The "Low Level" messaging functions allow you to do things like send |
fed59248 |
776 | CTCP messages. You probably want to read rfc 2812 and the CTCP spec |
e07b6b46 |
777 | before using these. If you have no idea what these do, read rfc 2812 |
778 | (IRC Client Protocol) and CTCP spec. These functions all return |
779 | `*unspecified*' always, so don't use the return value for anything. |
780 | |
781 | * `bot:send-CTCP to command message' `to' is the target of your CTCP |
782 | message, `command' is the CTCP command, and `message' is the |
783 | message (or arguments) of the command. Make sure to |
784 | `bot:ctcp-quote' the message! |
785 | |
786 | |
91dddabd |
787 | \1f |
788 | File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting |
789 | |
6b59e728 |
790 | 4.5 Misc. Scripting Stuff |
791 | ========================= |
91dddabd |
792 | |
5a8b0ec6 |
793 | These are a few useful things that I thought people writing scripts |
91dddabd |
794 | might want to know. |
795 | |
796 | If you want to execute code when the bot exits, just do `add-hook! |
797 | bot:exit-hook THUNK' where THUNK is an argumentless procedure (a |
798 | thunk). When the bot exits your thunk will be called. |
799 | |
ad529fde |
800 | \1f |
801 | File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top |
802 | |
803 | Concept Index |
804 | ************* |
805 | |
6b59e728 |
806 | \0\b[index\0\b] |
ad529fde |
807 | * Menu: |
e07b6b46 |
808 | |
6b59e728 |
809 | * Background on Hooks: Hooks. (line 6) |
e07b6b46 |
810 | |
ad529fde |
811 | \1f |
812 | File: bobot++.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top |
813 | |
814 | Function Index |
815 | ************** |
816 | |
6b59e728 |
817 | \0\b[index\0\b] |
ad529fde |
818 | * Menu: |
e07b6b46 |
819 | |
6b59e728 |
820 | * addcommand: Adding New Commands. (line 6) |
821 | * addhook: Creating a Hook. (line 6) |
e07b6b46 |
822 | |
ad529fde |
823 | \1f |
824 | File: bobot++.info, Node: Variable Index, Prev: Function Index, Up: Top |
825 | |
826 | Variable Index |
827 | ************** |
828 | |
6b59e728 |
829 | \0\b[index\0\b] |
ad529fde |
830 | * Menu: |
2e20c3e1 |
831 | |
fed59248 |
832 | * exit-hook: Misc Scripting Stuff. |
6b59e728 |
833 | (line 9) |
834 | * hooks/action: Hook Types. (line 23) |
835 | * hooks/ctcp: Hook Types. (line 50) |
836 | * hooks/ctcp-reply: Hook Types. (line 56) |
837 | * hooks/dcc/begin: Hook Types. (line 146) |
838 | * hooks/dcc/message: Hook Types. (line 154) |
839 | * hooks/disconnect: Hook Types. (line 62) |
840 | * hooks/flood: Hook Types. (line 68) |
841 | * hooks/invite: Hook Types. (line 74) |
842 | * hooks/join: Hook Types. (line 80) |
843 | * hooks/kick: Hook Types. (line 86) |
844 | * hooks/message: Hook Types. (line 104) |
845 | * hooks/mode: Hook Types. (line 98) |
846 | * hooks/nickname: Hook Types. (line 38) |
847 | * hooks/notice: Hook Types. (line 110) |
848 | * hooks/part: Hook Types. (line 92) |
849 | * hooks/public: Hook Types. (line 116) |
850 | * hooks/public-notice: Hook Types. (line 122) |
851 | * hooks/raw: Hook Types. (line 128) |
852 | * hooks/signoff: Hook Types. (line 44) |
853 | * hooks/timer: Hook Types. (line 134) |
854 | * hooks/topic: Hook Types. (line 140) |
855 | * user-friend: Scheme User Levels. (line 6) |
856 | * user-master: Scheme User Levels. (line 6) |
857 | * user-none: Scheme User Levels. (line 6) |
858 | * user-trusted: Scheme User Levels. (line 6) |
859 | * user-user: Scheme User Levels. (line 6) |
e07b6b46 |
860 | |
861 | |
2e20c3e1 |
862 | \1f |
863 | Tag Table: |
2e18045a |
864 | Node: Top\7f527 |
865 | Node: Introduction\7f1816 |
866 | Node: Configuration\7f2008 |
867 | Node: Configuration Files\7f2295 |
868 | Node: bot.conf\7f2510 |
869 | Node: server syntax\7f3948 |
870 | Node: channel syntax\7f4812 |
871 | Node: bot.users\7f5655 |
872 | Node: Configuration File Placement\7f6558 |
873 | Node: Using the Bot\7f7036 |
874 | Node: Starting the Bot\7f7286 |
875 | Node: User Levels\7f8630 |
876 | Node: Protection\7f10086 |
877 | Node: Automatic Op\7f10695 |
878 | Node: Built-In Commands\7f10984 |
879 | Node: Scripting\7f15518 |
880 | Node: Adding New Commands\7f16483 |
881 | Node: Hooks\7f17750 |
882 | Node: Creating a Hook\7f18729 |
883 | Node: Hook Types\7f19877 |
884 | Node: Scheme User Levels\7f23360 |
885 | Node: Sending Messages\7f24494 |
886 | Node: High Level Message Functions\7f25110 |
887 | Node: Low Level Message Functions\7f25333 |
888 | Node: Misc Scripting Stuff\7f26095 |
889 | Node: Concept Index\7f26519 |
890 | Node: Function Index\7f26738 |
891 | Node: Variable Index\7f27037 |
2e20c3e1 |
892 | \1f |
893 | End Tag Table |