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 |
e45daca1 |
5 | (The original author who no longer works on the program). |
2e20c3e1 |
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 |
e45daca1 |
19 | (The original author who no longer works on the program). |
2e20c3e1 |
20 | |
e45daca1 |
21 | This document applies to version 2.2 of the program named Bobot++. |
2e20c3e1 |
22 | |
ae97d6ec |
23 | Copyright 2002,2004,2005 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 | |
c7d9fb19 |
45 | * Configuration File Placement:: |
4679dc8b |
46 | * Configuration Files:: |
c7d9fb19 |
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 | |
ae97d6ec |
79 | Hook Types |
80 | |
81 | * Received Message Hooks:: |
82 | * Sent Message Hooks:: |
83 | * DCC CHAT Hooks:: |
84 | * Miscellaneous Hooks:: |
85 | |
c7d9fb19 |
86 | Sending Messages |
87 | |
88 | * High Level Message Functions:: |
89 | * Low Level Message Functions:: |
90 | |
2e20c3e1 |
91 | \1f |
ad529fde |
92 | File: bobot++.info, Node: Introduction, Next: Configuration, Prev: Top, Up: Top |
2e20c3e1 |
93 | |
6b59e728 |
94 | 1 Introduction |
95 | ************** |
2e20c3e1 |
96 | |
5a8b0ec6 |
97 | This manual feels abused and neglected because it has almost no content. |
2e20c3e1 |
98 | |
ad529fde |
99 | \1f |
e07b6b46 |
100 | File: bobot++.info, Node: Configuration, Next: Using the Bot, Prev: Introduction, Up: Top |
ad529fde |
101 | |
6b59e728 |
102 | 2 Configuration |
103 | *************** |
ad529fde |
104 | |
c8f13c06 |
105 | Bobot++ is easy to configure. See the `examples' directory for an |
106 | example configuration. |
ad529fde |
107 | |
e45daca1 |
108 | The main configuration file is `bot.conf'. There are several |
109 | auxiliary configuration files (a user list, aliases file, ban list, and |
110 | a script autoexec). |
111 | |
ad529fde |
112 | * Menu: |
113 | |
c7d9fb19 |
114 | * Configuration File Placement:: |
4679dc8b |
115 | * Configuration Files:: |
116 | |
117 | \1f |
118 | File: bobot++.info, Node: Configuration File Placement, Next: Configuration Files, Prev: Configuration, Up: Configuration |
119 | |
120 | 2.1 Configuration File Placement |
121 | ================================ |
122 | |
123 | Bobot++ will look in `/etc/bobotpp/default/' for its default config if |
124 | none is specified on the command line. Put the configuration files you |
e45daca1 |
125 | want to be loaded by default in this directory. If you are not root, or |
4679dc8b |
126 | you want to have your own personal configuration, put it in |
127 | `~/.bobotpp/config/default/'. |
ad529fde |
128 | |
129 | \1f |
4679dc8b |
130 | File: bobot++.info, Node: Configuration Files, Prev: Configuration File Placement, Up: Configuration |
ad529fde |
131 | |
4679dc8b |
132 | 2.2 Configuration Files |
6b59e728 |
133 | ======================= |
ad529fde |
134 | |
e171dcce |
135 | * Menu: |
136 | |
137 | * bot.conf:: |
c8f13c06 |
138 | * bot.users:: |
e171dcce |
139 | |
140 | \1f |
c8f13c06 |
141 | File: bobot++.info, Node: bot.conf, Next: bot.users, Prev: Configuration Files, Up: Configuration Files |
e171dcce |
142 | |
4679dc8b |
143 | 2.2.1 bot.conf |
6b59e728 |
144 | -------------- |
e171dcce |
145 | |
e45daca1 |
146 | `bot.conf' contains key value pairs separated by `='. |
c7d9fb19 |
147 | |
148 | `<key> = <value>' |
149 | |
150 | Comments are started with a `#' and cause the entire line to be |
151 | ignored. _Note that this only works when the `#' is the first character |
152 | of the line_. |
153 | |
154 | bot.conf is the main configuration file for a Bobot++. The available |
e171dcce |
155 | configuration variables are listed below in the format "VARIABLE |
156 | <default-value>: description" |
157 | |
e45daca1 |
158 | A few of the options have more complex syntax, they are documented in |
159 | their own subsections. |
160 | |
161 | * Menu: |
162 | |
163 | * server syntax:: |
164 | * channel syntax:: |
165 | |
e171dcce |
166 | * NICKNAME <Bobot>: The nickname of the bot (NICK is an alias for |
167 | NICKNAME) |
168 | |
169 | * USERNAME <bobot>: The IRC username of the bot |
170 | |
171 | * CMDCHAR <!>: The character that prefixes commands given to the bot |
172 | (COMMAND is an alias for CMDCHAR) |
173 | |
174 | * IRCNAME <I'm a bobot++!>: The IRC name (or 'real name') of the bot |
175 | (REALNAME is an alias for IRCNAME) |
176 | |
177 | * USERLIST <bot.users>: Name of the file where the userlist is stored |
178 | |
e45daca1 |
179 | * SHITLIST <bot.shit>: Name of the file where the shitlist (ban |
180 | list) is stored |
e171dcce |
181 | |
c7d9fb19 |
182 | * LOGFILE <$LOGDIR/bot.log>: Location of the bot logfile (set this |
183 | to `/dev/null' to disable logging). |
184 | |
e45daca1 |
185 | * SERVER <None>: This specifies the server to which the bot will |
186 | connect. Note that this has a special syntax *note server syntax::. |
c7d9fb19 |
187 | |
e45daca1 |
188 | * CHANNEL <None>: This specifies the channels the bot will join when |
189 | it starts up. This has a special syntax *note channel syntax::. |
c7d9fb19 |
190 | |
191 | |
c7d9fb19 |
192 | \1f |
193 | File: bobot++.info, Node: server syntax, Next: channel syntax, Prev: bot.conf, Up: bot.conf |
194 | |
4679dc8b |
195 | 2.2.1.1 server syntax |
6b59e728 |
196 | ..................... |
c7d9fb19 |
197 | |
e45daca1 |
198 | The server syntax in `bot.conf' allows you to specify an alternate port |
199 | to connect on, and a password to send the server. |
200 | |
201 | You may use more than one server line; Bobot++ will attempt to |
202 | connect to the first one, and will connect to the next one in the list |
203 | if it fails. The bot will continue cycling through the server list |
204 | until it is able to connect to one. There is a command (`!cycle') to |
205 | make the bot to cycle servers. |
206 | |
207 | SERVER = SERVER_NAME [PORT [PASSWORD]] |
c7d9fb19 |
208 | |
209 | This will make Bobot++ attempt to connect to SERVER_NAME on port |
210 | PORT with the password PASSWORD. SERVER_NAME should be the address of |
e45daca1 |
211 | the server. PORT and PASSWORD are optional. |
c7d9fb19 |
212 | |
213 | \1f |
214 | File: bobot++.info, Node: channel syntax, Prev: server syntax, Up: bot.conf |
215 | |
4679dc8b |
216 | 2.2.1.2 channel syntax |
6b59e728 |
217 | ...................... |
c7d9fb19 |
218 | |
e45daca1 |
219 | The channel syntax in `bot.conf' allows you to specify the initial |
220 | modes the bot should set on a channel, the modes the bot should |
221 | maintain, and a key if the channel needs it. |
c7d9fb19 |
222 | |
223 | You may have any number of channel lines. When Bobot++ starts it will |
e45daca1 |
224 | attempt to join and gain operator status in every channel listed. |
225 | |
226 | CHANNEL = NAME:INITIAL_MODES:MODES_TO_KEEP:CHANNEL_KEY |
227 | |
228 | The bot will join NAME and set the channel modes to INITIAL_MODES |
229 | (e.g. "nt") if it is able to gain operator status. It will then |
230 | maintain MODES_TO_KEEP. If the channel requires a key to enter simply |
231 | set CHANNEL_KEY. Every argument except for NAME is optional. |
c7d9fb19 |
232 | |
233 | A few example lines: |
234 | |
e45daca1 |
235 | CHANNEL = #foo:nt:nt:bar |
c7d9fb19 |
236 | |
237 | The bot will join `#foo' with the channel key `bar' and will then |
238 | maintain the modes `nt'. |
239 | |
e45daca1 |
240 | CHANNEL = #bar::: |
e171dcce |
241 | |
c7d9fb19 |
242 | The bot will join `#bar' and will not set any modes nor will it |
243 | attempt to maintain any modes. |
ad529fde |
244 | |
c8f13c06 |
245 | \1f |
246 | File: bobot++.info, Node: bot.users, Prev: bot.conf, Up: Configuration Files |
247 | |
4679dc8b |
248 | 2.2.2 bot.users |
6b59e728 |
249 | --------------- |
c8f13c06 |
250 | |
251 | `bot.users' is the default file name of the userlist. It may be changed |
252 | in `bot.conf'. The file contains lines with the format: |
253 | |
254 | `MASK:CHANNEL:LEVEL:PROTECTION:AUTO-OP' |
255 | |
256 | * MASK is the host mask (e.g. `*!*username |
257 | .domain.com') of the user |
258 | |
259 | * CHANNEL is a channel mask of the channels that the user has |
260 | priviliges to use the bot in (e.g. `*' for all channels, `#*' for |
261 | all non-local channel, `#foo*' for all channels starting with |
262 | "foo," `#bar' for channel "#bar" only, etc.) |
263 | |
264 | * LEVEL is the user level of the user (*Note User Levels::). |
265 | |
266 | * PROTECTION is the protection level of the user (*Note |
267 | Protection::). |
268 | |
269 | * AUTO-OP is set to control whether a user is automatically given |
270 | operator priviliges on channel entry (*Note Automatic Op::). |
271 | |
272 | |
ad529fde |
273 | \1f |
e07b6b46 |
274 | File: bobot++.info, Node: Using the Bot, Next: Scripting, Prev: Configuration, Up: Top |
275 | |
6b59e728 |
276 | 3 Using Bobot++ |
277 | *************** |
e07b6b46 |
278 | |
5a8b0ec6 |
279 | FIXME: stuff here... |
e07b6b46 |
280 | |
281 | * Menu: |
282 | |
6b59e728 |
283 | * Starting the Bot:: |
e07b6b46 |
284 | * User Levels:: |
c8f13c06 |
285 | * Protection:: |
286 | * Automatic Op:: |
6b59e728 |
287 | * Built-In Commands:: |
e07b6b46 |
288 | |
289 | \1f |
6b59e728 |
290 | File: bobot++.info, Node: Starting the Bot, Next: User Levels, Prev: Using the Bot, Up: Using the Bot |
291 | |
292 | 3.1 Starting the Bot |
293 | ==================== |
294 | |
295 | The bot is usually installed with the binary name `bobotpp'. It accepts |
e45daca1 |
296 | the following command line arguments. |
6b59e728 |
297 | |
298 | * `[--help][-h]' - Shows detailed help and exits |
299 | |
300 | * `[--version][-v]' - Shows version information and exits |
301 | |
302 | * `[--no-background][-b]' - Run bobot++ in the foreground |
303 | |
304 | * `[--config-file file][-f]' - Use file instead of `bot.conf' |
305 | |
306 | * `[--config-dir dir][-d]' - Use dir as dir to load config file from |
307 | |
308 | * `[--config dir][-c]' - Search your config path (defaults to |
309 | `$HOME/.bobotpp/config/' and then `/etc/bobotpp/') for dir and |
310 | then loads your config data using dir |
311 | |
312 | * `[--sys-config dir][-s]' - Looks for config in `/etc/bobotpp/dir'. |
313 | Note that the user dir is still searched first |
314 | |
315 | * `[--user-config dir][-u]' - Looks for config in |
316 | `$HOME/.bobotpp/config/dir/'. Note that the system dir is still |
317 | searched after this if dir is not found. |
318 | |
319 | * `[--debug][-D]' Makes Bobot++ print debugging info and run in the |
320 | foreground |
e07b6b46 |
321 | |
4da877a5 |
322 | * `[--debug-scripts][-S]' Enabled the Guile debugging evaluator for |
323 | verbose script errors and backtraces while still running the bot |
324 | in the background. |
325 | |
6b59e728 |
326 | The default configuration is read from |
327 | `$HOME/.bobotpp/config/default/' and then `/etc/bobotpp/default/' if |
328 | the user config is not found. |
329 | |
330 | The bot defaults to running in the background as a daemon. |
331 | |
332 | \1f |
333 | File: bobot++.info, Node: User Levels, Next: Protection, Prev: Starting the Bot, Up: Using the Bot |
334 | |
335 | 3.2 User Levels |
336 | =============== |
e07b6b46 |
337 | |
c8f13c06 |
338 | There are several user levels available in Bobot++ to provide gradated |
339 | access to commands. `!adduser' and `bot.users' use the numeric code; |
e45daca1 |
340 | Scheme uses the textual name for the level. By default (if the user is |
341 | not found in the userlist) a user has access to commands with the level |
342 | `bot:user-none'. |
c8f13c06 |
343 | |
344 | 0. `bot:user-none' - No *built-in* commands may be executed _by |
345 | default_ (commands may be added from Scheme that can be executed |
346 | by users of level none and the level required to execute a command |
347 | may be changed from Scheme). |
348 | |
349 | 1. `bot:user-user' - Will be able to execute most commands but not |
350 | all and cannot use masks on kicks and bans. |
351 | |
352 | 2. `bot:user-trusted' - For built-ins with a default configuration |
353 | this user has access to the same set of commands as an `user' but |
354 | may use masks on kicks and bans. Scheme commands may be added |
355 | which require a user to be of this level. |
356 | |
357 | 3. `bot:user-friend' - In the default configuration a user who is a |
358 | friend will be able to do everything short of stopping the bot. |
359 | Again, there may be user added commands that require a higher user |
360 | level. |
361 | |
362 | 4. `bot:user-master' - This is the highest user level and has access |
363 | to every feature of the bot. |
364 | |
365 | |
366 | \1f |
367 | File: bobot++.info, Node: Protection, Next: Automatic Op, Prev: User Levels, Up: Using the Bot |
368 | |
6b59e728 |
369 | 3.3 Protection |
370 | ============== |
c8f13c06 |
371 | |
372 | A user added via Scheme, the `bot.users' file, or `!adduser' may be |
e45daca1 |
373 | protected from being deoped, kicked, or banned. The user list and IRC |
374 | commands use the numeric codes, Scheme uses the symbolic names. |
c8f13c06 |
375 | |
e45daca1 |
376 | 0. `bot:protection/none' No protection |
c8f13c06 |
377 | |
e45daca1 |
378 | 1. `bot:protection/no-ban' No ban. If a user is banned the bot will |
379 | unban him.. |
c8f13c06 |
380 | |
e45daca1 |
381 | 2. `bot:protection/no-kick' No kick. The user may still be kicked but |
382 | the bot will kickban the user who kicked the protected user. |
c8f13c06 |
383 | |
e45daca1 |
384 | 3. `bot:protection/no-deop' No deop. The bot will ensure that the |
385 | user always maintains operator status. |
c8f13c06 |
386 | |
c8f13c06 |
387 | \1f |
6b59e728 |
388 | File: bobot++.info, Node: Automatic Op, Next: Built-In Commands, Prev: Protection, Up: Using the Bot |
c8f13c06 |
389 | |
6b59e728 |
390 | 3.4 Automatic Op |
391 | ================ |
c8f13c06 |
392 | |
393 | A user may be automatically given operator status upon entering a |
e45daca1 |
394 | channel. Scheme uses the symbolic name, the user list (`bot.users') and |
395 | IRC commands use the numeric value. |
396 | |
397 | 0. `bot:aop/no' Do not automatically op the user |
398 | |
399 | 1. `bot:aop/yes' Do automatically op the user |
e07b6b46 |
400 | |
6b59e728 |
401 | \1f |
402 | File: bobot++.info, Node: Built-In Commands, Prev: Automatic Op, Up: Using the Bot |
403 | |
404 | 3.5 Built-In Commands |
405 | ===================== |
406 | |
407 | Bobot++ has many built-in commands that make it useful without |
408 | scripting support. The reference leaves off the command char; remember |
409 | to use whatever you defined the command char to be in `bot.conf'. If a |
410 | command needs the channel name then you must specify the channel as the |
411 | first argument to the command when private messaging the bot a command. |
412 | |
9efc3706 |
413 | COMMAND NEEDS MIN LEVEL DESCRIPTION |
414 | CHANNEL TO USE |
415 | `action' `do' Yes USER Causes the bot to perform the |
416 | action `do' in the current channel. |
417 | `adduser' |
418 | `addserver' Adds the server specified by HOST |
419 | NAME or IP ADDRESS to the server |
420 | list. |
421 | `addshit' |
422 | `alias' Makes an alias, and adds the |
423 | function NEW NAME, that will do |
424 | exactly the same command as OLD |
425 | NAME. |
426 | `ban' Bans MASK or NICK from CHANNEL. You |
427 | need to be a trusted user to ban |
428 | with a MASK. |
429 | `banlist' |
430 | `channels' Prints the channel(s) where the bot |
431 | is currently. |
432 | `cycle' Yes Makes the bot leave and join |
433 | CHANNEL. |
434 | `dcclist' Gives the list of all DCC Chat |
435 | connections. |
436 | `deban' Yes Debans MASK or NICK from CHANNEL. |
437 | You need to be a trusted user to |
438 | deban with a MASK. |
439 | `delserver' Deletes server from server list |
440 | whose number in the server list is |
441 | SERVER NUMBER. |
442 | `deluser' Removes NICK or MASK from the |
443 | userlist. |
444 | `delshit' Removes NICK or MASK from the |
445 | shitlist. |
446 | `deop' Yes Deops MASK or NICK on CHANNEL. |
447 | `die' Makes the bot stop immediately. |
448 | `do' |
449 | `execute' *Only available if scripting |
450 | support is enabled* |
451 | `help' |
452 | `ident' Identifies you on the bot. Note |
453 | that you should not use this |
454 | command in public ... |
455 | `invite' Yes Invites NICK on CHANNEL. |
456 | `join' Makes the bot join CHANNEL. |
457 | `keep' Yes Sets the MODES that the bot will |
458 | keep for CHANNEL. |
459 | `kick' Yes Kicks MASK or NICK out of CHANNEL, |
460 | because of REASON. You need to be a |
461 | trusted user to use a MASK. |
462 | `kickban' Yes Bans then kicks MASK or NICK out of |
463 | CHANNEL, because of REASON. You need |
464 | to be a trusted user to use a MASK. |
465 | `load' Reloads the userlist from disk. |
466 | `loadscript' *Only available if scripting |
467 | support is enabled* |
468 | `lock' Locks topic on CHANNEL. |
469 | `mode' Yes Sends MODE STRING as mode for |
470 | CHANNEL. |
471 | `msg' |
472 | `names' Yes Shows the nicknames and status of |
473 | users on CHANNEL. |
474 | `nextserver' Makes the bot connect to the next |
475 | server in its server list. |
476 | `nick' Makes the bot use nickname NICK. |
477 | `nslookup' Does a nameserver query about NICK |
478 | host, HOST or IP ADDRESS. |
479 | `op' Yes Ops NICK on CHANNEL. |
480 | `part' Yes Makes the bot leave CHANNEL. |
481 | `password' Changes your password on the bot. |
482 | Use `NONE' as password if you want |
483 | to clear it. Do not use this |
484 | command in public! |
485 | `reconnect' Makes the bot reconnect to its |
486 | current server. |
487 | `rspymessage' Removes you from the spy list. |
488 | `save' Saves the userlist. |
489 | `say' Yes Makes the bot say MESSAGE on |
490 | CHANNEL. |
491 | `server' Select the server to connect to. |
492 | SERVER NUMBER is the number of the |
493 | server in the serverlist. |
494 | `serverlist' Shows the bot's serverlist. |
495 | `setfloodrate' |
496 | `setversion' |
497 | `shitlist' Shows the bot's shitlist. |
498 | `spylist' Shows the bot's spylist. |
499 | `spymessage' Adds you to the spylist |
500 | `stats' Yes Gives CHANNEL's statistics. |
501 | `tban' Yes Bans NICK or MASK from CHANNEL for |
502 | TIME seconds. |
503 | `tkban' Yes Bans NICK or MASK from CHANNEL for |
504 | TIME seconds, then kicks him/them |
505 | because of REASON. |
506 | `topic' Yes If no TOPICis given, prints |
507 | CHANNEL's topic. Otherwise, the bot |
508 | will change CHANNEL's topic to |
509 | TOPIC. |
510 | `unlock' Yes Makes the bot unlock topic on |
511 | CHANNEL |
512 | `userlist' Shows the bot's userlist |
513 | `who' Yes Show your level on CHANNEL |
514 | `whois' Yes Shows information about NICK on |
515 | CHANNEL |
6b59e728 |
516 | |
e07b6b46 |
517 | \1f |
518 | File: bobot++.info, Node: Scripting, Next: Concept Index, Prev: Using the Bot, Up: Top |
ad529fde |
519 | |
6b59e728 |
520 | 4 Scripting |
521 | *********** |
ad529fde |
522 | |
5a8b0ec6 |
523 | Bobot++'s most powerful feature is its scripting system. You write |
ad529fde |
524 | scripts using Guile Scheme. This manual does not cover how to use Guile |
525 | or how to learn Scheme. *Note Guile Reference Manual: (guile)Top, for |
526 | the Guile reference manual and |
6b59e728 |
527 | `http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html' for a |
ad529fde |
528 | good tutorial on Scheme. |
529 | |
439869bf |
530 | Note that in previous versions the scripting commands where in the |
531 | form `bot-FUNCTION'. They are now in the form `bot:FUNCTION'. The old |
532 | names are still available, but are deprecated and will be removed in |
c8f13c06 |
533 | Bobot++ 3.0. New commands are only available with the `bot:' prefix. |
534 | The command `perl -pi -e ``s/bot-/bot:/g'' YOUR-FILES' should be enough |
535 | to convert your code to use the new functions. |
439869bf |
536 | |
ae97d6ec |
537 | *NOTE*: All arguments to functions and hooks called by the bot are |
538 | strings unless otherwise specified. |
539 | |
439869bf |
540 | * Menu: |
541 | |
542 | * Adding New Commands:: |
543 | * Hooks:: |
e07b6b46 |
544 | * Scheme User Levels:: |
545 | * Sending Messages:: |
91dddabd |
546 | * Misc Scripting Stuff:: |
439869bf |
547 | |
548 | \1f |
549 | File: bobot++.info, Node: Adding New Commands, Next: Hooks, Prev: Scripting, Up: Scripting |
550 | |
6b59e728 |
551 | 4.1 Adding New Commands |
552 | ======================= |
439869bf |
553 | |
5a8b0ec6 |
554 | Adding a new command is simple. To register a new command use |
9efc3706 |
555 | `bot:addcommand'. |
556 | |
557 | -- Function: bot:addcommand name func needs-channel? num-of-args |
558 | min-level |
559 | The NAME is a string representing the name of the command being |
560 | added. FUNC is a function accepting NUM-OF-ARGS arguments. |
561 | NEEDS-CHANNEL? is a bool that is true if the function needs the |
562 | channel name as its first arg, and false otherwise. NUM-OF-ARGS |
563 | is the number of args FUNC will take and must be within zero (0) |
564 | and twenty (20). MIN-LEVEL is one of the *Note Scheme User |
565 | Levels::. A user must be at least a `min-level' user to use the |
566 | new command. None of the arguments are guaranteed to be passed; |
567 | if they aren't they are set to the empty string `""'. An example |
568 | of a new command would be: |
569 | |
570 | (define (hello channel name) |
571 | (if (string=? name "") |
572 | (bot:say channel "Hello world!") |
573 | (bot:say channel (string-append "Hello " name "!"))) |
574 | |
575 | (bot:addcommand "hello" hello #t 2 0) |
576 | |
577 | This will display "Hello World!" if called as `!hello' and "Hello |
ae97d6ec |
578 | World USER" if called as `!hello USER'. |
439869bf |
579 | |
580 | \1f |
e07b6b46 |
581 | File: bobot++.info, Node: Hooks, Next: Scheme User Levels, Prev: Adding New Commands, Up: Scripting |
439869bf |
582 | |
6b59e728 |
583 | 4.2 Hooks |
584 | ========= |
439869bf |
585 | |
5a8b0ec6 |
586 | Hooks are a powerful feature of Bobot++. Hooks are a hybrid of ircII |
6530edbf |
587 | and tiny fugue (a MUD bot) hooks with a little bit of extra stuff added |
02341ea9 |
588 | in. A hook is called when a regular expression is matched against a |
589 | message sent to or by the bot. |
590 | |
591 | Bobot++ uses different hook types for each IRC message type, and also |
592 | includes a hook for accessing raw irc messages. Hooks are tagged with a |
593 | priority and a flag that specifies whether to call the next hook that |
594 | matches after calling the current one or to stop processing. |
595 | |
596 | Hooks are processed from the highest to lowest priority, with |
597 | fallthrough hooks of equal priority to non-fallthrough hooks being |
598 | executed first. |
439869bf |
599 | |
600 | * Menu: |
601 | |
602 | * Creating a Hook:: |
603 | * Hook Types:: |
604 | |
605 | \1f |
606 | File: bobot++.info, Node: Creating a Hook, Next: Hook Types, Prev: Hooks, Up: Hooks |
607 | |
6b59e728 |
608 | 4.2.1 Creating a Hook |
609 | --------------------- |
439869bf |
610 | |
9efc3706 |
611 | To add a new hook you use the function `bot:addhook'. |
612 | |
613 | -- Function: bot:addhook type regex function [pri fall name] |
614 | TYPE specifies the type of hook (the types of hooks are listed in |
ae97d6ec |
615 | *Note Hook Types::). |
616 | |
617 | REGEX is a standard regular expression. If REGEX is matched, |
618 | FUNCTION will be called. |
619 | |
620 | FUNCTION will take a different number of args depending on the |
621 | hook type. |
622 | |
623 | PRI specifies the priority of the hook--higher priority hooks are |
624 | executed first. This argument is optional and defaults to `0'. |
625 | |
626 | FALL is `#t' if the hook is a fallthrough hook and `#f' is the |
627 | hook is not a fallthrough hook. This arg is also optional and |
628 | defaults to `#t'. |
629 | |
630 | NAME is the optional name of the hook that defaults to |
631 | `"DEFAULT"'. If you set the name then you can have more than one |
632 | hook that matches the same regexp, as long as they have the same |
633 | name. E.g. in a log script you could have the regexps for the log |
634 | function all be `".*"' and set their names to `"log"' to avoid a |
635 | conflict with other hooks. |
439869bf |
636 | |
637 | \1f |
638 | File: bobot++.info, Node: Hook Types, Prev: Creating a Hook, Up: Hooks |
639 | |
6b59e728 |
640 | 4.2.2 Hook Types |
641 | ---------------- |
439869bf |
642 | |
ae97d6ec |
643 | The following sections document the different hooks Bobot++ exposes. |
644 | |
645 | The general format of each hook description is as if it were a |
646 | function to be defined, but these describe the function to be passwd to |
9efc3706 |
647 | `bot:add-hook'. Do _not_ name your functions these names. |
439869bf |
648 | |
9efc3706 |
649 | That said, here is the list of available hooks functions. FIXME: |
650 | write docs |
439869bf |
651 | |
ae97d6ec |
652 | * Menu: |
653 | |
654 | * Received Message Hooks:: |
655 | * Sent Message Hooks:: |
656 | * DCC CHAT Hooks:: |
657 | * Miscellaneous Hooks:: |
658 | |
659 | \1f |
660 | File: bobot++.info, Node: Received Message Hooks, Next: Sent Message Hooks, Prev: Hook Types, Up: Hook Types |
661 | |
662 | 4.2.2.1 Receieved Message Hooks |
663 | ............................... |
664 | |
665 | The following hooks are triggered when a mesage is received by the bot. |
666 | |
9efc3706 |
667 | -- Function: hooks/action from to action |
ae97d6ec |
668 | This hook is triggered when someone performs an action. |
669 | |
670 | FROM is the nickname the person that performed the action. |
671 | |
672 | TO is the target of the action, which is either a channel or the |
673 | Bot's nick if the user private messages the bot. |
674 | |
675 | ACTION is the text of the action. E.g. if someone did `* foobar |
676 | does baz', then ACTION would be the string `"does baz"'. |
439869bf |
677 | |
9efc3706 |
678 | -- Function: hooks/nickname old-nick new-nick |
ae97d6ec |
679 | This hook is called when someone changes his nickname from |
9efc3706 |
680 | OLD-NICK to NEW-NICK. |
439869bf |
681 | |
ae97d6ec |
682 | -- Function: hooks/signoff nick message |
683 | This hook is called when someone signs off of IRC. |
684 | |
685 | NICK is the nickname of the person signing off. |
686 | |
687 | MESSAGE is his quit message |
439869bf |
688 | |
9efc3706 |
689 | -- Function: hooks/ctcp nick to command rest |
ae97d6ec |
690 | This hook is called when a CTCP request is received by the bot. |
691 | |
692 | NICK is the nickname of the sender. |
693 | |
694 | TO is the target of the CTCP request. This will either be a |
695 | channel the bot is in, or the nickname of the bot. |
696 | |
697 | COMMAND is the CTCP command issued. |
698 | |
699 | REST contains the arguments to the CTCP command. |
439869bf |
700 | |
9efc3706 |
701 | -- Function: hooks/ctcp-reply nick command rest |
ae97d6ec |
702 | This hook is called when a CTCP REPLY is received. This occurs when |
703 | the bot has sent a CTCP request to another client. The CTCP REPLY |
704 | is always addressed to the bot directly. |
439869bf |
705 | |
ae97d6ec |
706 | NICK is the nickname of the person who replied. |
439869bf |
707 | |
ae97d6ec |
708 | COMMAND is the command to which NICK is replying. |
709 | |
710 | REST contains the body of the reply. |
711 | |
712 | -- Function: hooks/disconnect server intentional |
713 | This is called when the bot is disconnected from a server. |
714 | |
715 | SERVER is the hostname of the server from which the bot was |
716 | disconnected. |
717 | |
718 | INTENTIONAL is a flag set to `#t' when the bot disonnected from |
719 | the server as the result of a command (issued by a user from IRC, |
720 | SIGHUP, or from a script), or `#f' when the bot disconnected from |
721 | the server unintentionally.. |
439869bf |
722 | |
9efc3706 |
723 | -- Function: hooks/invite nick channel |
ae97d6ec |
724 | This hook is called when a user invited the bot to join a channel. |
725 | |
726 | NICK is the nickname of the user who sent the invite. |
727 | |
728 | CHANNEL is the channel to which the bot was invited. |
439869bf |
729 | |
9efc3706 |
730 | -- Function: hooks/join nick channel |
ae97d6ec |
731 | This is called when a user or the bot joins a channel. |
732 | |
733 | NICK is the nickname of the user who joined CHANNEL. This may be |
734 | the bot's nickname (the IRC server sends the JOIN command back to |
735 | the the bot after it joins a channel). |
736 | |
737 | CHANNEL is the channel that was joined |
439869bf |
738 | |
9efc3706 |
739 | -- Function: hooks/kick target from channel reason |
ae97d6ec |
740 | This hook is called when a user, including the bot, is kicked out |
741 | of a channel. |
742 | |
743 | TARGET is the nick of the user who was kicked. This may be the |
744 | bot's nick. |
745 | |
746 | FROM is the nick of the user who issued the kick. This may also be |
747 | the bot's nick. |
748 | |
749 | CHANNEL is the channel the kick was issued in. |
750 | |
751 | REASON is the reason the user was kicked. |
439869bf |
752 | |
9efc3706 |
753 | -- Function: hooks/part nick channel |
ae97d6ec |
754 | This hook is called when a user parts a channel. |
755 | |
756 | NICK is the user who parted the channel. This may be the bot. |
757 | |
758 | CHANNEL is the channel from which the user parted. |
759 | |
760 | -- Function: hooks/mode nick target modes |
761 | This hook is called when someone sets the modes of TARGET. |
439869bf |
762 | |
ae97d6ec |
763 | NICK is the user who set the modes. This may be the bot. |
439869bf |
764 | |
ae97d6ec |
765 | TARGET is the target of the MODE command. This may be a channel or |
766 | a user. If it is a user, it may be the bot. |
767 | |
768 | MODES is the MODE string. |
769 | |
770 | -- Function: hooks/message nick message |
771 | This hook is called when someone sends a private message to the |
772 | bot. |
773 | |
774 | NICK is the nickname of the user who sent the message. |
775 | |
776 | MESSAGE is the message the user sent. |
439869bf |
777 | |
9efc3706 |
778 | -- Function: hooks/notice nick message |
ae97d6ec |
779 | This hook is called when a user send a private notice to the bot. |
780 | |
781 | NICK is the user who sent the notice. |
782 | |
783 | MESSAGE is the message the user sent. |
439869bf |
784 | |
ae97d6ec |
785 | -- Function: hooks/public nick channel message |
786 | This hook is called when a user sends a normal message to a |
787 | channel. |
439869bf |
788 | |
ae97d6ec |
789 | NICK is the user who sent the message. |
790 | |
791 | CHANNEL is the channel to which the message was sent. |
792 | |
793 | MESSAGE is the message that was sent. |
794 | |
795 | -- Function: hooks/public-notice nick channel message |
796 | This hook is called when a user send a notice to a channel. |
797 | |
798 | NICK is the user who sent the notice. |
799 | |
800 | CHANNEL is the channel to which the notice was sent. |
801 | |
802 | MESSAGE is the message that was sent. |
439869bf |
803 | |
9efc3706 |
804 | -- Function: hooks/raw raw-message |
ae97d6ec |
805 | This hook is called every time a message is received. This matches |
806 | on the raw message text and passes the hook function the raw IRC |
807 | message. |
439869bf |
808 | |
ae97d6ec |
809 | RAW-MESSAGE is the raw IRC message. |
439869bf |
810 | |
9efc3706 |
811 | -- Function: hooks/topic nick channel new-topic |
ae97d6ec |
812 | This hook is called when a user changes the topic in a channel. |
813 | |
814 | NICK is the user who set the topic. This may be the bot. |
815 | |
816 | CHANNEL is the channel that's topic was changed. |
817 | |
818 | NEW-TOPIC is the new topic. |
819 | |
820 | \1f |
821 | File: bobot++.info, Node: Sent Message Hooks, Next: DCC CHAT Hooks, Prev: Received Message Hooks, Up: Hook Types |
439869bf |
822 | |
ae97d6ec |
823 | 4.2.2.2 Sent Message Hooks |
824 | .......................... |
439869bf |
825 | |
ae97d6ec |
826 | These hooks are called when the bot sends a message. MYNICK is always |
827 | the bot's nick and will not be documented in each hook description. |
828 | |
829 | -- Function: hooks/send/public mynick channel message |
830 | This hook is called when the bot sends a normal message to a |
831 | channel. |
832 | |
833 | CHANNEL is the channel to which the bot sent the message. |
834 | |
835 | MESSAGE is the message the bot sent. |
836 | |
837 | -- Function: hooks/send/message mynick to message |
838 | This hook is called when the bot sends a private message to a user. |
839 | |
840 | TO is the nick of the user to whom the message was sent. |
841 | |
842 | MESSAGE is the message that was sent. |
439869bf |
843 | |
9efc3706 |
844 | -- Function: hooks/send/action mynick to message |
ae97d6ec |
845 | This hook is called when the bot sents an action to a channel or a |
846 | user. |
847 | |
848 | TO is the channel or nick of the user to which the action was sent. |
849 | |
850 | MESSAGE is the text of the action. |
439869bf |
851 | |
9efc3706 |
852 | -- Function: hooks/send/ctcp mynick to command message |
ae97d6ec |
853 | This hook is called when the bot sends a CTCP message _other than_ |
854 | an ACTION to a channel or user. |
855 | |
856 | TO is the channel or nick of the user to which the CTCP was sent. |
857 | |
858 | COMMAND is the CTCP command that was sent. |
859 | |
860 | MESSAGE is a string containing the arguments to the CTCP command. |
861 | |
862 | \1f |
863 | File: bobot++.info, Node: DCC CHAT Hooks, Next: Miscellaneous Hooks, Prev: Sent Message Hooks, Up: Hook Types |
864 | |
865 | 4.2.2.3 DCC CHAT Hooks |
866 | ...................... |
867 | |
868 | These hooks are called when a user initializes a DCC CHAT and when the |
869 | bot receives messages from the user in a DCC CHAT. |
0b7a49e2 |
870 | |
9efc3706 |
871 | -- Function: hooks/dcc/chat-begin from |
ae97d6ec |
872 | This hook is called when a user begins a DCC CHAT with the bot. |
9efc3706 |
873 | FROM is the user's address in the form `nick!user@host'. |
0b7a49e2 |
874 | |
133eff7a |
875 | -- Function: hooks/dcc/chat-end address |
876 | This hook is called when a DCC CHAT is purged after being idle for |
877 | a while, or when the user closes the DCC CHAT. As such, you cannot |
878 | write any more data to the DCC CHAT. |
879 | |
880 | ADDRESS is the address (nick!user@host) of the person on the other |
881 | side of the DCC. |
882 | |
9efc3706 |
883 | -- Function: hooks/dcc/chat-message from message |
ae97d6ec |
884 | This hook is called when a user sends a message to the bot through |
885 | a DCC CHAT. |
886 | |
887 | FROM is the user's address in the form `nick!user@host'. |
888 | |
889 | MESSAGE is the message the user sent to the bot. |
890 | |
891 | \1f |
892 | File: bobot++.info, Node: Miscellaneous Hooks, Prev: DCC CHAT Hooks, Up: Hook Types |
893 | |
894 | 4.2.2.4 Miscellaneous Hooks |
895 | ........................... |
896 | |
897 | -- Function: hooks/flood nick |
898 | This hook is called when a user is detected flooding the bot. |
899 | |
900 | NICK is the nickname of the user flooding the bot. |
901 | |
902 | -- Function: hooks/timer time |
903 | This hook is called once a minute. The regex is *not* used. |
904 | |
905 | TIME is the in zero-padded `hh:mm' format. |
439869bf |
906 | |
e07b6b46 |
907 | \1f |
908 | File: bobot++.info, Node: Scheme User Levels, Next: Sending Messages, Prev: Hooks, Up: Scripting |
909 | |
6b59e728 |
910 | 4.3 Scheme User Levels |
911 | ====================== |
e07b6b46 |
912 | |
5a8b0ec6 |
913 | There are five levels that a user may be when interfacing with a bot: |
e07b6b46 |
914 | NONE, USER, TRUSTED_USER, FRIEND, MASTER. The Scheme variables for the |
915 | user levels are `bot:user-none', `bot:user-user', `bot:user-trusted', |
916 | `bot:user-friend', and `bot:user-master'. See *Note User Levels:: for |
917 | more information on User Levels. |
918 | |
919 | When adding a new command, think about who should be able to use it. |
920 | Is your command a general purpose command that helps the channel (e.g. |
921 | `!seen') that everyone should be able to use? Or is it something that |
922 | should be restricted? See *Note User Levels:: for information on what |
923 | level users can do what with the built in bot commands and think about |
924 | what level a user your command is targetted towards. You must be _very_ |
925 | careful when giving new commands to lower level users because you can |
926 | do basically everything the bot can do with a script. As the scripting |
927 | interface becomes more powerful, you must think more about what users |
928 | can use new commands you add. |
929 | |
930 | \1f |
91dddabd |
931 | File: bobot++.info, Node: Sending Messages, Next: Misc Scripting Stuff, Prev: Scheme User Levels, Up: Scripting |
e07b6b46 |
932 | |
6b59e728 |
933 | 4.4 Sending Messages |
934 | ==================== |
e07b6b46 |
935 | |
5a8b0ec6 |
936 | There are several types of messages you can send with Bobot++ from |
e07b6b46 |
937 | scripts. There is the simple, but rather limited, `bot:say', |
938 | `bot:action' and `bot:msg', and the more powerful, but lower level, |
939 | `bot:send-MESSAGE' functions. Most bots will probably only need the |
940 | higher level functions, but for the sake of why-not Bobot++ lets you |
ce02032f |
941 | use the lower level functions (in progress). |
e07b6b46 |
942 | |
943 | * Menu: |
944 | |
945 | * High Level Message Functions:: |
946 | * Low Level Message Functions:: |
947 | |
948 | \1f |
949 | File: bobot++.info, Node: High Level Message Functions, Next: Low Level Message Functions, Prev: Sending Messages, Up: Sending Messages |
950 | |
6b59e728 |
951 | 4.4.1 "High Level" Message Functions |
952 | ------------------------------------ |
e07b6b46 |
953 | |
9efc3706 |
954 | -- Function: bot:say channel message |
955 | Send a public or private MESSAGE to CHANNEL. |
956 | |
957 | Sends a normal text message, as if a user had typed it in. The |
958 | DEST can be a nickname or a channel. |
959 | |
960 | -- Function: bot:action channel message |
961 | Send an "action" type MESSAGE to CHANNEL |
962 | |
963 | -- Function: bot:msg nick message |
964 | The same as if a user typed `/msg nick message' to their IRC |
965 | client. |
e07b6b46 |
966 | |
5aec4622 |
967 | -- Function: bot:notice target message |
968 | Sends MESSAGE as a NOTICE to TARGET. TARGET may be a user (nick) |
5c73c60a |
969 | or a channel. This returns 0 on success. |
5aec4622 |
970 | |
e07b6b46 |
971 | \1f |
972 | File: bobot++.info, Node: Low Level Message Functions, Prev: High Level Message Functions, Up: Sending Messages |
973 | |
6b59e728 |
974 | 4.4.2 "Low Level" Message Functions |
975 | ----------------------------------- |
e07b6b46 |
976 | |
5a8b0ec6 |
977 | The "Low Level" messaging functions allow you to do things like send |
fed59248 |
978 | CTCP messages. You probably want to read rfc 2812 and the CTCP spec |
e07b6b46 |
979 | before using these. If you have no idea what these do, read rfc 2812 |
980 | (IRC Client Protocol) and CTCP spec. These functions all return |
981 | `*unspecified*' always, so don't use the return value for anything. |
982 | |
672b7d4e |
983 | -- Function: bot:send-ctcp to command message |
4679dc8b |
984 | TO is the target of your CTCP message, COMMAND is the CTCP |
985 | command, and MESSAGE is the message (or arguments) of the command. |
986 | Make sure to `bot:ctcp-quote' the message! |
e07b6b46 |
987 | |
d56bdd22 |
988 | -- Function: bot:send-ctcp-reply to command message |
4679dc8b |
989 | TO is the target of your CTCP reply, COMMAND is the CTCP command, |
990 | and MESSAGE is the message (or arguments) of the command. Make |
991 | sure to `bot:ctcp-quote' the message! |
d56bdd22 |
992 | |
993 | This is used to reply to a ctcp that the bot has received. |
994 | |
91dddabd |
995 | \1f |
996 | File: bobot++.info, Node: Misc Scripting Stuff, Prev: Sending Messages, Up: Scripting |
997 | |
6b59e728 |
998 | 4.5 Misc. Scripting Stuff |
999 | ========================= |
91dddabd |
1000 | |
5a8b0ec6 |
1001 | These are a few useful things that I thought people writing scripts |
91dddabd |
1002 | might want to know. |
1003 | |
1004 | If you want to execute code when the bot exits, just do `add-hook! |
1005 | bot:exit-hook THUNK' where THUNK is an argumentless procedure (a |
1006 | thunk). When the bot exits your thunk will be called. |
1007 | |
4679dc8b |
1008 | [ I didn't know where to put any of these, so I just stuck them in |
9efc3706 |
1009 | here. |
1010 | |
1011 | There probably needs to be several sections added, like dealing |
1012 | with users (kicking, added, etc), dealing with the bot (channels, |
1013 | nickname of the bot, etc), server issues (serverlist), useful |
1014 | tools (nslookup, whois), and do on. ] |
1015 | |
1016 | -- Function: bot:adduser nick-or-mask cbannel-mask level prot auto-op |
1017 | Adds an user to the userlist, for a `nick!user@host' matching the |
1018 | one given, on a channel matching the CHANNELMASK given. |
1019 | |
1020 | The LEVEL can be: The PROT can be: The AUTO-OP can be: |
1021 | 0 - No level 0 - No protection 0 - No auto-op |
1022 | 1 - User 1 - No ban 1 - Op on join |
1023 | 2 - Trusted User 2 - No kick |
1024 | 3 - Friend 3 - No deop |
1025 | 4 - Master |
1026 | |
1027 | |
1028 | -- Function: bot:addserver hostname ip-address [portnumber] |
1029 | Adds the server specified by HOSTNAME or IP-ADDRESS to the server |
1030 | list. |
1031 | |
1032 | -- Function: bot:addshit nick-or-mask channel-mask level [time reason] |
1033 | Adds an user to the shitlist, for a nick!user@host matching the |
1034 | one given, on a channel matching the CHANNELMASK given. |
1035 | |
1036 | The LEVEL can be: |
1037 | 0 - No shit |
1038 | 1 - No op |
1039 | 2 - Kick and Ban on join |
1040 | 3 - Kick and Ban on join, no deban |
1041 | |
1042 | |
1043 | -- Function: bot:ban channel mask-or-nick |
1044 | Bans MASK or NICK from CHANNEL. You need to be a trusted user to |
1045 | ban with a MASK. |
1046 | |
1047 | -- Function: bot:change-command-level nick-or-mask channel-mask |
1048 | new-level |
1049 | Gives NICK or MASK level NEW-LEVEL on channel(s) CHANNEL-MASK. |
1050 | Note that you can not change level for someone whose level is |
1051 | greater than yours, and that you can not give a level greater than |
1052 | yours. |
1053 | |
1054 | -- Function: bot:cycle channel |
1055 | Makes the bot leave and join CHANNEL. |
1056 | |
1057 | -- Function: bot:deban channel mask-or-nick |
1058 | Debans MASK or NICK from CHANNEL. You need to be a trusted user to |
1059 | deban with a MASK. |
1060 | |
1061 | -- Function: bot:delserver server-number |
1062 | Deletes server from server list whose number in the server list is |
1063 | SERVER-NUMBER |
1064 | |
1065 | -- Function: bot:deluser nick-or-mask channel-mask |
1066 | Removes NICK or MASK from the userlist. |
1067 | |
1068 | -- Function: bot:delshit nick-or-mask channel-mask |
1069 | Removes NICK or MASK from the shitlist. |
1070 | |
1071 | -- Function: bot:deop channel mask-or-nick |
1072 | Deops MASK or NICK on CHANNEL. |
1073 | |
1074 | -- Function: bot:die reason |
1075 | Makes the bot stop immediately. |
1076 | |
1077 | -- Function: bot:do ? |
1078 | |
1079 | -- Function: bot:invite channel nick |
1080 | Invites NICK on CHANNEL. |
1081 | |
1082 | -- Function: bot:join channel |
1083 | Makes the bot join CHANNEL. |
1084 | |
1085 | -- Function: bot:keep channel modes |
1086 | Sets the MODES that the bot will keep for CHANNEL. See also STATS. |
1087 | |
1088 | -- Function: bot:kick channel mask-or-nick [reason] |
1089 | Kicks MASK or NICK out of CHANNEL, because of REASON. You need to |
1090 | be a trusted user to use a MASK. |
1091 | |
1092 | -- Function: bot:kickban channel mask-or-nick [reason] |
1093 | Bans then kicks MASK or NICK out of CHANNEL, because of REASON. |
1094 | You need to be a trusted user to use a MASK. |
1095 | |
1096 | -- Function: bot:lock channel |
1097 | Locks topic on CHANNEL. |
1098 | |
1099 | -- Function: bot:logport |
1100 | [ Probably returns the log port? ] |
1101 | |
1102 | -- Function: bot:mode channel mode-string |
1103 | Sends MODE-STRING as mode for CHANNEL. |
1104 | |
1105 | -- Function: bot:nextserver |
1106 | Makes the bot connect to the next server in its server list. |
1107 | |
1108 | -- Function: bot:nick nick |
1109 | Makes the bot use nickname NICK. |
1110 | |
1111 | -- Function: bot:op channel nick |
1112 | Ops NICK on CHANNEL. |
1113 | |
1114 | -- Function: bot:part channel |
1115 | Makes the bot leave CHANNEL. |
1116 | |
1117 | -- Function: bot:reconnect |
1118 | Makes the bot reconnect to its current server. |
1119 | |
1120 | -- Function: bot:server server-number |
1121 | Select the server to connect to. SERVER-NUMBER is the number of |
1122 | the server in the serverlist. |
1123 | |
1124 | -- Function: bot:setfloodrate ? |
1125 | |
1126 | -- Function: bot:setversion ? |
1127 | |
1128 | -- Function: bot:tban channel nick-or-mask time |
1129 | Bans NICK or MASK from CHANNEL for TIME seconds. |
1130 | |
1131 | -- Function: bot:tkban channel nick-or-mask time [reason] |
1132 | Bans NICK or MASK from CHANNEL for TIME seconds, then kicks |
1133 | him/them because of REASON. |
1134 | |
1135 | -- Function: bot:topic channel topic |
1136 | If no TOPIC is given, prints CHANNEL's topic. Otherwise, the bot |
1137 | will change CHANNEL's topic to TOPIC. |
1138 | |
1139 | -- Function: bot:unlock channel |
1140 | Makes the bot unlock topic on CHANNEL. |
1141 | |
1142 | -- Function: bot:getnickname |
1143 | [ Gets the bot's nickname? ] |
1144 | |
1145 | -- Function: bot:getserver |
1146 | |
1147 | -- Function: bot:getserverlist |
1148 | |
1149 | -- Function: bot:flush |
1150 | [ Flushes the socket to the server? ] |
1151 | |
1152 | -- Function: bot:flushport |
1153 | [ Flushes the log port? ] |
1154 | |
1155 | -- Function: bot:random ? |
1156 | [ Returns a random number? What range? Why? ] |
1157 | |
1158 | -- Function: bot:delcommand |
1159 | [ Probably deletes a command added with `bot:addcommand' ? ] |
1160 | |
1161 | -- Function: bot:addtimer ? ? |
1162 | |
1163 | -- Function: bot:deltimer ? |
1164 | |
1165 | -- Function: bot:dcc-chat-send ? ? |
1166 | |
1167 | [ And what about the stuff defined in `bobot-utils.scm' ? I just |
1168 | added it here so it could be somewhere. There should also be a |
1169 | section dealing with modules. How to use them. What module |
1170 | scripts are in. What module bobot++ provided primites are in. |
1171 | And so on. ] |
1172 | |
1173 | -- Function: bot:log . messages |
1174 | Write as many MESSAGES as you want to the log. If the arg is a |
1175 | thunk it will be executed and it's output will be written to the |
1176 | log. |
1177 | |
1178 | -- Function: bot:load file |
1179 | |
1180 | -- Function: bot:load-module module-spec |
1181 | |
1182 | -- Function: bot:use-module module-spec |
1183 | |
1184 | -- Function: bot:match-not-channel regex |
1185 | match-not-channel adds a prefix regex to your REGEX so it doesn't |
1186 | match the sender or channel in a PUBLIC message |
1187 | |
1188 | -- Function: bot:match-to-me regex |
1189 | match-to-me matches text that was addressed to the bot with a ':', |
1190 | ',', or nothing after the bot name. |
1191 | |
1192 | -- Function: bot:sent-to-me? message |
1193 | |
1194 | -- Function: bot:ctcp-quote message |
1195 | Returns the CTCP quoted message Input _MUST NOT_ contain the |
1196 | trailing `\r\n' (it is added by the message sending code). |
1197 | |
1198 | -- Variable: %bot:loadpath |
1199 | |
1200 | -- Function: %bot:load-extensions |
1201 | |
ad529fde |
1202 | \1f |
1203 | File: bobot++.info, Node: Concept Index, Next: Function Index, Prev: Scripting, Up: Top |
1204 | |
1205 | Concept Index |
1206 | ************* |
1207 | |
6b59e728 |
1208 | \0\b[index\0\b] |
ad529fde |
1209 | * Menu: |
e07b6b46 |
1210 | |
6b59e728 |
1211 | * Background on Hooks: Hooks. (line 6) |
e07b6b46 |
1212 | |
ad529fde |
1213 | \1f |
1214 | File: bobot++.info, Node: Function Index, Next: Variable Index, Prev: Concept Index, Up: Top |
1215 | |
1216 | Function Index |
1217 | ************** |
1218 | |
6b59e728 |
1219 | \0\b[index\0\b] |
ad529fde |
1220 | * Menu: |
e07b6b46 |
1221 | |
9efc3706 |
1222 | * %bot:load-extensions: Misc Scripting Stuff. |
1223 | (line 206) |
1224 | * bot:action: High Level Message Functions. |
1225 | (line 13) |
1226 | * bot:addcommand: Adding New Commands. (line 11) |
1227 | * bot:addhook: Creating a Hook. (line 9) |
1228 | * bot:addserver: Misc Scripting Stuff. |
1229 | (line 34) |
1230 | * bot:addshit: Misc Scripting Stuff. |
1231 | (line 38) |
1232 | * bot:addtimer: Misc Scripting Stuff. |
1233 | (line 167) |
1234 | * bot:adduser: Misc Scripting Stuff. |
1235 | (line 22) |
1236 | * bot:ban: Misc Scripting Stuff. |
1237 | (line 49) |
1238 | * bot:change-command-level: Misc Scripting Stuff. |
1239 | (line 54) |
1240 | * bot:ctcp-quote: Misc Scripting Stuff. |
1241 | (line 200) |
1242 | * bot:cycle: Misc Scripting Stuff. |
1243 | (line 60) |
1244 | * bot:dcc-chat-send: Misc Scripting Stuff. |
1245 | (line 171) |
1246 | * bot:deban: Misc Scripting Stuff. |
1247 | (line 63) |
1248 | * bot:delcommand: Misc Scripting Stuff. |
1249 | (line 164) |
1250 | * bot:delserver: Misc Scripting Stuff. |
1251 | (line 67) |
1252 | * bot:delshit: Misc Scripting Stuff. |
1253 | (line 74) |
1254 | * bot:deltimer: Misc Scripting Stuff. |
1255 | (line 169) |
1256 | * bot:deluser: Misc Scripting Stuff. |
1257 | (line 71) |
1258 | * bot:deop: Misc Scripting Stuff. |
1259 | (line 77) |
1260 | * bot:die: Misc Scripting Stuff. |
1261 | (line 80) |
1262 | * bot:do: Misc Scripting Stuff. |
1263 | (line 83) |
1264 | * bot:flush: Misc Scripting Stuff. |
1265 | (line 155) |
1266 | * bot:flushport: Misc Scripting Stuff. |
1267 | (line 158) |
1268 | * bot:getnickname: Misc Scripting Stuff. |
1269 | (line 148) |
1270 | * bot:getserver: Misc Scripting Stuff. |
1271 | (line 151) |
1272 | * bot:getserverlist: Misc Scripting Stuff. |
1273 | (line 153) |
1274 | * bot:invite: Misc Scripting Stuff. |
1275 | (line 85) |
1276 | * bot:join: Misc Scripting Stuff. |
1277 | (line 88) |
1278 | * bot:keep: Misc Scripting Stuff. |
1279 | (line 91) |
1280 | * bot:kick: Misc Scripting Stuff. |
1281 | (line 94) |
1282 | * bot:kickban: Misc Scripting Stuff. |
1283 | (line 98) |
1284 | * bot:load: Misc Scripting Stuff. |
1285 | (line 184) |
1286 | * bot:load-module: Misc Scripting Stuff. |
1287 | (line 186) |
1288 | * bot:lock: Misc Scripting Stuff. |
1289 | (line 102) |
1290 | * bot:log: Misc Scripting Stuff. |
1291 | (line 179) |
1292 | * bot:logport: Misc Scripting Stuff. |
1293 | (line 105) |
1294 | * bot:match-not-channel: Misc Scripting Stuff. |
1295 | (line 190) |
1296 | * bot:match-to-me: Misc Scripting Stuff. |
1297 | (line 194) |
1298 | * bot:mode: Misc Scripting Stuff. |
1299 | (line 108) |
1300 | * bot:msg: High Level Message Functions. |
1301 | (line 16) |
1302 | * bot:nextserver: Misc Scripting Stuff. |
1303 | (line 111) |
1304 | * bot:nick: Misc Scripting Stuff. |
1305 | (line 114) |
5aec4622 |
1306 | * bot:notice: High Level Message Functions. |
1307 | (line 20) |
9efc3706 |
1308 | * bot:op: Misc Scripting Stuff. |
1309 | (line 117) |
1310 | * bot:part: Misc Scripting Stuff. |
1311 | (line 120) |
1312 | * bot:random: Misc Scripting Stuff. |
1313 | (line 161) |
1314 | * bot:reconnect: Misc Scripting Stuff. |
1315 | (line 123) |
1316 | * bot:say: High Level Message Functions. |
1317 | (line 7) |
672b7d4e |
1318 | * bot:send-ctcp: Low Level Message Functions. |
9efc3706 |
1319 | (line 13) |
d56bdd22 |
1320 | * bot:send-ctcp-reply: Low Level Message Functions. |
1321 | (line 18) |
9efc3706 |
1322 | * bot:sent-to-me?: Misc Scripting Stuff. |
1323 | (line 198) |
1324 | * bot:server: Misc Scripting Stuff. |
1325 | (line 126) |
1326 | * bot:setfloodrate: Misc Scripting Stuff. |
1327 | (line 130) |
1328 | * bot:setversion: Misc Scripting Stuff. |
1329 | (line 132) |
1330 | * bot:tban: Misc Scripting Stuff. |
1331 | (line 134) |
1332 | * bot:tkban: Misc Scripting Stuff. |
1333 | (line 137) |
1334 | * bot:topic: Misc Scripting Stuff. |
1335 | (line 141) |
1336 | * bot:unlock: Misc Scripting Stuff. |
1337 | (line 145) |
1338 | * bot:use-module: Misc Scripting Stuff. |
1339 | (line 188) |
ae97d6ec |
1340 | * hooks/action: Received Message Hooks. |
1341 | (line 9) |
1342 | * hooks/ctcp: Received Message Hooks. |
1343 | (line 31) |
1344 | * hooks/ctcp-reply: Received Message Hooks. |
1345 | (line 43) |
1346 | * hooks/dcc/chat-begin: DCC CHAT Hooks. (line 10) |
133eff7a |
1347 | * hooks/dcc/chat-end: DCC CHAT Hooks. (line 14) |
1348 | * hooks/dcc/chat-message: DCC CHAT Hooks. (line 22) |
ae97d6ec |
1349 | * hooks/disconnect: Received Message Hooks. |
1350 | (line 54) |
1351 | * hooks/flood: Miscellaneous Hooks. (line 7) |
1352 | * hooks/invite: Received Message Hooks. |
1353 | (line 65) |
1354 | * hooks/join: Received Message Hooks. |
1355 | (line 72) |
1356 | * hooks/kick: Received Message Hooks. |
1357 | (line 81) |
1358 | * hooks/message: Received Message Hooks. |
1359 | (line 112) |
1360 | * hooks/mode: Received Message Hooks. |
1361 | (line 102) |
1362 | * hooks/nickname: Received Message Hooks. |
1363 | (line 20) |
1364 | * hooks/notice: Received Message Hooks. |
1365 | (line 120) |
1366 | * hooks/part: Received Message Hooks. |
1367 | (line 95) |
1368 | * hooks/public: Received Message Hooks. |
1369 | (line 127) |
1370 | * hooks/public-notice: Received Message Hooks. |
1371 | (line 137) |
1372 | * hooks/raw: Received Message Hooks. |
1373 | (line 146) |
1374 | * hooks/send/action: Sent Message Hooks. (line 25) |
1375 | * hooks/send/ctcp: Sent Message Hooks. (line 33) |
1376 | * hooks/send/message: Sent Message Hooks. (line 18) |
1377 | * hooks/send/public: Sent Message Hooks. (line 10) |
1378 | * hooks/signoff: Received Message Hooks. |
1379 | (line 24) |
1380 | * hooks/timer: Miscellaneous Hooks. (line 12) |
1381 | * hooks/topic: Received Message Hooks. |
1382 | (line 153) |
e07b6b46 |
1383 | |
ad529fde |
1384 | \1f |
1385 | File: bobot++.info, Node: Variable Index, Prev: Function Index, Up: Top |
1386 | |
1387 | Variable Index |
1388 | ************** |
1389 | |
6b59e728 |
1390 | \0\b[index\0\b] |
ad529fde |
1391 | * Menu: |
2e20c3e1 |
1392 | |
9efc3706 |
1393 | * %bot:loadpath: Misc Scripting Stuff. |
1394 | (line 204) |
fed59248 |
1395 | * exit-hook: Misc Scripting Stuff. |
6b59e728 |
1396 | (line 9) |
6b59e728 |
1397 | * user-friend: Scheme User Levels. (line 6) |
1398 | * user-master: Scheme User Levels. (line 6) |
1399 | * user-none: Scheme User Levels. (line 6) |
1400 | * user-trusted: Scheme User Levels. (line 6) |
1401 | * user-user: Scheme User Levels. (line 6) |
e07b6b46 |
1402 | |
1403 | |
2e20c3e1 |
1404 | \1f |
1405 | Tag Table: |
e45daca1 |
1406 | Node: Top\7f538 |
1407 | Node: Introduction\7f1948 |
1408 | Node: Configuration\7f2140 |
1409 | Node: Configuration File Placement\7f2584 |
1410 | Node: Configuration Files\7f3085 |
1411 | Node: bot.conf\7f3278 |
1412 | Node: server syntax\7f4885 |
1413 | Node: channel syntax\7f5683 |
1414 | Node: bot.users\7f6727 |
1415 | Node: Using the Bot\7f7630 |
1416 | Node: Starting the Bot\7f7880 |
1417 | Node: User Levels\7f9389 |
1418 | Node: Protection\7f10777 |
1419 | Node: Automatic Op\7f11495 |
1420 | Node: Built-In Commands\7f11914 |
1421 | Node: Scripting\7f18893 |
1422 | Node: Adding New Commands\7f19965 |
1423 | Node: Hooks\7f21286 |
1424 | Node: Creating a Hook\7f22126 |
1425 | Node: Hook Types\7f23332 |
1426 | Node: Received Message Hooks\7f23896 |
1427 | Node: Sent Message Hooks\7f29123 |
1428 | Node: DCC CHAT Hooks\7f30520 |
1429 | Node: Miscellaneous Hooks\7f31560 |
1430 | Node: Scheme User Levels\7f32009 |
1431 | Node: Sending Messages\7f33143 |
1432 | Node: High Level Message Functions\7f33759 |
1433 | Node: Low Level Message Functions\7f34539 |
1434 | Node: Misc Scripting Stuff\7f35602 |
1435 | Node: Concept Index\7f42178 |
1436 | Node: Function Index\7f42397 |
1437 | Node: Variable Index\7f53633 |
2e20c3e1 |
1438 | \1f |
1439 | End Tag Table |