/[tcldrop]/tcldrop/doc/tcl-commands.txt
ViewVC logotype

Diff of /tcldrop/doc/tcl-commands.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by fireegl, Sun May 18 08:10:51 2003 UTC revision 1.2 by fireegl, Mon May 19 23:00:34 2003 UTC
# Line 1  Line 1 
1  Tcldrop Tcl Commands                              Last revised: April 3, 2003.  Tcldrop Tcl Commands                              Last revised: April 3, 2003.
2       _________________________________________________________________       _________________________________________________________________
3    
4  This is an exhaustive list of all the Tcl commands added to Tcldrop.  This is an exhaustive list of all the Tcl commands added to Tcldrop.
5  All of the normal Tcl built-in commands are still there, of course,  All of the normal Tcl built-in commands are still there, of course,
6  but you can also use these to manipulate features of the bot.  but you can also use these to manipulate features of the bot.
7  They are listed according to category.  They are listed according to category.
8    
9  This list is accurate for Tcldrop v0.2.0.  This list is accurate for Tcldrop v0.2.0.
10    
11  Note, Tcldrop will be focused on being compatible with scripts  Note, Tcldrop will be focused on being compatible with scripts
12  made for Eggdrop v1.6.x, but will also try to be compatible with  made for Eggdrop v1.6.x, but will also try to be compatible with
13  scripts made for older and newer versions of Eggdrop where possible.  scripts made for older and newer versions of Eggdrop where possible.
14    
15  NOTICE: If a command/bind/variable is begins with a #  NOTICE: If a command/bind/variable is begins with a #
16          then it probably hasn't been implemented yet.          then it probably hasn't been implemented yet.
17    
18  All commands should work like they would in Eggdrop,  All commands should work like they would in Eggdrop,
19  although some may take additional (optional) arguments beyond Eggdrop.  although some may take additional (optional) arguments beyond Eggdrop.
20  The optional arguments will be documented here (when they're generally useful).  The optional arguments will be documented here (when they're generally useful).
21    
22    
23    
24  *** OUTPUT COMMANDS ***  *** OUTPUT COMMANDS ***
25    
26    putserv <text> [options]    putserv <text> [options]
27      Description: sends text to the server, like '.dump' (intended for direct      Description: sends text to the server, like '.dump' (intended for direct
28        server commands); output is queued so that the bot won't flood itself        server commands); output is queued so that the bot won't flood itself
29        off the server.        off the server.
30      Options:      Options:
31        -next:   push messages to the front of the queue        -next:   push messages to the front of the queue
32        -normal: no effect        -normal: no effect
33      Returns: nothing      Returns: nothing
34      Module: server      Module: server
35    
36    puthelp <text> [options]    puthelp <text> [options]
37      Description: sends text to the server, like 'putserv', but it uses a      Description: sends text to the server, like 'putserv', but it uses a
38        different queue intended for sending messages to channels or people.        different queue intended for sending messages to channels or people.
39      Options:      Options:
40        -next:   push messages to the front of the queue        -next:   push messages to the front of the queue
41        -normal: no effect        -normal: no effect
42      Returns: nothing      Returns: nothing
43      Module: server      Module: server
44    
45    putquick <text> [options]    putquick <text> [options]
46      Description: sends text to the server, like 'putserv', but it uses a      Description: sends text to the server, like 'putserv', but it uses a
47        different (and faster) queue.        different (and faster) queue.
48      Options:      Options:
49        -next:   push messages to the front of the queue        -next:   push messages to the front of the queue
50        -normal: no effect        -normal: no effect
51      Returns: nothing      Returns: nothing
52      Module: server      Module: server
53    
54    putlog <text>    putlog <text>
55      Description: sends text to the bot's logfile, marked as 'misc' (o)      Description: sends text to the bot's logfile, marked as 'misc' (o)
56      Returns: nothing      Returns: nothing
57      Module: core      Module: core
58    
59    putcmdlog <text>    putcmdlog <text>
60      Description: sends text to the bot's logfile, marked as 'command' (c)      Description: sends text to the bot's logfile, marked as 'command' (c)
61      Returns: nothing      Returns: nothing
62      Module: core      Module: core
63    
64    putxferlog <text>    putxferlog <text>
65      Description: sends text to the bot's logfile, marked as 'file-area' (x)      Description: sends text to the bot's logfile, marked as 'file-area' (x)
66      Returns: nothing      Returns: nothing
67      Module: core      Module: core
68    
69    putloglev <level(s)> <channel> <text>    putloglev <level(s)> <channel> <text>
70      Description: sends text to the bot's logfile, tagged with all of the      Description: sends text to the bot's logfile, tagged with all of the
71        valid levels given. Use "*" to indicate all log levels.        valid levels given. Use "*" to indicate all log levels.
72      Returns: nothing      Returns: nothing
73      Module: core      Module: core
74    
75  # dumpfile <nick> <filename>  # dumpfile <nick> <filename>
76  #   Description: dumps file from the help/text directory to a user on IRC via  #   Description: dumps file from the help/text directory to a user on IRC via
77  #     msg (one line per msg). The user has no flags, so the flag bindings  #     msg (one line per msg). The user has no flags, so the flag bindings
78  #     won't work within the file.  #     won't work within the file.
79  #   Returns: nothing  #   Returns: nothing
80  #   Module: core  #   Module: core
81    
82    queuesize [queue]    queuesize [queue]
83      Returns: the number of messages in all queues. If a queue is specified,      Returns: the number of messages in all queues. If a queue is specified,
84        only the size of this queue is returned. Valid queues are: mode,        only the size of this queue is returned. Valid queues are: mode,
85        server, help.        server, help.
86      Module: server      Module: server
87    
88    clearqueue <queue>    clearqueue <queue>
89      Description: removes all messages from a queue. Valid arguments are:      Description: removes all messages from a queue. Valid arguments are:
90        mode, server, help, or all.        mode, server, help, or all.
91      Returns: the number of deleted lines from the specified queue.      Returns: the number of deleted lines from the specified queue.
92      Module: server      Module: server
93    
94    
95  *** USER RECORD MANIPULATION COMMANDS ***  *** USER RECORD MANIPULATION COMMANDS ***
96    
97    countusers    countusers
98      Returns: number of users in the bot's database      Returns: number of users in the bot's database
99      Module: core      Module: core
100    
101    validuser <handle>    validuser <handle>
102      Returns: 1 if a user by that name exists; 0 otherwise      Returns: 1 if a user by that name exists; 0 otherwise
103      Module: core      Module: core
104    
105    finduser <nick!user@host>    finduser <nick!user@host>
106      Description: finds the user record which most closely matches the given      Description: finds the user record which most closely matches the given
107        nick!user@host        nick!user@host
108      Returns: the handle found, or "*" if none      Returns: the handle found, or "*" if none
109      Module: core      Module: core
110    
111    userlist [flags]    userlist [flags]
112      Returns: a list of users on the bot. You can use the flag matching      Returns: a list of users on the bot. You can use the flag matching
113        system here ([global]{&/|}[chan]{&/|}[bot]). '&' specifies "and";        system here ([global]{&/|}[chan]{&/|}[bot]). '&' specifies "and";
114        '|' specifies "or".        '|' specifies "or".
115      Module: core      Module: core
116    
117    passwdok <handle> <pass>    passwdok <handle> <pass>
118      Description: checks the password given against the user's password.      Description: checks the password given against the user's password.
119        Check against the password "" (a blank string) or "-" to find out        Check against the password "" (a blank string) or "-" to find out
120        if a user has no password set.        if a user has no password set.
121      Returns: 1 if the password matches for that user; 0 otherwise      Returns: 1 if the password matches for that user; 0 otherwise
122      Module: core      Module: core
123    
124    getuser <handle> <entry-type> [extra info]    getuser <handle> <entry-type> [extra info]
125      Description: an interface to the new generic userfile support. Valid      Description: an interface to the new generic userfile support. Valid
126        entry types are:        entry types are:
127          BOTFL   - returns the current bot-specific flags for the user          BOTFL   - returns the current bot-specific flags for the user
128                    (bot-only)                    (bot-only)
129          BOTADDR - returns a list containing the bot's address, telnet port,          BOTADDR - returns a list containing the bot's address, telnet port,
130                    and relay port (bot-only)                    and relay port (bot-only)
131          HOSTS   - returns a list of hosts for the user          HOSTS   - returns a list of hosts for the user
132          LASTON  - returns a list containing the unixtime last seen and the          LASTON  - returns a list containing the unixtime last seen and the
133                    last seen place. LASTON #channel returns the time last                    last seen place. LASTON #channel returns the time last
134                    seen time for the channel or 0 if no info exists.                    seen time for the channel or 0 if no info exists.
135          INFO    - returns the user's global info line          INFO    - returns the user's global info line
136          XTRA    - returns the user's XTRA info          XTRA    - returns the user's XTRA info
137          COMMENT - returns the master-visible only comment for the user          COMMENT - returns the master-visible only comment for the user
138          EMAIL   - returns the user's e-mail address          EMAIL   - returns the user's e-mail address
139          URL     - returns the user's url          URL     - returns the user's url
140          HANDLE  - returns the user's handle as it is saved in the userfile          HANDLE  - returns the user's handle as it is saved in the userfile
141          PASS    - returns the user's encrypted password          PASS    - returns the user's encrypted password
142      Returns: info specific to each entry-type      Returns: info specific to each entry-type
143      Module: core      Module: core
144    
145    setuser <handle> <entry-type> [extra info]    setuser <handle> <entry-type> [extra info]
146      Description: this is the counterpart of getuser. It lets you set the      Description: this is the counterpart of getuser. It lets you set the
147        various values. Other then the ones listed below, the entry-types are        various values. Other then the ones listed below, the entry-types are
148        the same as getuser's.        the same as getuser's.
149          PASS    - sets a users password (no third arg will clear it)          PASS    - sets a users password (no third arg will clear it)
150          HOSTS   - if used with no third arg, all hosts for the user will be          HOSTS   - if used with no third arg, all hosts for the user will be
151                    be cleared. Otherwise, *1* hostmask is added :P                    be cleared. Otherwise, *1* hostmask is added :P
152          LASTON  - This setting has 3 forms. "setuser <handle> LASTON          LASTON  - This setting has 3 forms. "setuser <handle> LASTON
153                    <unixtime> <place>" sets global LASTON time, "setuser                    <unixtime> <place>" sets global LASTON time, "setuser
154                    <handle> LASTON <unixtime>" sets global LASTON time                    <handle> LASTON <unixtime>" sets global LASTON time
155                    (leaving the place field empty), and "setuser <handle>                    (leaving the place field empty), and "setuser <handle>
156                    LASTON <unixtime> <channel>" sets a users LASTON time for                    LASTON <unixtime> <channel>" sets a users LASTON time for
157                    a channel (if it is a  valid channel).                    a channel (if it is a  valid channel).
158      Returns: nothing      Returns: nothing
159      Module: core      Module: core
160    
161  #  chhandle <old-handle> <new-handle>  #  chhandle <old-handle> <new-handle>
162  #    Description: changes a user's handle  #    Description: changes a user's handle
163  #    Returns: 1 on success; 0 if the new handle is invalid or already used,  #    Returns: 1 on success; 0 if the new handle is invalid or already used,
164  #      or if the user can't be found  #      or if the user can't be found
165  #    Module: core  #    Module: core
166    
167  #  chattr <handle> [changes [channel]]  #  chattr <handle> [changes [channel]]
168  #    Description: changes the attributes for a user record, if you include any.  #    Description: changes the attributes for a user record, if you include any.
169  #      Changes are of the form '+f', '-o', '+dk', '-o+d', etc. If changes are  #      Changes are of the form '+f', '-o', '+dk', '-o+d', etc. If changes are
170  #      specified in the format of |<changes> <channel>, the channel-specific  #      specified in the format of |<changes> <channel>, the channel-specific
171  #      flags for that channel are altered. You can now use the +o|-o #channel  #      flags for that channel are altered. You can now use the +o|-o #channel
172  #      format here too.  #      format here too.
173  #    Returns: new flags for the user (if you made no changes, the current  #    Returns: new flags for the user (if you made no changes, the current
174  #      flags are returned). If a channel was specified, the global AND the  #      flags are returned). If a channel was specified, the global AND the
175  #      channel-specific flags for that channel are returned in the format of  #      channel-specific flags for that channel are returned in the format of
176  #      globalflags|channelflags. "*" is returned if the specified user does  #      globalflags|channelflags. "*" is returned if the specified user does
177  #      not exist.  #      not exist.
178  #    Module: core  #    Module: core
179    
180  #  botattr <handle> [changes [channel]]  #  botattr <handle> [changes [channel]]
181  #    Description: similar to chattr except this modifies bot flags rather  #    Description: similar to chattr except this modifies bot flags rather
182  #      than normal user attributes.  #      than normal user attributes.
183  #    Returns: new flags for the bot (if you made no changes, the current  #    Returns: new flags for the bot (if you made no changes, the current
184  #      flags are returned). If a channel was specified, the global AND the  #      flags are returned). If a channel was specified, the global AND the
185  #      channel-specific flags for that channel are returned in the format of  #      channel-specific flags for that channel are returned in the format of
186  #      globalflags|channelflags. "*" is returned if the specified bot does  #      globalflags|channelflags. "*" is returned if the specified bot does
187  #      not exist.  #      not exist.
188  #    Module: core  #    Module: core
189    
190    matchattr <handle> <flags> [channel]    matchattr <handle> <flags> [channel]
191      Returns: 1 if the specified user has the specified flags; 0 otherwise      Returns: 1 if the specified user has the specified flags; 0 otherwise
192      Module: core      Module: core
193    
194    adduser <handle> [hostmask]    adduser <handle> [hostmask]
195      Description: creates a new user entry with the handle and hostmask given      Description: creates a new user entry with the handle and hostmask given
196        (with no password and the default flags)        (with no password and the default flags)
197      Returns: 1 if successful; 0 if the handle already exists      Returns: 1 if successful; 0 if the handle already exists
198      Module: core      Module: core
199    
200    addbot <handle> <address>    addbot <handle> <address>
201      Description: adds a new bot to the userlist with the handle and bot      Description: adds a new bot to the userlist with the handle and bot
202        address given (with no password and no flags)        address given (with no password and no flags)
203      Returns: 1 if successful; 0 if the bot already exists      Returns: 1 if successful; 0 if the bot already exists
204      Module: core      Module: core
205    
206    deluser <handle>    deluser <handle>
207      Description: attempts to erase the user record for a handle      Description: attempts to erase the user record for a handle
208      Returns: 1 if successful, 0 if no such user exists      Returns: 1 if successful, 0 if no such user exists
209      Module: core      Module: core
210    
211    delhost <handle> <hostmask>    delhost <handle> <hostmask>
212      Description: deletes a hostmask from a user's host list      Description: deletes a hostmask from a user's host list
213      Returns: 1 on success; 0 if the hostmask (or user) doesn't exist      Returns: 1 on success; 0 if the hostmask (or user) doesn't exist
214      Module: core      Module: core
215    
216    addchanrec <handle> <channel>    addchanrec <handle> <channel>
217      Description: adds a channel record for a user      Description: adds a channel record for a user
218      Returns: 1 on success; 0 if the user or channel does not exist      Returns: 1 on success; 0 if the user or channel does not exist
219      Module: channels      Module: channels
220    
221  #  delchanrec <handle> <channel>  #  delchanrec <handle> <channel>
222  #    Description: removes a channel record for a user. This includes all  #    Description: removes a channel record for a user. This includes all
223  #      associated channel flags.  #      associated channel flags.
224  #    Returns: 1 on success; 0 if the user or channel does not exist  #    Returns: 1 on success; 0 if the user or channel does not exist
225  #    Module: channels  #    Module: channels
226    
227  # haschanrec <handle> <channel>  # haschanrec <handle> <channel>
228  #    Returns: 1 if the given handle has a chanrec for the specified channel;  #    Returns: 1 if the given handle has a chanrec for the specified channel;
229  #      0 otherwise  #      0 otherwise
230  #    Module: channels  #    Module: channels
231    
232    getchaninfo <handle> <channel>    getchaninfo <handle> <channel>
233      Returns: info line for a specific channel (behaves just like 'getinfo')      Returns: info line for a specific channel (behaves just like 'getinfo')
234      Module: channels      Module: channels
235    
236    setchaninfo <handle> <channel> <info>    setchaninfo <handle> <channel> <info>
237     Description: sets the info line on a specific channel for a user. If     Description: sets the info line on a specific channel for a user. If
238       info is "none", it will be removed.       info is "none", it will be removed.
239     Returns: nothing     Returns: nothing
240     Module: channels     Module: channels
241    
242  #  newchanban <channel> <ban> <creator> <comment> [lifetime] [options]  #  newchanban <channel> <ban> <creator> <comment> [lifetime] [options]
243  #    Description: adds a ban to the ban list of a channel; creator is given  #    Description: adds a ban to the ban list of a channel; creator is given
244  #      credit for the ban in the ban list. lifetime is specified in  #      credit for the ban in the ban list. lifetime is specified in
245  #      minutes. If lifetime is not specified, ban-time (usually 60) is  #      minutes. If lifetime is not specified, ban-time (usually 60) is
246  #      used. Setting the lifetime to 0 makes it a permanent ban.  #      used. Setting the lifetime to 0 makes it a permanent ban.
247  #    Options:  #    Options:
248  #      sticky: forces the ban to be always active on a channel, even  #      sticky: forces the ban to be always active on a channel, even
249  #              with dynamicbans on  #              with dynamicbans on
250  #      none:   no effect  #      none:   no effect
251  #    Returns: nothing  #    Returns: nothing
252  #    Module: channels  #    Module: channels
253    
254  #  newban <ban> <creator> <comment> [lifetime] [options]  #  newban <ban> <creator> <comment> [lifetime] [options]
255  #    Description: adds a ban to the global ban list (which takes effect on  #    Description: adds a ban to the global ban list (which takes effect on
256  #      all channels); creator is given credit for the ban in the ban list.  #      all channels); creator is given credit for the ban in the ban list.
257  #      lifetime is specified in minutes. If lifetime is not specified,  #      lifetime is specified in minutes. If lifetime is not specified,
258  #      global-ban-time (usually 60) is used. Setting the lifetime to 0 makes  #      global-ban-time (usually 60) is used. Setting the lifetime to 0 makes
259  #      it a permanent ban.  #      it a permanent ban.
260  #    Options:  #    Options:
261  #      sticky: forces the ban to be always active on a channel, even  #      sticky: forces the ban to be always active on a channel, even
262  #              with dynamicbans on  #              with dynamicbans on
263  #      none:   no effect  #      none:   no effect
264  #    Returns: nothing  #    Returns: nothing
265  #    Module: channels  #    Module: channels
266    
267  #  newchanexempt <channel> <exempt> <creator> <comment> [lifetime] [options]  #  newchanexempt <channel> <exempt> <creator> <comment> [lifetime] [options]
268  #    Description: adds a exempt to the exempt list of a channel; creator is  #    Description: adds a exempt to the exempt list of a channel; creator is
269  #      given credit for the exempt in the exempt list. lifetime is specified  #      given credit for the exempt in the exempt list. lifetime is specified
270  #      in minutes. If lifetime is not specified, exempt-time (usually 60) is  #      in minutes. If lifetime is not specified, exempt-time (usually 60) is
271  #      used. Setting the lifetime to 0 makes it a permanent exempt. The exempt  #      used. Setting the lifetime to 0 makes it a permanent exempt. The exempt
272  #      will not be removed until the corresponding ban has been removed. For  #      will not be removed until the corresponding ban has been removed. For
273  #      timed bans, once the time period has expired, the exempt will not be  #      timed bans, once the time period has expired, the exempt will not be
274  #      removed until the corresponding ban has either expired or been removed.  #      removed until the corresponding ban has either expired or been removed.
275  #    Options:  #    Options:
276  #      sticky: forces the exempt to be always active on a channel, even  #      sticky: forces the exempt to be always active on a channel, even
277  #              with dynamicexempts on  #              with dynamicexempts on
278  #      none:   no effect  #      none:   no effect
279  #    Returns: nothing  #    Returns: nothing
280  #    Module: channels  #    Module: channels
281    
282  #  newexempt <exempt> <creator> <comment> [lifetime] [options]  #  newexempt <exempt> <creator> <comment> [lifetime] [options]
283  #    Description: adds a exempt to the global exempt list (which takes effect  #    Description: adds a exempt to the global exempt list (which takes effect
284  #      on all channels); creator is given credit for the exempt in the exempt  #      on all channels); creator is given credit for the exempt in the exempt
285  #      list. lifetime is specified in minutes. If lifetime is not specified,  #      list. lifetime is specified in minutes. If lifetime is not specified,
286  #      exempt-time (usually 60) is used. Setting the lifetime to 0 makes it a  #      exempt-time (usually 60) is used. Setting the lifetime to 0 makes it a
287  #      permanent exempt. The exempt will not be removed until the  #      permanent exempt. The exempt will not be removed until the
288  #      corresponding ban has been removed.  #      corresponding ban has been removed.
289  #    Options:  #    Options:
290  #      sticky: forces the exempt to be always active on a channel, even  #      sticky: forces the exempt to be always active on a channel, even
291  #              with dynamicexempts on  #              with dynamicexempts on
292  #      none:   no effect  #      none:   no effect
293  #    Returns: nothing  #    Returns: nothing
294  #    Module: channels  #    Module: channels
295    
296  #  newchaninvite <channel> <invite> <creator> <comment> [lifetime] [options]  #  newchaninvite <channel> <invite> <creator> <comment> [lifetime] [options]
297  #    Description: adds a invite to the invite list of a channel; creator is  #    Description: adds a invite to the invite list of a channel; creator is
298  #      given credit for the invite in the invite list. lifetime is specified  #      given credit for the invite in the invite list. lifetime is specified
299  #      in minutes. If lifetime is not specified, invite-time (usually 60) is  #      in minutes. If lifetime is not specified, invite-time (usually 60) is
300  #      used. Setting the lifetime to 0 makes it a permanent invite. The invite  #      used. Setting the lifetime to 0 makes it a permanent invite. The invite
301  #      will not be removed until the channel has gone -i.  #      will not be removed until the channel has gone -i.
302  #    Options:  #    Options:
303  #      sticky: forces the invite to be always active on a channel, even  #      sticky: forces the invite to be always active on a channel, even
304  #              with dynamicinvites on  #              with dynamicinvites on
305  #      none:   no effect  #      none:   no effect
306  #    Returns: nothing  #    Returns: nothing
307  #    Module: channels  #    Module: channels
308    
309  #  newinvite <invite> <creator> <comment> [lifetime] [options]  #  newinvite <invite> <creator> <comment> [lifetime] [options]
310  #    Description: adds a invite to the global invite list (which takes effect  #    Description: adds a invite to the global invite list (which takes effect
311  #      on all channels); creator is given credit for the invite in the invite  #      on all channels); creator is given credit for the invite in the invite
312  #      list. lifetime is specified in minutes. If lifetime is not specified,  #      list. lifetime is specified in minutes. If lifetime is not specified,
313  #      invite-time (usually 60) is used. Setting the lifetime to 0 makes it  #      invite-time (usually 60) is used. Setting the lifetime to 0 makes it
314  #      a permanent invite. The invite will not be removed until the channel  #      a permanent invite. The invite will not be removed until the channel
315  #      has gone -i.  #      has gone -i.
316  #    Options:  #    Options:
317  #      sticky: forces the invite to be always active on a channel, even  #      sticky: forces the invite to be always active on a channel, even
318  #              with dynamicinvites on  #              with dynamicinvites on
319  #      none:   no effect  #      none:   no effect
320  #    Returns: nothing  #    Returns: nothing
321  #    Module: channels  #    Module: channels
322    
323  #  stick <banmask> [channel]  #  stick <banmask> [channel]
324  #    Description: makes a ban sticky, or, if a channel is specified, then it  #    Description: makes a ban sticky, or, if a channel is specified, then it
325  #      is set sticky on that channel only.  #      is set sticky on that channel only.
326  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
327  #    Module: channels  #    Module: channels
328  #  #
329  #  unstick <banmask> [channel]  #  unstick <banmask> [channel]
330  #    Description: makes a ban no longer sticky, or, if a channel is  #    Description: makes a ban no longer sticky, or, if a channel is
331  #      specified, then it is unstuck on that channel only.  #      specified, then it is unstuck on that channel only.
332  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
333  #    Module: channels  #    Module: channels
334    
335  #  stickexempt <exemptmask> [channel]  #  stickexempt <exemptmask> [channel]
336  #    Description: makes an exempt sticky, or, if a channel is specified,  #    Description: makes an exempt sticky, or, if a channel is specified,
337  #      then it is set sticky on that channel only.  #      then it is set sticky on that channel only.
338  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
339  #    Module: channels  #    Module: channels
340    
341  #  unstickexempt <exemptmask> [channel]  #  unstickexempt <exemptmask> [channel]
342  #    Description: makes an exempt no longer sticky, or, if a channel is  #    Description: makes an exempt no longer sticky, or, if a channel is
343  #      specified, then it is unstuck on that channel only.  #      specified, then it is unstuck on that channel only.
344  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
345  #    Module: channels  #    Module: channels
346    
347  #  stickinvite <invitemask> [channel]  #  stickinvite <invitemask> [channel]
348  #    Description: makes an invite sticky, or, if a channel is specified,  #    Description: makes an invite sticky, or, if a channel is specified,
349  #      then it is set sticky on that channel only.  #      then it is set sticky on that channel only.
350  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
351  #    Module: channels  #    Module: channels
352    
353  #  unstickinvite <invitemask> [channel]  #  unstickinvite <invitemask> [channel]
354  #    Description: makes an invite no longer sticky, or, if a channel is  #    Description: makes an invite no longer sticky, or, if a channel is
355  #      specified, then it is unstuck on that channel only.  #      specified, then it is unstuck on that channel only.
356  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
357  #    Module: channels  #    Module: channels
358    
359  #  killchanban <channel> <ban>  #  killchanban <channel> <ban>
360  #    Description: removes a ban from the ban list for a channel  #    Description: removes a ban from the ban list for a channel
361  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
362  #    Module: channels  #    Module: channels
363    
364  #  killban <ban>  #  killban <ban>
365  #    Description: removes a ban from the global ban list  #    Description: removes a ban from the global ban list
366  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
367  #    Module: channels  #    Module: channels
368    
369  #  killchanexempt <channel> <exempt>  #  killchanexempt <channel> <exempt>
370  #    Description: removes an exempt from the exempt list for a channel  #    Description: removes an exempt from the exempt list for a channel
371  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
372  #    Module: channels  #    Module: channels
373    
374  #  killexempt <exempt>  #  killexempt <exempt>
375  #    Description: removes an exempt from the global exempt list  #    Description: removes an exempt from the global exempt list
376  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
377  #    Module: channels  #    Module: channels
378    
379  #  killchaninvite <channel> <invite>  #  killchaninvite <channel> <invite>
380  #    Description: removes an invite from the invite list for a channel  #    Description: removes an invite from the invite list for a channel
381  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
382  #    Module: channels  #    Module: channels
383    
384  #  killinvite <invite>  #  killinvite <invite>
385  #    Description: removes an invite from the global invite list  #    Description: removes an invite from the global invite list
386  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
387  #    Module: channels  #    Module: channels
388    
389  #  ischanjuped <channel>  #  ischanjuped <channel>
390  #    Returns: 1 if the channel is juped, and the bot is unable to join; 0  #    Returns: 1 if the channel is juped, and the bot is unable to join; 0
391  #      otherwise  #      otherwise
392  #    Module: channels  #    Module: channels
393    
394  #  isban <ban> [channel]  #  isban <ban> [channel]
395  #    Returns: 1 if the specified ban is in the global ban list; 0 otherwise.  #    Returns: 1 if the specified ban is in the global ban list; 0 otherwise.
396  #      If a channel is specified, that channel's ban list is checked as well.  #      If a channel is specified, that channel's ban list is checked as well.
397  #    Module: channels  #    Module: channels
398    
399  #  ispermban <ban> [channel]  #  ispermban <ban> [channel]
400  #    Returns: 1 if the specified ban is in the global ban list AND is marked  #    Returns: 1 if the specified ban is in the global ban list AND is marked
401  #      as permanent; 0 otherwise. If a channel is specified, that channel's  #      as permanent; 0 otherwise. If a channel is specified, that channel's
402  #      ban list is checked as well.  #      ban list is checked as well.
403  #    Module: channels  #    Module: channels
404    
405  #  isexempt <exempt> [channel]  #  isexempt <exempt> [channel]
406  #    Returns: 1 if the specified exempt is in the global exempt list; 0  #    Returns: 1 if the specified exempt is in the global exempt list; 0
407  #      otherwise. If a channel is specified, that channel's exempt list is  #      otherwise. If a channel is specified, that channel's exempt list is
408  #      checked as well.  #      checked as well.
409  #    Module: channels  #    Module: channels
410    
411  #  ispermexempt <exempt> [channel]  #  ispermexempt <exempt> [channel]
412  #    Returns: 1 if the specified exempt is in the global exempt list AND is  #    Returns: 1 if the specified exempt is in the global exempt list AND is
413  #      marked as permanent; 0 otherwise. If a channel is specified, that  #      marked as permanent; 0 otherwise. If a channel is specified, that
414  #      channel's exempt list is checked as well.  #      channel's exempt list is checked as well.
415  #    Module: channels  #    Module: channels
416    
417  #  isinvite <invite> [channel]  #  isinvite <invite> [channel]
418  #    Returns: 1 if the specified invite is in the global invite list; 0  #    Returns: 1 if the specified invite is in the global invite list; 0
419  #      otherwise. If a channel is specified, that channel's invite list is  #      otherwise. If a channel is specified, that channel's invite list is
420  #      checked as well.  #      checked as well.
421  #    Module: channels  #    Module: channels
422    
423  #  isperminvite <invite> [channel]  #  isperminvite <invite> [channel]
424  #    Returns: 1 if the specified invite is in the global invite list AND is  #    Returns: 1 if the specified invite is in the global invite list AND is
425  #      marked as permanent; 0 otherwise. If a channel is specified, that  #      marked as permanent; 0 otherwise. If a channel is specified, that
426  #      channel's invite list is checked as well.  #      channel's invite list is checked as well.
427  #    Module: channels  #    Module: channels
428    
429  #  isbansticky <ban> [channel]  #  isbansticky <ban> [channel]
430  #    Returns: 1 if the specified ban is marked as sticky in the global ban  #    Returns: 1 if the specified ban is marked as sticky in the global ban
431  #      list; 0 otherwise. If a channel is specified, that channel's ban list  #      list; 0 otherwise. If a channel is specified, that channel's ban list
432  #      is checked as well.  #      is checked as well.
433  #    Module: channels  #    Module: channels
434    
435  #  isexemptsticky <exempt> [channel]  #  isexemptsticky <exempt> [channel]
436  #    Returns: 1 if the specified exempt is marked as sticky in the global  #    Returns: 1 if the specified exempt is marked as sticky in the global
437  #      exempt list; 0 otherwise. If a channel is specified, that channel's  #      exempt list; 0 otherwise. If a channel is specified, that channel's
438  #      exempt list is checked as well.  #      exempt list is checked as well.
439  #    Module: channels  #    Module: channels
440    
441  #  isinvitesticky <invite> [channel]  #  isinvitesticky <invite> [channel]
442  #    Returns: 1 if the specified invite is marked as sticky in the global  #    Returns: 1 if the specified invite is marked as sticky in the global
443  #      invite list; 0 otherwise. If a channel is specified, that channel's  #      invite list; 0 otherwise. If a channel is specified, that channel's
444  #      invite list is checked as well.  #      invite list is checked as well.
445  #    Module: channels  #    Module: channels
446    
447  #  matchban <nick!user@host> [channel]  #  matchban <nick!user@host> [channel]
448  #    Returns: 1 if the specified nick!user@host matches a ban in the global  #    Returns: 1 if the specified nick!user@host matches a ban in the global
449  #      ban list; 0 otherwise. If a channel is specified, that channel's ban  #      ban list; 0 otherwise. If a channel is specified, that channel's ban
450  #      list is checked as well.  #      list is checked as well.
451  #    Module: channels  #    Module: channels
452    
453  #  matchexempt <nick!user@host> [channel]  #  matchexempt <nick!user@host> [channel]
454  #    Returns: 1 if the specified nick!user@host matches an exempt in the  #    Returns: 1 if the specified nick!user@host matches an exempt in the
455  #      global exempt list; 0 otherwise. If a channel is specified, that  #      global exempt list; 0 otherwise. If a channel is specified, that
456  #      channel's exempt list is checked as well.  #      channel's exempt list is checked as well.
457  #    Module: channels  #    Module: channels
458    
459  #  matchinvite <nick!user@host> [channel]  #  matchinvite <nick!user@host> [channel]
460  #    Returns: 1 if the specified nick!user@host matches an invite in the  #    Returns: 1 if the specified nick!user@host matches an invite in the
461  #      global invite list; 0 otherwise. If a channel is specified, that  #      global invite list; 0 otherwise. If a channel is specified, that
462  #      channel's invite list is checked as well.  #      channel's invite list is checked as well.
463  #    Module: channels  #    Module: channels
464    
465  #  banlist [channel]  #  banlist [channel]
466  #    Returns: a list of global bans, or, if a channel is specified, a  #    Returns: a list of global bans, or, if a channel is specified, a
467  #      list of channel-specific bans. Each entry is a sublist containing:  #      list of channel-specific bans. Each entry is a sublist containing:
468  #      hostmask, comment, expiration timestamp, time added, last time  #      hostmask, comment, expiration timestamp, time added, last time
469  #      active, and creator. The three timestamps are in unixtime format.  #      active, and creator. The three timestamps are in unixtime format.
470  #    Module: channels  #    Module: channels
471    
472  #  exemptlist [channel]  #  exemptlist [channel]
473  #    Returns: a list of global exempts, or, if a channel is specified, a  #    Returns: a list of global exempts, or, if a channel is specified, a
474  #      list of channel-specific exempts. Each entry is a sublist containing:  #      list of channel-specific exempts. Each entry is a sublist containing:
475  #      hostmask, comment, expiration timestamp, time added, last time  #      hostmask, comment, expiration timestamp, time added, last time
476  #      active, and creator. The three timestamps are in unixtime format.  #      active, and creator. The three timestamps are in unixtime format.
477  #    Module: channels  #    Module: channels
478    
479  #  invitelist [channel]  #  invitelist [channel]
480  #    Returns: a list of global invites, or, if a channel is specified, a  #    Returns: a list of global invites, or, if a channel is specified, a
481  #      list of channel-specific invites. Each entry is a sublist containing:  #      list of channel-specific invites. Each entry is a sublist containing:
482  #      hostmask, comment, expiration timestamp, time added, last time  #      hostmask, comment, expiration timestamp, time added, last time
483  #      active, and creator. The three timestamps are in unixtime format.  #      active, and creator. The three timestamps are in unixtime format.
484  #    Module: channels  #    Module: channels
485    
486  #  newignore <hostmask> <creator> <comment> [lifetime]  #  newignore <hostmask> <creator> <comment> [lifetime]
487  #    Description: adds an entry to the ignore list; creator is given credit  #    Description: adds an entry to the ignore list; creator is given credit
488  #      for the ignore. lifetime is how many minutes until the ignore expires  #      for the ignore. lifetime is how many minutes until the ignore expires
489  #      and is removed. If lifetime is not specified, ignore-time (usually 60)  #      and is removed. If lifetime is not specified, ignore-time (usually 60)
490  #      is used. Setting the lifetime to 0 makes it a permanent ignore.  #      is used. Setting the lifetime to 0 makes it a permanent ignore.
491  #    Returns: nothing  #    Returns: nothing
492  #    Module: core  #    Module: core
493    
494  #  killignore <hostmask>  #  killignore <hostmask>
495  #    Description: removes an entry from the ignore list  #    Description: removes an entry from the ignore list
496  #    Returns: 1 if successful; 0 otherwise  #    Returns: 1 if successful; 0 otherwise
497  #    Module: core  #    Module: core
498    
499  #  ignorelist  #  ignorelist
500  #    Returns: a list of ignores. Each entry is a sublist containing:  #    Returns: a list of ignores. Each entry is a sublist containing:
501  #      hostmask, comment, expiration timestamp, time added, and creator.  #      hostmask, comment, expiration timestamp, time added, and creator.
502  #      The timestamps are in unixtime format.  #      The timestamps are in unixtime format.
503  #    Module: core  #    Module: core
504    
505  #  isignore <hostmask>  #  isignore <hostmask>
506  #    Returns: 1 if the ignore is in the list; 0 otherwise  #    Returns: 1 if the ignore is in the list; 0 otherwise
507  #    Module: core  #    Module: core
508  #  #
509  #  save  #  save
510  #    Description: writes the user and channel files to disk  #    Description: writes the user and channel files to disk
511  #    Returns: nothing  #    Returns: nothing
512  #    Module: core  #    Module: core
513    
514    reload    reload
515      Description: loads the userfile from disk, replacing whatever is in      Description: loads the userfile from disk, replacing whatever is in
516        memory        memory
517      Returns: nothing      Returns: nothing
518      Module: core      Module: core
519    
520  #  backup  #  backup
521  #    Description: makes a simple backup of the userfile that's on disk.  #    Description: makes a simple backup of the userfile that's on disk.
522  #      If the channels module is loaded, this also makes a simple backup  #      If the channels module is loaded, this also makes a simple backup
523  #      of the channel file.  #      of the channel file.
524  #    Returns: nothing  #    Returns: nothing
525  #    Module: core  #    Module: core
526    
527  #  getting-users  #  getting-users
528  #    Returns: 1 if the bot is currently downloading a userfile from  #    Returns: 1 if the bot is currently downloading a userfile from
529  #      a sharebot (and hence, user records are about to drastically  #      a sharebot (and hence, user records are about to drastically
530  #      change); 0 if not  #      change); 0 if not
531  #    Module: core  #    Module: core
532    
533  *** CHANNEL COMMANDS ***  *** CHANNEL COMMANDS ***
534    
535    channel add <name> <option-list>    channel add <name> <option-list>
536      Description: adds a channel record for the bot to monitor. The full      Description: adds a channel record for the bot to monitor. The full
537        list of possible options are given in doc/settings.mod.channels. Note        list of possible options are given in doc/settings.mod.channels. Note
538        that the channel options must be in a list (enclosed in {}).        that the channel options must be in a list (enclosed in {}).
539      Returns: nothing      Returns: nothing
540      Module: channels      Module: channels
541    
542    channel set <name> <options...>    channel set <name> <options...>
543      Description: sets options for the channel specified. The full list of      Description: sets options for the channel specified. The full list of
544        possible options are given in doc/settings.mod.channels.        possible options are given in doc/settings.mod.channels.
545      Returns: nothing      Returns: nothing
546      Module: channels      Module: channels
547    
548    channel info <name>    channel info <name>
549      Returns: a list of info about the specified channel's settings.      Returns: a list of info about the specified channel's settings.
550      Module: channels      Module: channels
551    
552    channel get <name> <setting>    channel get <name> <setting>
553      Returns: The value of the setting you specify. For flags, a value of 0      Returns: The value of the setting you specify. For flags, a value of 0
554        means it is disabled (-), and non-zero means enabled (+).        means it is disabled (-), and non-zero means enabled (+).
555      Module: channels      Module: channels
556    
557    channel remove <name>    channel remove <name>
558      Description: removes a channel record from the bot and makes the bot no      Description: removes a channel record from the bot and makes the bot no
559        longer monitor the channel        longer monitor the channel
560      Returns: nothing      Returns: nothing
561      Module: channels      Module: channels
562    
563    savechannels    savechannels
564      Description: saves the channel settings to the channel-file if one is      Description: saves the channel settings to the channel-file if one is
565        defined.        defined.
566      Returns: nothing      Returns: nothing
567      Module: channels      Module: channels
568    
569    loadchannels    loadchannels
570      Description: reloads the channel settings from the channel-file if one      Description: reloads the channel settings from the channel-file if one
571        is defined.        is defined.
572      Returns: nothing      Returns: nothing
573      Module: channels      Module: channels
574    
575    channels    channels
576      Returns: a list of the channels the bot has a channel record for      Returns: a list of the channels the bot has a channel record for
577      Module: channels      Module: channels
578    
579  # channame2dname <channel-name>  # channame2dname <channel-name>
580  # chandname2name <channel-dname>  # chandname2name <channel-dname>
581  #   Description: these two functions are important to correctly support  #   Description: these two functions are important to correctly support
582  #     !channels. The bot differentiates between channel description names  #     !channels. The bot differentiates between channel description names
583  #     (chan dnames) and real channel names (chan names). The chan dnames  #     (chan dnames) and real channel names (chan names). The chan dnames
584  #     are what you would normally call the channel, such as "!channel". The  #     are what you would normally call the channel, such as "!channel". The
585  #     chan names are what the IRC server uses to identify the channel. They  #     chan names are what the IRC server uses to identify the channel. They
586  #     consist of the chan dname prefixed with an ID; such as "!ABCDEchannel".  #     consist of the chan dname prefixed with an ID; such as "!ABCDEchannel".
587  #  #
588  #     For bot functions like isop, isvoice, etc. you need to know the chan  #     For bot functions like isop, isvoice, etc. you need to know the chan
589  #     dnames. If you communicate with the server, you usually get the chan  #     dnames. If you communicate with the server, you usually get the chan
590  #     name, though. That's what you need the channame2dname function for.  #     name, though. That's what you need the channame2dname function for.
591  #  #
592  #     If you only have the chan dname and want to directly send raw server  #     If you only have the chan dname and want to directly send raw server
593  #     commands, use the chandname2name command.  #     commands, use the chandname2name command.
594  #  #
595  #     NOTE: For non-!channels, chan dname and chan name are the same.  #     NOTE: For non-!channels, chan dname and chan name are the same.
596  #   Module: irc  #   Module: irc
597    
598    isbotnick <nick>    isbotnick <nick>
599      Returns: 1 if the nick matches the botnick; 0 otherwise      Returns: 1 if the nick matches the botnick; 0 otherwise
600      Module: server      Module: server
601    
602  #  botisop [channel]  #  botisop [channel]
603  #    Returns: 1 if the bot has ops on the specified channel (or any channel  #    Returns: 1 if the bot has ops on the specified channel (or any channel
604  #      if no channel is specified); 0 otherwise  #      if no channel is specified); 0 otherwise
605  #    Module: irc  #    Module: irc
606    
607  #  botishalfop [channel]  #  botishalfop [channel]
608  #    Returns: 1 if the bot has halfops on the specified channel (or any channel  #    Returns: 1 if the bot has halfops on the specified channel (or any channel
609  #      if no channel is specified); 0 otherwise  #      if no channel is specified); 0 otherwise
610  #    Module: irc  #    Module: irc
611    
612  #  botisvoice [channel]  #  botisvoice [channel]
613  #    Returns: 1 if the bot has a voice on the specified channel (or any  #    Returns: 1 if the bot has a voice on the specified channel (or any
614  #      channel if no channel is specified); 0 otherwise  #      channel if no channel is specified); 0 otherwise
615  #    Module: irc  #    Module: irc
616    
617  #  botonchan [channel]  #  botonchan [channel]
618  #   Returns: 1 if the bot is on the specified channel (or any channel if  #   Returns: 1 if the bot is on the specified channel (or any channel if
619  #     no channel is specified); 0 otherwise  #     no channel is specified); 0 otherwise
620  #   Module: irc  #   Module: irc
621    
622  #  isop <nickname> [channel]  #  isop <nickname> [channel]
623  #    Returns: 1 if someone by the specified nickname is on the channel (or  #    Returns: 1 if someone by the specified nickname is on the channel (or
624  #      any channel if no channel name is specified) and has ops; 0 otherwise  #      any channel if no channel name is specified) and has ops; 0 otherwise
625  #    Module: irc  #    Module: irc
626    
627  #  ishalfop <nickname> [channel]  #  ishalfop <nickname> [channel]
628  #    Returns: 1 if someone by the specified nickname is on the channel (or  #    Returns: 1 if someone by the specified nickname is on the channel (or
629  #      any channel if no channel name is specified) and has halfops; 0 otherwise  #      any channel if no channel name is specified) and has halfops; 0 otherwise
630  #    Module: irc  #    Module: irc
631    
632  #  wasop <nickname> <channel>  #  wasop <nickname> <channel>
633  #    Returns: 1 if someone that just got opped/deopped in the chan had op  #    Returns: 1 if someone that just got opped/deopped in the chan had op
634  #      before the modechange; 0 otherwise  #      before the modechange; 0 otherwise
635  #    Module: irc  #    Module: irc
636    
637  #  washalfop <nickname> <channel>  #  washalfop <nickname> <channel>
638  #    Returns: 1 if someone that just got halfopped/dehalfopped in the chan  #    Returns: 1 if someone that just got halfopped/dehalfopped in the chan
639  #      had halfop before the modechange; 0 otherwise  #      had halfop before the modechange; 0 otherwise
640  #    Module: irc  #    Module: irc
641    
642  #  isvoice <nickname> [channel]  #  isvoice <nickname> [channel]
643  #    Returns: 1 if someone by that nickname is on the channel (or any  #    Returns: 1 if someone by that nickname is on the channel (or any
644  #      channel if no channel is specified) and has voice (+v); 0 otherwise  #      channel if no channel is specified) and has voice (+v); 0 otherwise
645  #    Module: irc  #    Module: irc
646    
647  #  onchan <nickname> [channel]  #  onchan <nickname> [channel]
648  #    Returns: 1 if someone by that nickname is on the specified channel (or  #    Returns: 1 if someone by that nickname is on the specified channel (or
649  #      any channel if none is specified); 0 otherwise  #      any channel if none is specified); 0 otherwise
650  #    Module: irc  #    Module: irc
651    
652  #  nick2hand <nickname> [channel]  #  nick2hand <nickname> [channel]
653  #    Returns: the handle of a nickname on a channel. If a channel is not  #    Returns: the handle of a nickname on a channel. If a channel is not
654  #      specified, the bot will check all of its channels. If the nick is  #      specified, the bot will check all of its channels. If the nick is
655  #      not found, "" is returned. If the nick is found but does not have  #      not found, "" is returned. If the nick is found but does not have
656  #      a handle, "*" is returned.  #      a handle, "*" is returned.
657  #    Module: irc  #    Module: irc
658    
659  #  hand2nick <handle> [channel]  #  hand2nick <handle> [channel]
660  #    Returns: nickname of the first person on the specified channel (if one  #    Returns: nickname of the first person on the specified channel (if one
661  #      is specified) whose nick!user@host matches the given handle; "" is  #      is specified) whose nick!user@host matches the given handle; "" is
662  #      returned if no match is found. If no channel is specified, all channels  #      returned if no match is found. If no channel is specified, all channels
663  #      are checked.  #      are checked.
664  #    Module: irc  #    Module: irc
665    
666  #  handonchan <handle> [channel]  #  handonchan <handle> [channel]
667  #    Returns: 1 if the the nick!user@host for someone on the channel (or any  #    Returns: 1 if the the nick!user@host for someone on the channel (or any
668  #      channel if no channel name is specified) matches for the handle given;  #      channel if no channel name is specified) matches for the handle given;
669  #      0 otherwise  #      0 otherwise
670  #    Module: irc  #    Module: irc
671    
672  #  ischanban <ban> <channel>  #  ischanban <ban> <channel>
673  #    Returns: 1 if the specified ban is on the given channel's ban list  #    Returns: 1 if the specified ban is on the given channel's ban list
674  #      (not the bot's banlist for the channel)  #      (not the bot's banlist for the channel)
675  #    Module: irc  #    Module: irc
676    
677  #  ischanexempt <exempt> <channel>  #  ischanexempt <exempt> <channel>
678  #    Returns: 1 if the specified exempt is on the given channel's exempt  #    Returns: 1 if the specified exempt is on the given channel's exempt
679  #      list (not the bot's exemptlist for the channel)  #      list (not the bot's exemptlist for the channel)
680  #    Module: irc  #    Module: irc
681    
682  #  ischaninvite <invite> <channel>  #  ischaninvite <invite> <channel>
683  #    Returns: 1 if the specified invite is on the given channel's invite  #    Returns: 1 if the specified invite is on the given channel's invite
684  #      list (not the bot's invitelist for the channel)  #      list (not the bot's invitelist for the channel)
685  #    Module: irc  #    Module: irc
686    
687  #  chanbans <channel>  #  chanbans <channel>
688  #    Returns: a list of the current bans on the channel. Each element is  #    Returns: a list of the current bans on the channel. Each element is
689  #      a sublist of the form {<ban> <bywho> <age>}. age is seconds from the  #      a sublist of the form {<ban> <bywho> <age>}. age is seconds from the
690  #      bot's POV.  #      bot's POV.
691  #    Module: irc  #    Module: irc
692    
693  #  chanexempts <channel>  #  chanexempts <channel>
694  #    Returns: a list of the current exempts on the channel. Each element is  #    Returns: a list of the current exempts on the channel. Each element is
695  #      a sublist of the form {<exempts> <bywho> <age>}. age is seconds from the  #      a sublist of the form {<exempts> <bywho> <age>}. age is seconds from the
696  #      bot's POV.  #      bot's POV.
697  #    Module: irc  #    Module: irc
698    
699  #  chaninvites <channel>  #  chaninvites <channel>
700  #    Returns: a list of the current invites on the channel. Each element is  #    Returns: a list of the current invites on the channel. Each element is
701  #      a sublist of the form {<invites> <bywho> <age>}. age is seconds from the  #      a sublist of the form {<invites> <bywho> <age>}. age is seconds from the
702  #      bot's POV.  #      bot's POV.
703  #    Module: irc  #    Module: irc
704    
705  #  resetbans <channel>  #  resetbans <channel>
706  #    Description: removes all bans on the channel that aren't in the bot's  #    Description: removes all bans on the channel that aren't in the bot's
707  #      ban list and refreshes any bans that should be on the channel but  #      ban list and refreshes any bans that should be on the channel but
708  #      aren't  #      aren't
709  #    Returns: nothing  #    Returns: nothing
710  #    Module: irc  #    Module: irc
711    
712  #  resetexempts <channel>  #  resetexempts <channel>
713  #    Description: removes all exempt on the channel that aren't in the bot's  #    Description: removes all exempt on the channel that aren't in the bot's
714  #      exempt list and refreshes any exempts that should be on the channel  #      exempt list and refreshes any exempts that should be on the channel
715  #      but aren't  #      but aren't
716  #    Returns: nothing  #    Returns: nothing
717  #    Module: irc  #    Module: irc
718    
719  #  resetinvites <channel>  #  resetinvites <channel>
720  #    Description: removes all invites on the channel that aren't in the bot's  #    Description: removes all invites on the channel that aren't in the bot's
721  #      invite list and refreshes any invites that should be on the channel  #      invite list and refreshes any invites that should be on the channel
722  #      but aren't  #      but aren't
723  #    Returns: nothing  #    Returns: nothing
724  #    Module: irc  #    Module: irc
725    
726    resetchan <channel>    resetchan <channel>
727      Description: rereads in the channel info from the server      Description: rereads in the channel info from the server
728      Returns: nothing      Returns: nothing
729      Module: irc      Module: irc
730    
731  #  getchanhost <nickname> [channel]  #  getchanhost <nickname> [channel]
732  #    Returns: user@host of the specified nickname (the nickname is not included  #    Returns: user@host of the specified nickname (the nickname is not included
733  #      in the returned host). If a channel is not specified, bot will check  #      in the returned host). If a channel is not specified, bot will check
734  #      all of its channels. If the nickname is not on the channel(s), "" is  #      all of its channels. If the nickname is not on the channel(s), "" is
735  #      returned.  #      returned.
736  #    Module: irc  #    Module: irc
737    
738  #  getchanjoin <nickname> <channel>  #  getchanjoin <nickname> <channel>
739  #    Returns: timestamp (unixtime format) of when the specified nickname  #    Returns: timestamp (unixtime format) of when the specified nickname
740  #      joined the channel  #      joined the channel
741  #    Module: irc  #    Module: irc
742    
743  #  onchansplit <nick> [channel]  #  onchansplit <nick> [channel]
744  #    Returns: 1 if that nick is split from the channel (or any channel if no  #    Returns: 1 if that nick is split from the channel (or any channel if no
745  #      channel is specified); 0 otherwise  #      channel is specified); 0 otherwise
746  #    Module: irc  #    Module: irc
747    
748  #  chanlist <channel> [flags[&chanflags]]  #  chanlist <channel> [flags[&chanflags]]
749  #    Description: flags are any global flags; the '&' denotes to look for  #    Description: flags are any global flags; the '&' denotes to look for
750  #      channel specific flags. Examples:  #      channel specific flags. Examples:
751  #        n         (Global Owner)  #        n         (Global Owner)
752  #        &n        (Channel Owner)  #        &n        (Channel Owner)
753  #        o&m       (Global Op, Channel Master)  #        o&m       (Global Op, Channel Master)
754  #      Now you can use even more complex matching of flags, including +&- flags  #      Now you can use even more complex matching of flags, including +&- flags
755  #      and & or | (and or or) matching.  #      and & or | (and or or) matching.
756  #    Returns: list of nicknames currently on the bot's channel that have all  #    Returns: list of nicknames currently on the bot's channel that have all
757  #      of the flags specified;. If no flags are given, all of the nicknames  #      of the flags specified;. If no flags are given, all of the nicknames
758  #      are returned. Please note that if you're executing chanlist after a  #      are returned. Please note that if you're executing chanlist after a
759  #      part or sign bind, the gone user will still be listed, so you can  #      part or sign bind, the gone user will still be listed, so you can
760  #      check for wasop, isop, etc.  #      check for wasop, isop, etc.
761  #    Module: irc  #    Module: irc
762    
763    
764  #  getchanidle <nickname> <channel>  #  getchanidle <nickname> <channel>
765  #    Returns: number of minutes that person has been idle; 0 if the  #    Returns: number of minutes that person has been idle; 0 if the
766  #      specified user isn't on the channel  #      specified user isn't on the channel
767  #    Module: irc  #    Module: irc
768    
769  #  getchanmode <channel>  #  getchanmode <channel>
770  #    Returns: string of the type "+ntik key" for the channel specified  #    Returns: string of the type "+ntik key" for the channel specified
771  #    Module: irc  #    Module: irc
772    
773    jump [server [port [password]]]    jump [server [port [password]]]
774      Description: jumps to the server specified, or (if none is specified)      Description: jumps to the server specified, or (if none is specified)
775        the next server in the bot's serverlist        the next server in the bot's serverlist
776      Returns: nothing      Returns: nothing
777      Module: server      Module: server
778    
779  #  pushmode <channel> <mode> [arg]  #  pushmode <channel> <mode> [arg]
780  #    Description: sends out a channel mode change (ex: pushmode #lame +o  #    Description: sends out a channel mode change (ex: pushmode #lame +o
781  #      goober) through the bot's queuing system. All the mode changes will  #      goober) through the bot's queuing system. All the mode changes will
782  #      be sent out at once (combined into one line as much as possible) after  #      be sent out at once (combined into one line as much as possible) after
783  #      the script finishes, or when 'flushmode' is called.  #      the script finishes, or when 'flushmode' is called.
784  #    Returns: nothing  #    Returns: nothing
785  #    Module: irc  #    Module: irc
786    
787  #  flushmode <channel>  #  flushmode <channel>
788  #    Description: forces all previously pushed channel mode changes to be  #    Description: forces all previously pushed channel mode changes to be
789  #      sent to the server, instead of when the script is finished (just for  #      sent to the server, instead of when the script is finished (just for
790  #      the channel specified)  #      the channel specified)
791  #    Returns: nothing  #    Returns: nothing
792  #    Module: irc  #    Module: irc
793    
794  #  topic <channel>  #  topic <channel>
795  #    Returns: string containing the current topic of the specified channel  #    Returns: string containing the current topic of the specified channel
796  #    Module: irc  #    Module: irc
797    
798    validchan <channel>    validchan <channel>
799      Description: checks if the bot has a channel record for the specified      Description: checks if the bot has a channel record for the specified
800        channel. Note that this does not necessarily mean that the bot is ON        channel. Note that this does not necessarily mean that the bot is ON
801        the channel.        the channel.
802      Returns: 1 if the channel exists, 0 if not      Returns: 1 if the channel exists, 0 if not
803      Module: channels      Module: channels
804    
805  #  isdynamic <channel>  #  isdynamic <channel>
806  #    Returns: 1 if the channel is a dynamic channel; 0 otherwise  #    Returns: 1 if the channel is a dynamic channel; 0 otherwise
807  #    Module: channels  #    Module: channels
808    
809  #|  setudef <flag/int/str> <name>  #|  setudef <flag/int/str> <name>
810  #|    Description: initializes a user defined channel flag, string or integer  #|    Description: initializes a user defined channel flag, string or integer
811  #|      setting. You can use it like any other flag/setting. IMPORTANT: Don't  #|      setting. You can use it like any other flag/setting. IMPORTANT: Don't
812  #|      forget to reinitialize your flags/settings after a restart, or it'll be  #|      forget to reinitialize your flags/settings after a restart, or it'll be
813  #|      lost.  #|      lost.
814  #|    Returns: nothing  #|    Returns: nothing
815  #|    Module: channels  #|    Module: channels
816    
817  #|  renudef <flag/int/str> <oldname> <newname>  #|  renudef <flag/int/str> <oldname> <newname>
818  #|    Description: renames a user defined channel flag, string, or integer  #|    Description: renames a user defined channel flag, string, or integer
819  #|      setting.  #|      setting.
820  #|    Returns: nothing  #|    Returns: nothing
821  #|    Module: channels  #|    Module: channels
822    
823  #|  deludef <flag/int/str> <name>  #|  deludef <flag/int/str> <name>
824  #|    Description: deletes a user defined channel flag, string, or integer  #|    Description: deletes a user defined channel flag, string, or integer
825  #|      setting.  #|      setting.
826  #|    Returns: nothing  #|    Returns: nothing
827  #|    Module: channels  #|    Module: channels
828    
829    
830  *** DCC COMMANDS ***  *** DCC COMMANDS ***
831    
832    putdcc <idx> <text>    putdcc <idx> <text>
833      Description: sends text to the idx specified      Description: sends text to the idx specified
834      Returns: nothing      Returns: nothing
835      Module: core      Module: core
836    
837  #  dccbroadcast <message>  #  dccbroadcast <message>
838  #    Description: sends a message to everyone on the party line across the  #    Description: sends a message to everyone on the party line across the
839  #      botnet, in the form of "*** <message>" for local users and  #      botnet, in the form of "*** <message>" for local users and
840  #      "*** (Bot) <message>" for users on other bots  #      "*** (Bot) <message>" for users on other bots
841  #    Returns: nothing  #    Returns: nothing
842  #    Module: core  #    Module: core
843    
844  #  dccputchan <channel> <message>  #  dccputchan <channel> <message>
845  #    Description: sends your message to everyone on a certain channel on the  #    Description: sends your message to everyone on a certain channel on the
846  #      botnet, in a form exactly like dccbroadcast does. Valid channels are 0  #      botnet, in a form exactly like dccbroadcast does. Valid channels are 0
847  #      through 99999.  #      through 99999.
848  #    Returns: nothing  #    Returns: nothing
849  #    Module: core  #    Module: core
850    
851  #  boot <user@bot> [reason]  #  boot <user@bot> [reason]
852  #     Description: boots a user from the partyline  #     Description: boots a user from the partyline
853  #     Returns: nothing  #     Returns: nothing
854  #     Module: core  #     Module: core
855    
856  #  dccsimul <idx> <text>  #  dccsimul <idx> <text>
857  #    Description: simulates text typed in by the dcc user specified. Note  #    Description: simulates text typed in by the dcc user specified. Note
858  #      that in v0.9, this only simulated commands; now a command must be  #      that in v0.9, this only simulated commands; now a command must be
859  #      preceded by a '.' to be simulated.  #      preceded by a '.' to be simulated.
860  #    Returns: nothing  #    Returns: nothing
861  #    Module: core  #    Module: core
862    
863  #  hand2idx <handle>  #  hand2idx <handle>
864  #    Returns: the idx (a number greater than or equal to zero) for the user  #    Returns: the idx (a number greater than or equal to zero) for the user
865  #      given if the user is on the party line in chat mode (even if she is  #      given if the user is on the party line in chat mode (even if she is
866  #      currently on a channel or in chat off), the file area, or in the control  #      currently on a channel or in chat off), the file area, or in the control
867  #      of a script. -1 is returned if no idx is found. If the user is on  #      of a script. -1 is returned if no idx is found. If the user is on
868  #      multiple times, the oldest idx is returned.  #      multiple times, the oldest idx is returned.
869  #    Module: dcc  #    Module: dcc
870    
871  #  idx2hand <idx>  #  idx2hand <idx>
872  #    Returns: handle of the user with the given idx  #    Returns: handle of the user with the given idx
873  #    Module: core  #    Module: core
874    
875  #  valididx <idx>  #  valididx <idx>
876  #    Returns: 1 if the idx currently exists; 0 otherwise  #    Returns: 1 if the idx currently exists; 0 otherwise
877  #    Module: core  #    Module: core
878    
879  #  getchan <idx>  #  getchan <idx>
880  #    Returns: the current party line channel for a user on the party line;  #    Returns: the current party line channel for a user on the party line;
881  #      "0" indicates he's on the group party line, "-1" means he has chat off,  #      "0" indicates he's on the group party line, "-1" means he has chat off,
882  #      and a value from 1 to 99999 is a private channel  #      and a value from 1 to 99999 is a private channel
883  #    Module: core  #    Module: core
884    
885  #  setchan <idx> <channel>  #  setchan <idx> <channel>
886  #    Description: sets a party line user's channel. The party line user  #    Description: sets a party line user's channel. The party line user
887  #      is not notified that she is now on a new channel. A channel name  #      is not notified that she is now on a new channel. A channel name
888  #      can be used (provided it exists).  #      can be used (provided it exists).
889  #    Returns: nothing  #    Returns: nothing
890  #    Module: core  #    Module: core
891    
892  #  console <idx> [channel] [console-modes]  #  console <idx> [channel] [console-modes]
893  #    Description: changes a dcc user's console mode, either to an absolute  #    Description: changes a dcc user's console mode, either to an absolute
894  #      mode (like "mpj") or just adding/removing flags (like "+pj" or "-moc"  #      mode (like "mpj") or just adding/removing flags (like "+pj" or "-moc"
895  #      or "+mp-c"). The user's console channel view can be changed also (as  #      or "+mp-c"). The user's console channel view can be changed also (as
896  #      long as the new channel is a valid channel).  #      long as the new channel is a valid channel).
897  #    Returns: a list containing the user's (new) channel view and (new)  #    Returns: a list containing the user's (new) channel view and (new)
898  #      console modes, or nothing if that user isn't currently on the partyline  #      console modes, or nothing if that user isn't currently on the partyline
899  #    Module: core  #    Module: core
900    
901  #  echo <idx> [status]  #  echo <idx> [status]
902  #    Description: turns a user's echo on or off; the status has to be a 1 or 0  #    Description: turns a user's echo on or off; the status has to be a 1 or 0
903  #    Returns: new value of echo for that user (or the current value, if status  #    Returns: new value of echo for that user (or the current value, if status
904  #      was omitted)  #      was omitted)
905  #    Module: core  #    Module: core
906    
907  #  strip <idx> [+/-strip-flags]  #  strip <idx> [+/-strip-flags]
908  #    Description: modifies the strip-flags for a user  #    Description: modifies the strip-flags for a user
909  #    Returns: new strip-flags for the specified user (or the current  #    Returns: new strip-flags for the specified user (or the current
910  #      flags, if strip-flags was omitted)  #      flags, if strip-flags was omitted)
911  #    Module: core  #    Module: core
912    
913  #  putbot <bot-nick> <message>  #  putbot <bot-nick> <message>
914  #    Description: sends a message across the botnet to another bot. If no  #    Description: sends a message across the botnet to another bot. If no
915  #      script intercepts the message on the other end, the message is  #      script intercepts the message on the other end, the message is
916  #      ignored.  #      ignored.
917  #    Returns: nothing  #    Returns: nothing
918  #    Module: core  #    Module: core
919    
920  #  putallbots <message>  #  putallbots <message>
921  #    Description: sends a message across the botnet to all bots. If no  #    Description: sends a message across the botnet to all bots. If no
922  #      script intercepts the message on the other end, the message is  #      script intercepts the message on the other end, the message is
923  #      ignored.  #      ignored.
924  #    Returns: nothing  #    Returns: nothing
925  #    Module: core  #    Module: core
926    
927  #  killdcc <idx>  #  killdcc <idx>
928  #    Description: kills a partyline or file area connection  #    Description: kills a partyline or file area connection
929  #    Returns: nothing  #    Returns: nothing
930  #    Module: core  #    Module: core
931    
932  #  bots  #  bots
933  #    Returns: list of the bots currently connected to the botnet  #    Returns: list of the bots currently connected to the botnet
934  #    Module: core  #    Module: core
935    
936  #  botlist  #  botlist
937  #    Returns: a list of bots currently on the botnet. Each item in the list  #    Returns: a list of bots currently on the botnet. Each item in the list
938  #      is a sublist with four elements: bot, uplink, version, sharing status:  #      is a sublist with four elements: bot, uplink, version, sharing status:
939  #        bot:     the bot's botnetnick  #        bot:     the bot's botnetnick
940  #        uplink:  the bot the bot is connected to  #        uplink:  the bot the bot is connected to
941  #        version: its current numeric version  #        version: its current numeric version
942  #        sharing: a "+" if the bot is a sharebot; "-" otherwise  #        sharing: a "+" if the bot is a sharebot; "-" otherwise
943  #    Module: core  #    Module: core
944    
945  #  islinked <bot>  #  islinked <bot>
946  #    Returns: 1 if the bot is currently linked; 0 otherwise  #    Returns: 1 if the bot is currently linked; 0 otherwise
947  #    Module: core  #    Module: core
948    
949  #  dccused  #  dccused
950  #    Returns: number of dcc connections currently in use  #    Returns: number of dcc connections currently in use
951  #    Module: core  #    Module: core
952    
953    dcclist ?type?    dcclist ?type?
954      Returns: a list of active connections, each item in the list is a      Returns: a list of active connections, each item in the list is a
955        sublist containing six elements:        sublist containing six elements:
956          {<idx> <handle> <hostname> <type> {<other>} <timestamp>}.          {<idx> <handle> <hostname> <type> {<other>} <timestamp>}.
957    
958        The types are: chat, bot, files, file_receiving, file_sending,        The types are: chat, bot, files, file_receiving, file_sending,
959        file_send_pending, script, socket (these are connections that have        file_send_pending, script, socket (these are connections that have
960        not yet been put under 'control'), telnet, and server. The timestamp        not yet been put under 'control'), telnet, and server. The timestamp
961        is in unixtime format.        is in unixtime format.
962      Module: core      Module: core
963    
964          FixMe: Document the idxlist command.          FixMe: Document the idxlist command.
965    
966  #  whom <chan>  #  whom <chan>
967  #    Returns: list of people on the botnet who are on that channel. 0 is  #    Returns: list of people on the botnet who are on that channel. 0 is
968  #      the default party line. Each item in the list is a sublist with six  #      the default party line. Each item in the list is a sublist with six
969  #      elements: nickname, bot, hostname, access flag ('-', '@', '+', or  #      elements: nickname, bot, hostname, access flag ('-', '@', '+', or
970  #      '*'), minutes idle, and away message (blank if the user is not away).  #      '*'), minutes idle, and away message (blank if the user is not away).
971  #      If you specify * for channel, every user on the botnet is returned  #      If you specify * for channel, every user on the botnet is returned
972  #      with an extra argument indicating the channel the user is on.  #      with an extra argument indicating the channel the user is on.
973  #    Module: core  #    Module: core
974    
975  #  getdccidle <idx>  #  getdccidle <idx>
976  #    Returns: number of seconds the dcc chat/file system/script user has  #    Returns: number of seconds the dcc chat/file system/script user has
977  #      been idle  #      been idle
978  #    Module: core  #    Module: core
979    
980  #  getdccaway <idx>  #  getdccaway <idx>
981  #    Returns: away message for a dcc chat user (or "" if the user is not  #    Returns: away message for a dcc chat user (or "" if the user is not
982  #      set away)  #      set away)
983  #    Module: core  #    Module: core
984    
985  #  setdccaway <idx> <message>  #  setdccaway <idx> <message>
986  #    Description: sets a party line user's away message and marks them away.  #    Description: sets a party line user's away message and marks them away.
987  #     If set to "", the user is marked as no longer away.  #     If set to "", the user is marked as no longer away.
988  #    Returns: nothing  #    Returns: nothing
989  #    Module: core  #    Module: core
990    
991  #  connect <host> <port>  #  connect <host> <port>
992  #    Description: makes an outgoing connection attempt and creates a dcc  #    Description: makes an outgoing connection attempt and creates a dcc
993  #      entry for it. A 'control' command should be used immediately after  #      entry for it. A 'control' command should be used immediately after
994  #      a successful 'connect' so no input is lost.  #      a successful 'connect' so no input is lost.
995  #    Returns: idx of the new connection  #    Returns: idx of the new connection
996  #    Module: core  #    Module: core
997    
998    listen <port> <type> [options] [flag]    listen <port> <type> [options] [flag]
999      Description: opens a listening port to accept incoming telnets; type      Description: opens a listening port to accept incoming telnets; type
1000        must be one of "bots", "all", "users", "script", or "off":        must be one of "bots", "all", "users", "script", or "off":
1001    
1002  #        listen <port> bots [mask]  #        listen <port> bots [mask]
1003  #          Description: accepts connections from bots only; the optional mask  #          Description: accepts connections from bots only; the optional mask
1004  #            is used to identify permitted bot names. If the mask begins with  #            is used to identify permitted bot names. If the mask begins with
1005  #            '@', it is interpreted to be a mask of permitted hosts to accept  #            '@', it is interpreted to be a mask of permitted hosts to accept
1006  #            connections from.  #            connections from.
1007  #          Returns: port number  #          Returns: port number
1008    
1009          listen <port> users [mask]          listen <port> users [mask]
1010            Description: accepts connections from users only (no bots); the            Description: accepts connections from users only (no bots); the
1011              optional mask is used to identify permitted nicknames. If the              optional mask is used to identify permitted nicknames. If the
1012              mask begins with '@', it is interpreted to be a mask of permitted              mask begins with '@', it is interpreted to be a mask of permitted
1013              hosts to accept connections from.              hosts to accept connections from.
1014            Returns: port number            Returns: port number
1015    
1016  #        listen <port> all [mask]  #        listen <port> all [mask]
1017  #          Description: accepts connections from anyone; the optional mask  #          Description: accepts connections from anyone; the optional mask
1018  #            is used to identify permitted nicknames/botnames. If the mask  #            is used to identify permitted nicknames/botnames. If the mask
1019  #            begins with '@', it is interpreted to be a mask of permitted  #            begins with '@', it is interpreted to be a mask of permitted
1020  #            hosts to accept connections from.  #            hosts to accept connections from.
1021  #          Returns: port number  #          Returns: port number
1022    
1023  #        listen <port> script <proc> [flag]  #        listen <port> script <proc> [flag]
1024  #          Description: accepts connections which are immediately routed to  #          Description: accepts connections which are immediately routed to
1025  #            a proc. The proc is called with one parameter: the idx of the  #            a proc. The proc is called with one parameter: the idx of the
1026  #            new connection. Flag may currently only be 'pub', which makes  #            new connection. Flag may currently only be 'pub', which makes
1027  #            the bot allow anyone to connect.  #            the bot allow anyone to connect.
1028  #          Returns: port number  #          Returns: port number
1029    
1030  #        listen <port> off  #        listen <port> off
1031  #          Description: stop listening on a port  #          Description: stop listening on a port
1032  #          Returns: nothing  #          Returns: nothing
1033  #    Module: core  #    Module: core
1034    
1035  #  dccdumpfile <idx> <filename>  #  dccdumpfile <idx> <filename>
1036  #    Description: dumps out a file from the text directory to a dcc chat  #    Description: dumps out a file from the text directory to a dcc chat
1037  #      user. The flag matching that's used everywhere else works here, too.  #      user. The flag matching that's used everywhere else works here, too.
1038  #    Returns: nothing  #    Returns: nothing
1039  #    Module: core  #    Module: core
1040    
1041  #  *** NOTES MODULE ***  #  *** NOTES MODULE ***
1042    
1043  #  notes <user> [numberlist]  #  notes <user> [numberlist]
1044  #    Returns: -1 if no such user, -2 if notefile failure. If a numberlist  #    Returns: -1 if no such user, -2 if notefile failure. If a numberlist
1045  #      is not specified, the number of notes stored for the user is returned.  #      is not specified, the number of notes stored for the user is returned.
1046  #      Otherwise, a list of sublists containing information about notes  #      Otherwise, a list of sublists containing information about notes
1047  #      stored for the user is returned. Each sublist is in the format of:  #      stored for the user is returned. Each sublist is in the format of:
1048  #        {<from> <timestamp> <note text>}.  #        {<from> <timestamp> <note text>}.
1049  #    Module: notes  #    Module: notes
1050    
1051  #  erasenotes <user> <numberlist>  #  erasenotes <user> <numberlist>
1052  #    Description: erases some or all stored notes for a user. Use '-'  #    Description: erases some or all stored notes for a user. Use '-'
1053  #      to erase all notes.  #      to erase all notes.
1054  #    Returns: -1 if no such user, -2 if notefile failure, 0 if  #    Returns: -1 if no such user, -2 if notefile failure, 0 if
1055  #      no such note, or number of erased notes.  #      no such note, or number of erased notes.
1056  #    Module: notes  #    Module: notes
1057    
1058  #  listnotes <user> <numberlist>  #  listnotes <user> <numberlist>
1059  #    Description: lists existing notes according to the numberlist (ex:  #    Description: lists existing notes according to the numberlist (ex:
1060  #      "2-4;8;16-")  #      "2-4;8;16-")
1061  #    Returns: -1 if no such user, -2 if notefile failure, 0 if no  #    Returns: -1 if no such user, -2 if notefile failure, 0 if no
1062  #      such note, list of existing notes.  #      such note, list of existing notes.
1063  #    Module: notes  #    Module: notes
1064    
1065  #  storenote <from> <to> <msg> <idx>  #  storenote <from> <to> <msg> <idx>
1066  #    Description: stores a note for later reading, notifies idx of any results  #    Description: stores a note for later reading, notifies idx of any results
1067  #      (use idx -1 for no notify).  #      (use idx -1 for no notify).
1068  #    Returns: 0 on success; non-0 on failure  #    Returns: 0 on success; non-0 on failure
1069  #    Module: notes  #    Module: notes
1070    
1071  #*** ASSOC MODULE ***  #*** ASSOC MODULE ***
1072    
1073  #  assoc <chan> [name]  #  assoc <chan> [name]
1074  #    Description: sets the name associated with a botnet channel, if you  #    Description: sets the name associated with a botnet channel, if you
1075  #      specify one  #      specify one
1076  #    Returns: current name for that channel, if any  #    Returns: current name for that channel, if any
1077  #    Module: assoc  #    Module: assoc
1078    
1079  #  killassoc <chan>  #  killassoc <chan>
1080  #    Description: removes the name associated with a botnet channel, if any  #    Description: removes the name associated with a botnet channel, if any
1081  #      exists. Use 'killassoc &' to kill all assocs.  #      exists. Use 'killassoc &' to kill all assocs.
1082  #    Returns: nothing  #    Returns: nothing
1083  #    Module: assoc  #    Module: assoc
1084    
1085  #*** COMPRESS MODULE ***  #*** COMPRESS MODULE ***
1086    
1087  #  compressfile [-level <level>] <src-file> [target-file]  #  compressfile [-level <level>] <src-file> [target-file]
1088  #  uncompressfile <src-file> [target-file]  #  uncompressfile <src-file> [target-file]
1089  #    Description: compresses or un-compresses files. The level option specifies  #    Description: compresses or un-compresses files. The level option specifies
1090  #      the compression mode to use when compressing. Available modes are from  #      the compression mode to use when compressing. Available modes are from
1091  #      0 (minimum CPU usage, minimum compression) all the way up to 9 (maximum  #      0 (minimum CPU usage, minimum compression) all the way up to 9 (maximum
1092  #      CPU usage, maximum compression). If you don't specify the target-file,  #      CPU usage, maximum compression). If you don't specify the target-file,
1093  #      the src-file will be overwritten.  #      the src-file will be overwritten.
1094  #    Returns: nothing  #    Returns: nothing
1095  #    Module: compress  #    Module: compress
1096    
1097  #  iscompressed <filename>  #  iscompressed <filename>
1098  #    Description: determines whether <filename> is gzip compressed. Returns 1  #    Description: determines whether <filename> is gzip compressed. Returns 1
1099  #      if it is, 0 if it isn't, and 2 if some kind of error prevented the  #      if it is, 0 if it isn't, and 2 if some kind of error prevented the
1100  #      checks from succeeding.  #      checks from succeeding.
1101  #    Returns: nothing  #    Returns: nothing
1102  #    Module: compress  #    Module: compress
1103    
1104  #*** FILESYS MODULE ***  #*** FILESYS MODULE ***
1105    
1106  #  setpwd <idx> <dir>  #  setpwd <idx> <dir>
1107  #    Description: changes the directory of a file system user, in exactly  #    Description: changes the directory of a file system user, in exactly
1108  #      the same way as a 'cd' command would. The directory can be specified  #      the same way as a 'cd' command would. The directory can be specified
1109  #      relative or absolute.  #      relative or absolute.
1110  #    Returns: nothing  #    Returns: nothing
1111  #    Module: filesys  #    Module: filesys
1112    
1113  #  getpwd <idx>  #  getpwd <idx>
1114  #    Returns: the current directory of a file system user  #    Returns: the current directory of a file system user
1115  #    Module: filesys  #    Module: filesys
1116    
1117  #  getfiles <dir>  #  getfiles <dir>
1118  #    Returns: a list of files in the directory given; the directory is  #    Returns: a list of files in the directory given; the directory is
1119  #      relative to dcc-path  #      relative to dcc-path
1120  #    Module: filesys  #    Module: filesys
1121    
1122  #  getdirs <dir>  #  getdirs <dir>
1123  #    Returns: a list of subdirectories in the directory given; the directory  #    Returns: a list of subdirectories in the directory given; the directory
1124  #      is relative to dcc-path  #      is relative to dcc-path
1125  #    Module: filesys  #    Module: filesys
1126    
1127  #  dccsend <filename> <ircnick>  #  dccsend <filename> <ircnick>
1128  #    Description: attempts to start a dcc file transfer to the given nick;  #    Description: attempts to start a dcc file transfer to the given nick;
1129  #      the filename must be specified either by full pathname or in relation  #      the filename must be specified either by full pathname or in relation
1130  #      to the bot's startup directory  #      to the bot's startup directory
1131  #    Returns:  #    Returns:
1132  #      0 success  #      0 success
1133  #      1 the dcc table is full (too many connections)  #      1 the dcc table is full (too many connections)
1134  #      2 can't open a socket for the transfer  #      2 can't open a socket for the transfer
1135  #      3 the file doesn't exist  #      3 the file doesn't exist
1136  #      4 the file was queued for later transfer, which means that person has  #      4 the file was queued for later transfer, which means that person has
1137  #        too many file transfers going right now  #        too many file transfers going right now
1138  #      5 copy-to-tmp is enabled and the file already exists in the temp  #      5 copy-to-tmp is enabled and the file already exists in the temp
1139  #        directory  #        directory
1140  #    Module: transfer  #    Module: transfer
1141    
1142  #  filesend <idx> <filename> [ircnick]  #  filesend <idx> <filename> [ircnick]
1143  #    Description: like dccsend, except it operates for a current filesystem  #    Description: like dccsend, except it operates for a current filesystem
1144  #      user, and the filename is assumed to be a relative path from that  #      user, and the filename is assumed to be a relative path from that
1145  #      user's current directory  #      user's current directory
1146  #    Returns: 0 on failure; 1 on success (either an immediate send or a queued  #    Returns: 0 on failure; 1 on success (either an immediate send or a queued
1147  #      send)  #      send)
1148  #    Module: filesys  #    Module: filesys
1149    
1150  # fileresend <idx> <filename> [ircnick]  # fileresend <idx> <filename> [ircnick]
1151  #    Description: functions like filesend, only that it sends a DCC RESEND  #    Description: functions like filesend, only that it sends a DCC RESEND
1152  #      instead of a DCC SEND, which allows people to resume aborted file  #      instead of a DCC SEND, which allows people to resume aborted file
1153  #      transfers if their client supports that protocol. ircII/BitchX/etc.  #      transfers if their client supports that protocol. ircII/BitchX/etc.
1154  #      support it; mIRC does not.  #      support it; mIRC does not.
1155  #    Returns: 0 on failure; 1 on success (either an immediate send or a queued  #    Returns: 0 on failure; 1 on success (either an immediate send or a queued
1156  #      send)  #      send)
1157  #    Module: filesys  #    Module: filesys
1158    
1159  #  setdesc <dir> <file> <desc>  #  setdesc <dir> <file> <desc>
1160  #    Description: sets the description for a file in a file system directory;  #    Description: sets the description for a file in a file system directory;
1161  #      the directory is relative to dcc-path  #      the directory is relative to dcc-path
1162  #    Returns: nothing  #    Returns: nothing
1163  #    Module: filesys  #    Module: filesys
1164    
1165  #  getdesc <dir> <file>  #  getdesc <dir> <file>
1166  #    Returns: the description for a file in the file system, if one  #    Returns: the description for a file in the file system, if one
1167  #      exists  #      exists
1168  #    Module: filesys  #    Module: filesys
1169    
1170  #  setowner <dir> <file> <handle>  #  setowner <dir> <file> <handle>
1171  #    Description: changes the owner for a file in the file system; the  #    Description: changes the owner for a file in the file system; the
1172  #      directory is relative to dcc-path  #      directory is relative to dcc-path
1173  #    Returns: nothing  #    Returns: nothing
1174  #    Module: filesys  #    Module: filesys
1175    
1176  #  getowner <dir> <file>  #  getowner <dir> <file>
1177  #    Returns: the owner of a file in the file system  #    Returns: the owner of a file in the file system
1178  #    Module: filesys  #    Module: filesys
1179    
1180  #  setlink <dir> <file> <link>  #  setlink <dir> <file> <link>
1181  #    Description: creates or changes a linked file (a file that actually  #    Description: creates or changes a linked file (a file that actually
1182  #      exists on another bot); the directory is relative to dcc-path  #      exists on another bot); the directory is relative to dcc-path
1183  #    Returns: nothing  #    Returns: nothing
1184  #    Module: filesys  #    Module: filesys
1185    
1186  #  getlink <dir> <file>  #  getlink <dir> <file>
1187  #    Returns: the link for a linked file, if it exists  #    Returns: the link for a linked file, if it exists
1188  #    Module: filesys  #    Module: filesys
1189    
1190  #  getfileq <handle>  #  getfileq <handle>
1191  #    Returns: list of files queued by someone; each item in the list will be  #    Returns: list of files queued by someone; each item in the list will be
1192  #      a sublist with two elements: nickname the file is being sent to and  #      a sublist with two elements: nickname the file is being sent to and
1193  #      the filename  #      the filename
1194  #    Module: transfer  #    Module: transfer
1195    
1196  #  getfilesendtime <idx>  #  getfilesendtime <idx>
1197  #    Returns: the unixtime value from when a file transfer started, or a  #    Returns: the unixtime value from when a file transfer started, or a
1198  #      negative number:  #      negative number:
1199  #        -1 no matching transfer with the specified idx was found  #        -1 no matching transfer with the specified idx was found
1200  #        -2 the idx matches an entry which is not a file transfer  #        -2 the idx matches an entry which is not a file transfer
1201  #    Module: transfer  #    Module: transfer
1202    
1203  #  mkdir <directory> [<required-flags> [channel]]  #  mkdir <directory> [<required-flags> [channel]]
1204  #    Description: creates a directory in the file system. Only users with the  #    Description: creates a directory in the file system. Only users with the
1205  #      required flags may access it.  #      required flags may access it.
1206  #    Returns:  #    Returns:
1207  #      0 success  #      0 success
1208  #      1 can't create directory  #      1 can't create directory
1209  #      2 directory exists but is not a directory  #      2 directory exists but is not a directory
1210  #    Module: filesys  #    Module: filesys
1211    
1212  #  rmdir <directory>  #  rmdir <directory>
1213  #    Description: removes a directory from the file system.  #    Description: removes a directory from the file system.
1214  #    Returns: 0 on success; 1 on failure  #    Returns: 0 on success; 1 on failure
1215  #    Module: filesys  #    Module: filesys
1216    
1217  #  mv <file> <destination>  #  mv <file> <destination>
1218  #    Description: moves a file from its source to the given destination.  #    Description: moves a file from its source to the given destination.
1219  #      The file can also be a mask, such as /incoming/*, provided the  #      The file can also be a mask, such as /incoming/*, provided the
1220  #      destination is a directory.  #      destination is a directory.
1221  #    Returns: If the command was successful, the number of files moved will  #    Returns: If the command was successful, the number of files moved will
1222  #      be returned. Otherwise, a negative number will be returned:  #      be returned. Otherwise, a negative number will be returned:
1223  #        -1 invalid source file  #        -1 invalid source file
1224  #        -2 invalid destination  #        -2 invalid destination
1225  #        -3 destination file exists  #        -3 destination file exists
1226  #        -4 no matches found  #        -4 no matches found
1227  #    Module: filesys  #    Module: filesys
1228    
1229  #  cp <file> <destination>  #  cp <file> <destination>
1230  #    Description: copies a file from its source to the given destination.  #    Description: copies a file from its source to the given destination.
1231  #      The file can also be a mask, such as /incoming/*, provided the  #      The file can also be a mask, such as /incoming/*, provided the
1232  #      destination is a directory.  #      destination is a directory.
1233  #    Returns: If the command was successful, the number of files copied will  #    Returns: If the command was successful, the number of files copied will
1234  #      be returned. Otherwise, a negative number will be returned:  #      be returned. Otherwise, a negative number will be returned:
1235  #        -1 invalid source file  #        -1 invalid source file
1236  #        -2 invalid destination  #        -2 invalid destination
1237  #        -3 destination file exists  #        -3 destination file exists
1238  #        -4 no matches found  #        -4 no matches found
1239  #    Module: filesys  #    Module: filesys
1240    
1241  #  getflags <dir>  #  getflags <dir>
1242  #    Returns: the flags required to access a directory  #    Returns: the flags required to access a directory
1243  #    Module: filesys  #    Module: filesys
1244  #  #
1245  #  setflags <dir> [<flags> [channel]]  #  setflags <dir> [<flags> [channel]]
1246  #    Description: sets the flags required to access a directory  #    Description: sets the flags required to access a directory
1247  #    Returns: 0 on success; -1 on failure  #    Returns: 0 on success; -1 on failure
1248  #    Module: filesys  #    Module: filesys
1249    
1250    
1251  *** MISCELLANEOUS COMMANDS ***  *** MISCELLANEOUS COMMANDS ***
1252    
1253    bind <type> <flags> <keyword/mask> [proc-name] [priority]    bind <type> <flags> <keyword/mask> [proc-name] [priority]
1254      Description: You can use the 'bind' command to attach Tcl procedures      Description: You can use the 'bind' command to attach Tcl procedures
1255        to certain events. flags are the flags the user must have to trigger        to certain events. flags are the flags the user must have to trigger
1256        the event (if applicable). proc-name is the name of the Tcl procedure        the event (if applicable). proc-name is the name of the Tcl procedure
1257        to call for this command (see below for the format of the procedure        to call for this command (see below for the format of the procedure
1258        call). If the proc-name is omitted, no binding is added. Instead, the        call). If the proc-name is omitted, no binding is added. Instead, the
1259        current binding is returned (if it's stackable, a list of the current        current binding is returned (if it's stackable, a list of the current
1260        bindings is returned).        bindings is returned).
1261        priority defaults to 50, but can be between 0-98.        priority defaults to 50, but can be between 0-98.
1262        priority 99 is reserved for Tcldrop's internal binds.        priority 99 is reserved for Tcldrop's internal binds.
1263        Lower priority number means it gets executed before higher number ones.        Lower priority number means it gets executed before higher number ones.
1264      Returns: name of the command that was added, or (if proc-name was      Returns: name of the command that was added, or (if proc-name was
1265        omitted), a list of the current bindings for this command        omitted), a list of the current bindings for this command
1266      Module: core      Module: core
1267    
1268  #  unbind <type> <flags> <keyword/mask> <proc-name>  #  unbind <type> <flags> <keyword/mask> <proc-name>
1269  #    Description: removes a previously created bind  #    Description: removes a previously created bind
1270  #    Returns: name of the command that was removed  #    Returns: name of the command that was removed
1271  #    Module: core  #    Module: core
1272    
1273    binds ?type/mask?    binds ?type/mask?
1274      Returns: a list of Tcl binds, each item in the list is a sublist of      Returns: a list of Tcl binds, each item in the list is a sublist of
1275        five elements:        five elements:
1276          {<type> <flags> <name> <hits> <proc>}          {<type> <flags> <name> <hits> <proc>}
1277      Module: core      Module: core
1278    
1279  #  logfile [<modes> <channel> <filename>]  #  logfile [<modes> <channel> <filename>]
1280  #    Description: creates a new logfile, which will log the modes given for  #    Description: creates a new logfile, which will log the modes given for
1281  #      the channel listed. If no logfile is specified, a list of existing  #      the channel listed. If no logfile is specified, a list of existing
1282  #      logfiles will be returned. "*" indicates all channels. You can also  #      logfiles will be returned. "*" indicates all channels. You can also
1283  #      change the modes and channel of an existing logfile with this command.  #      change the modes and channel of an existing logfile with this command.
1284  #      Entering a blank mode and channel ("") makes the bot stop logging there.  #      Entering a blank mode and channel ("") makes the bot stop logging there.
1285  #  #
1286  #      Logfile flags:  #      Logfile flags:
1287  #        b - information about bot linking and userfile sharing  #        b - information about bot linking and userfile sharing
1288  #        c - commands  #        c - commands
1289  #        d - misc debug information  #        d - misc debug information
1290  #        h - raw share traffic  #        h - raw share traffic
1291  #        j - joins, parts, quits, and netsplits on the channel  #        j - joins, parts, quits, and netsplits on the channel
1292  #        k - kicks, bans, and mode changes on the channel  #        k - kicks, bans, and mode changes on the channel
1293  #        m - private msgs, notices and ctcps to the bot  #        m - private msgs, notices and ctcps to the bot
1294  #        o - misc info, errors, etc (IMPORTANT STUFF)  #        o - misc info, errors, etc (IMPORTANT STUFF)
1295  #        p - public text on the channel  #        p - public text on the channel
1296  #        r - raw incoming server traffic  #        r - raw incoming server traffic
1297  #        s - server connects, disconnects, and notices  #        s - server connects, disconnects, and notices
1298  #        t - raw botnet traffic  #        t - raw botnet traffic
1299  #        v - raw outgoing server traffic  #        v - raw outgoing server traffic
1300  #        w - wallops (make sure the bot sets +w in init-server)  #        w - wallops (make sure the bot sets +w in init-server)
1301  #        x - file transfers and file-area commands  #        x - file transfers and file-area commands
1302  #    Returns: filename of logfile created, or, if no logfile is specified, a  #    Returns: filename of logfile created, or, if no logfile is specified, a
1303  #      list of logfiles such as: {mco * eggdrop.log} {jp #lame lame.log}  #      list of logfiles such as: {mco * eggdrop.log} {jp #lame lame.log}
1304  #    Module: core  #    Module: core
1305    
1306  #  maskhost <nick!user@host>  #  maskhost <nick!user@host>
1307  #    Returns: masked hostmask for the string given ("n!u@1.2.3.4" -> "*!u@1.2.3.*",  #    Returns: masked hostmask for the string given ("n!u@1.2.3.4" -> "*!u@1.2.3.*",
1308  #      "n!u@lame.com" -> "*!u@lame.com", "n!u@a.b.edu" -> "*!u@*.b.edu")  #      "n!u@lame.com" -> "*!u@lame.com", "n!u@a.b.edu" -> "*!u@*.b.edu")
1309  #    Module: core  #    Module: core
1310    
1311  #  timer <minutes> <tcl-command>  #  timer <minutes> <tcl-command>
1312  #    Description: executes the given Tcl command after a certain number of  #    Description: executes the given Tcl command after a certain number of
1313  #      minutes have passed  #      minutes have passed
1314  #    Returns: a timerID  #    Returns: a timerID
1315  #    Module: core  #    Module: core
1316    
1317  #  utimer <seconds> <tcl-command>  #  utimer <seconds> <tcl-command>
1318  #    Description: executes the given Tcl command after a certain number of  #    Description: executes the given Tcl command after a certain number of
1319  #      seconds have passed  #      seconds have passed
1320  #    Returns: a timerID  #    Returns: a timerID
1321  #    Module: core  #    Module: core
1322    
1323  #  timers  #  timers
1324  #    Returns: a list of active minutely timers. Each entry in the list contains  #    Returns: a list of active minutely timers. Each entry in the list contains
1325  #      the number of minutes left till activation, the command that will be  #      the number of minutes left till activation, the command that will be
1326  #      executed, and the timerID.  #      executed, and the timerID.
1327  #    Module: core  #    Module: core
1328    
1329  #  utimers  #  utimers
1330  #    Returns: a list of active secondly timers. Each entry in the list contains  #    Returns: a list of active secondly timers. Each entry in the list contains
1331  #      the number of minutes left till activation, the command that will be  #      the number of minutes left till activation, the command that will be
1332  #      executed, and the timerID.  #      executed, and the timerID.
1333  #    Module: core  #    Module: core
1334    
1335  #  killtimer <timerID>  #  killtimer <timerID>
1336  #    Description: removes a minutely timer from the list  #    Description: removes a minutely timer from the list
1337  #    Returns: nothing  #    Returns: nothing
1338  #    Module: core  #    Module: core
1339    
1340  #  killutimer <timerID>  #  killutimer <timerID>
1341  #    Description: removes a secondly timer from the list  #    Description: removes a secondly timer from the list
1342  #    Returns: nothing  #    Returns: nothing
1343  #    Module: core  #    Module: core
1344    
1345    unixtime    unixtime
1346      Returns: a long integer which represents the number of seconds that have      Returns: a long integer which represents the number of seconds that have
1347        passed since 00:00 Jan 1, 1970 (GMT).        passed since 00:00 Jan 1, 1970 (GMT).
1348      Module: core      Module: core
1349    
1350  #  duration <seconds>  #  duration <seconds>
1351  #    Returns: the number of seconds converted into years, weeks, days, hours,  #    Returns: the number of seconds converted into years, weeks, days, hours,
1352  #      minutes, and seconds. 804600 seconds is turned into 1 week 2 days  #      minutes, and seconds. 804600 seconds is turned into 1 week 2 days
1353  #      7 hours 30 minutes.  #      7 hours 30 minutes.
1354  #    Module: core  #    Module: core
1355    
1356    strftime <formatstring> [time]    strftime <formatstring> [time]
1357      Returns: a formatted string of time using standard strftime format.      Returns: a formatted string of time using standard strftime format.
1358        If time is specified, the value of the specified time is used.        If time is specified, the value of the specified time is used.
1359        Otherwise, the current time is used.        Otherwise, the current time is used.
1360      Module: core      Module: core
1361    
1362  #  ctime <unixtime>  #  ctime <unixtime>
1363  #    Returns: a formatted date/time string based on the current locale  #    Returns: a formatted date/time string based on the current locale
1364  #      settings from the unixtime string given; for example "Fri Aug 3  #      settings from the unixtime string given; for example "Fri Aug 3
1365  #      11:34:55 1973"  #      11:34:55 1973"
1366  #    Module: core  #    Module: core
1367    
1368  #  myip  #  myip
1369  #    Returns: a long number representing the bot's IP address, as it might  #    Returns: a long number representing the bot's IP address, as it might
1370  #      appear in (for example) a DCC request  #      appear in (for example) a DCC request
1371  #    Module: core  #    Module: core
1372    
1373    rand <limit>    rand <limit>
1374      Returns: a random integer between 0 and limit-1      Returns: a random integer between 0 and limit-1
1375      Module: core      Module: core
1376    
1377  #  control <idx> <command>  #  control <idx> <command>
1378  #    Description: removes an idx from the party line and sends all future  #    Description: removes an idx from the party line and sends all future
1379  #      input to the Tcl command given. The command will be called with two  #      input to the Tcl command given. The command will be called with two
1380  #      parameters: the idx and the input text. The command should return 0  #      parameters: the idx and the input text. The command should return 0
1381  #      to indicate success and 1 to indicate that it relinquishes control of  #      to indicate success and 1 to indicate that it relinquishes control of
1382  #      the user back to the bot. If the input text is blank (""), it  #      the user back to the bot. If the input text is blank (""), it
1383  #      indicates that the connection has been dropped. Also, if the input  #      indicates that the connection has been dropped. Also, if the input
1384  #      text is blank, never call killdcc on it, as it will fail with "invalid  #      text is blank, never call killdcc on it, as it will fail with "invalid
1385  #      idx".  #      idx".
1386  #    Returns: nothing  #    Returns: nothing
1387  #    Module: core  #    Module: core
1388    
1389  #  sendnote <from> <to[@bot]> <message>  #  sendnote <from> <to[@bot]> <message>
1390  #    Description: simulates what happens when one user sends a note to another  #    Description: simulates what happens when one user sends a note to another
1391  #    Returns:  #    Returns:
1392  #      0 - the send failed  #      0 - the send failed
1393  #      1 - the note was delivered locally or sent to another bot  #      1 - the note was delivered locally or sent to another bot
1394  #      2 - the note was stored locally  #      2 - the note was stored locally
1395  #      3 - the user's notebox is too full to store a note  #      3 - the user's notebox is too full to store a note
1396  #      4 - a Tcl binding caught the note  #      4 - a Tcl binding caught the note
1397  #      5 - the note was stored because the user is away  #      5 - the note was stored because the user is away
1398  #    Module: core  #    Module: core
1399    
1400  #  link [via-bot] <bot>  #  link [via-bot] <bot>
1401  #    Description: attempts to link to another bot directly. If you specify  #    Description: attempts to link to another bot directly. If you specify
1402  #      a via-bot, it tells the via-bot to attempt the link.  #      a via-bot, it tells the via-bot to attempt the link.
1403  #    Returns: 1 if the link will be attempted; 0 otherwise  #    Returns: 1 if the link will be attempted; 0 otherwise
1404  #    Module: core  #    Module: core
1405    
1406  #  unlink <bot>  #  unlink <bot>
1407  #    Description: attempts to unlink a bot from the botnet  #    Description: attempts to unlink a bot from the botnet
1408  #    Returns: 1 on success; 0 otherwise  #    Returns: 1 on success; 0 otherwise
1409  #    Module: core  #    Module: core
1410    
1411  #  encrypt <key> <string>  #  encrypt <key> <string>
1412  #    Returns: encrypted string (using the currently loaded encryption module),  #    Returns: encrypted string (using the currently loaded encryption module),
1413  #      encoded into ASCII using base-64  #      encoded into ASCII using base-64
1414  #    Module: encryption  #    Module: encryption
1415    
1416  #  decrypt <key> <encrypted-base64-string>  #  decrypt <key> <encrypted-base64-string>
1417  #    Returns: decrypted string (using the currently loaded encryption module)  #    Returns: decrypted string (using the currently loaded encryption module)
1418  #    Module: encryption  #    Module: encryption
1419    
1420  #  encpass <password>  #  encpass <password>
1421  #    Returns: encrypted string (using the currently loaded encryption module)  #    Returns: encrypted string (using the currently loaded encryption module)
1422  #    Module: encryption (in irc module right now)  #    Module: encryption (in irc module right now)
1423    
1424    die [reason]    die [reason]
1425      Description: causes the bot to log a fatal error and exit completely.      Description: causes the bot to log a fatal error and exit completely.
1426        If no reason is given, "EXIT" is used.        If no reason is given, "EXIT" is used.
1427      Returns: none      Returns: none
1428      Module: core      Module: core
1429    
1430  #  unames  #  unames
1431  #   Returns: the current operating system the bot is using  #   Returns: the current operating system the bot is using
1432  #   Module: core  #   Module: core
1433    
1434  #  dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]  #  dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]
1435  #    Description: This issues an asynchronous dns lookup request. The  #    Description: This issues an asynchronous dns lookup request. The
1436  #      command will block if dns module is not loaded; otherwise it will  #      command will block if dns module is not loaded; otherwise it will
1437  #      either return immediately or immediately call the specified proc  #      either return immediately or immediately call the specified proc
1438  #      (e.g. if the lookup is already cached).  #      (e.g. if the lookup is already cached).
1439  #  #
1440  #      As soon as the request completes, the specified proc will be called  #      As soon as the request completes, the specified proc will be called
1441  #      as follows:  #      as follows:
1442  #  #
1443  #       <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] ... [argN]]  #       <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] ... [argN]]
1444  #  #
1445  #      status is 1 if the lookup was successful and 0 if it wasn't. All  #      status is 1 if the lookup was successful and 0 if it wasn't. All
1446  #      additional parameters (called arg1, arg2 and argN above) get  #      additional parameters (called arg1, arg2 and argN above) get
1447  #      appended to the proc's other parameters.  #      appended to the proc's other parameters.
1448  #    Returns: nothing  #    Returns: nothing
1449  #    Module: core  #    Module: core
1450    
1451  #  md5 <string>  #  md5 <string>
1452  #    Returns: the 128 bit MD5 message-digest of the specified string  #    Returns: the 128 bit MD5 message-digest of the specified string
1453  #    Module: core  #    Module: core
1454    
1455    callevent <event>    callevent <event>
1456      Description: triggers the evnt bind manually for a certain event.      Description: triggers the evnt bind manually for a certain event.
1457        For example: callevent rehash.        For example: callevent rehash.
1458      Returns: nothing      Returns: nothing
1459      Module: core      Module: core
1460    
1461  # traffic  # traffic
1462  #    Returns: a list of sublists containing information about the bot's  #    Returns: a list of sublists containing information about the bot's
1463  #      traffic usage in bytes. Each sublist contains five elements: type,  #      traffic usage in bytes. Each sublist contains five elements: type,
1464  #      in-traffic today, in-traffic total, out-traffic today, out-traffic  #      in-traffic today, in-traffic total, out-traffic today, out-traffic
1465  #      total (in that order).  #      total (in that order).
1466  #    Module: core  #    Module: core
1467    
1468    modules    modules
1469      Returns: a list of sublists containing information about the bot's      Returns: a list of sublists containing information about the bot's
1470        currently loaded modules. Each sublist contains three elements: module,        currently loaded modules. Each sublist contains three elements: module,
1471        version, and dependencies. Each dependency is also a sublist containing        version, and dependencies. Each dependency is also a sublist containing
1472        the module name and version.        the module name and version.
1473      Module: core      Module: core
1474    
1475    loadmodule <module>    loadmodule <module>
1476      Description: attempts to load the specified module.      Description: attempts to load the specified module.
1477      Returns: "Already loaded." if the module is already loaded, "" if      Returns: "Already loaded." if the module is already loaded, "" if
1478        successful, or the reason the module couldn't be loaded.        successful, or the reason the module couldn't be loaded.
1479      Module: core      Module: core
1480    
1481  #  unloadmodule <module>  #  unloadmodule <module>
1482  #    Description: attempts to unload the specified module.  #    Description: attempts to unload the specified module.
1483  #    Returns: "No such module" if the module is not loaded, "" otherwise.  #    Returns: "No such module" if the module is not loaded, "" otherwise.
1484  #    Module: core  #    Module: core
1485    
1486  #  loadhelp <helpfile-name>  #  loadhelp <helpfile-name>
1487  #    Description: attempts to load the specified help file from the help/  #    Description: attempts to load the specified help file from the help/
1488  #      directory.  #      directory.
1489  #    Returns: nothing  #    Returns: nothing
1490  #    Module: core  #    Module: core
1491    
1492  #  unloadhelp <helpfile-name>  #  unloadhelp <helpfile-name>
1493  #    Description: attempts to unload the specified help file.  #    Description: attempts to unload the specified help file.
1494  #    Returns: nothing  #    Returns: nothing
1495  #    Module: core  #    Module: core
1496    
1497  #  reloadhelp  #  reloadhelp
1498  #    Description: reloads the bot's help files.  #    Description: reloads the bot's help files.
1499  #    Returns: nothing  #    Returns: nothing
1500  #    Module: core  #    Module: core
1501    
1502    restart    restart
1503      Description: rehashes the bot, kills all timers, reloads all modules,      Description: rehashes the bot, kills all timers, reloads all modules,
1504        and reconnects the bot to the next server in its list.        and reconnects the bot to the next server in its list.
1505      Returns: nothing      Returns: nothing
1506      Module: core      Module: core
1507    
1508    rehash    rehash
1509      Description: rehashes the bot      Description: rehashes the bot
1510      Returns: nothing      Returns: nothing
1511      Module: core      Module: core
1512    
1513    
1514  *** GLOBAL VARIABLES ***  *** GLOBAL VARIABLES ***
1515    
1516    NOTE: All config file variables are also global.    NOTE: All config file variables are also global.
1517    
1518    botnick    botnick
1519      Value: the current nickname the bot is using (for example: "Valis",      Value: the current nickname the bot is using (for example: "Valis",
1520        "Valis0", etc.)        "Valis0", etc.)
1521      Module: server      Module: server
1522    
1523    botname    botname
1524      Value: the current nick!user@host that the server sees (for example:      Value: the current nick!user@host that the server sees (for example:
1525        "Valis!valis@crappy.com")        "Valis!valis@crappy.com")
1526      Module: server      Module: server
1527    
1528  | server  | server
1529  |   Value: the current server's real name (what server calls itself)  |   Value: the current server's real name (what server calls itself)
1530  |     and port bot is connected to (for example: "irc.math.ufl.edu:6667")  |     and port bot is connected to (for example: "irc.math.ufl.edu:6667")
1531  |     Note that this does not nececerilly match the servers internet address.  |     Note that this does not nececerilly match the servers internet address.
1532  |   Module: server  |   Module: server
1533  # FixMe: I currently use "real-server" for this in Tcldrop.  Change!  # FixMe: I currently use "real-server" for this in Tcldrop.  Change!
1534    
1535  | serveraddress  | serveraddress
1536  |   Value: the current server's internet address (hostname or IP) and port bot  |   Value: the current server's internet address (hostname or IP) and port bot
1537  |     is connected to. This will correspond to the entry in server list (for  |     is connected to. This will correspond to the entry in server list (for
1538  |     example: "eu.undernet.org:6667"). Note that this does not necessarily  |     example: "eu.undernet.org:6667"). Note that this does not necessarily
1539  |     match the name server calls itself.  |     match the name server calls itself.
1540  |   Module: server  |   Module: server
1541  # FixMe: I currently use "server" for this in Tcldrop.  Change!  # FixMe: I currently use "server" for this in Tcldrop.  Change!
1542    
1543  #  version  #  version
1544  #    Value: current bot version "1.1.2+pl1 1010201 pl1";  #    Value: current bot version "1.1.2+pl1 1010201 pl1";
1545  #      first item is the text version, second item is a numerical version,  #      first item is the text version, second item is a numerical version,
1546  #      and any following items are the names of patches that have been added  #      and any following items are the names of patches that have been added
1547  #    Module: core  #    Module: core
1548    
1549  #  numversion  #  numversion
1550  #    Value: the current numeric bot version (for example: "1010201").  #    Value: the current numeric bot version (for example: "1010201").
1551  #      Numerical version is in the format of "MNNRRPP", where:  #      Numerical version is in the format of "MNNRRPP", where:
1552  #        M   major release number  #        M   major release number
1553  #        NN  minor release number  #        NN  minor release number
1554  #        RR  sub-release number  #        RR  sub-release number
1555  #        PP  patch level for that sub-release  #        PP  patch level for that sub-release
1556  #    Module: core  #    Module: core
1557    
1558  #  uptime  #  uptime
1559  #    Value: the unixtime value for when the bot was started  #    Value: the unixtime value for when the bot was started
1560  #    Module: core  #    Module: core
1561    
1562  #  server-online  #  server-online
1563  #     Value: the unixtime value for when the bot connected to its current  #     Value: the unixtime value for when the bot connected to its current
1564  #       server  #       server
1565  #     Module: server  #     Module: server
1566    
1567  #  lastbind  #  lastbind
1568  #    Value: the last command binding which was triggered. This allows you to  #    Value: the last command binding which was triggered. This allows you to
1569  #      identify which command triggered a Tcl proc.  #      identify which command triggered a Tcl proc.
1570  #    Module: core  #    Module: core
1571    
1572  #  isjuped  #  isjuped
1573  #    Value: 1 if bot's nick is juped(437); 0 otherwise  #    Value: 1 if bot's nick is juped(437); 0 otherwise
1574  #    Module: server  #    Module: server
1575    
1576  #  handlen  #  handlen
1577  #    Value: the value of the HANDLEN define in src/eggdrop.h  #    Value: the value of the HANDLEN define in src/eggdrop.h
1578  #    Module: core  #    Module: core
1579    
1580    config    config
1581      Value: the filename of the config file Eggdrop is currently using      Value: the filename of the config file Eggdrop is currently using
1582      Module: core      Module: core
1583    
1584  *** BIND ***  *** BIND ***
1585    
1586    You can use the 'bind' command to attach Tcl procedures to certain events.    You can use the 'bind' command to attach Tcl procedures to certain events.
1587    For example, you can write a Tcl procedure that gets called every time a    For example, you can write a Tcl procedure that gets called every time a
1588    user says "danger" on the channel.    user says "danger" on the channel.
1589    
1590    Some bind types are marked as "stackable". That means that you can bind    Some bind types are marked as "stackable". That means that you can bind
1591    multiple commands to the same trigger. Normally, for example, a bind such    multiple commands to the same trigger. Normally, for example, a bind such
1592    as 'bind msg - stop msg:stop' (which makes a msg-command "stop" call the    as 'bind msg - stop msg:stop' (which makes a msg-command "stop" call the
1593    Tcl proc "msg:stop") will overwrite any previous binding you had for the    Tcl proc "msg:stop") will overwrite any previous binding you had for the
1594    msg command "stop". With stackable bindings, like 'msgm' for example,    msg command "stop". With stackable bindings, like 'msgm' for example,
1595    you can bind the same command to multiple procs. When the bind is triggered,    you can bind the same command to multiple procs. When the bind is triggered,
1596    ALL of the Tcl procs that are bound to it will be called.    ALL of the Tcl procs that are bound to it will be called.
1597    
1598    To remove a bind, use the 'unbind' command. For example, to remove the    To remove a bind, use the 'unbind' command. For example, to remove the
1599    bind for the "stop" msg command, use 'unbind msg - stop msg:stop'.    bind for the "stop" msg command, use 'unbind msg - stop msg:stop'.
1600    
1601    (A) BIND TYPES    (A) BIND TYPES
1602    
1603      The following is a list of bind types and how they work. Below each bind      The following is a list of bind types and how they work. Below each bind
1604      type is the format of the bind command, the list of arguments sent to      type is the format of the bind command, the list of arguments sent to
1605      the Tcl proc, and an explanation.      the Tcl proc, and an explanation.
1606    
1607      (1)  MSG      (1)  MSG
1608           bind msg <flags> <command> <proc>           bind msg <flags> <command> <proc>
1609           procname <nick> <user@host> <handle> <text>           procname <nick> <user@host> <handle> <text>
1610    
1611           Description: used for /msg commands. The first word of the user's           Description: used for /msg commands. The first word of the user's
1612             msg is the command, and everything else becomes the text argument.             msg is the command, and everything else becomes the text argument.
1613           Module: server           Module: server
1614    
1615      (2)  DCC      (2)  DCC
1616           bind dcc <flags> <command> <proc>           bind dcc <flags> <command> <proc>
1617           procname <handle> <idx> <text>           procname <handle> <idx> <text>
1618    
1619           Description: used for partyline commands; the command is the first           Description: used for partyline commands; the command is the first
1620             word and everything else becomes the text argument. The idx is             word and everything else becomes the text argument. The idx is
1621             valid until the user disconnects. After that, it may be reused,             valid until the user disconnects. After that, it may be reused,
1622             so be careful about storing an idx for long periods of time.             so be careful about storing an idx for long periods of time.
1623           Module: core           Module: core
1624    
1625  #    (3)  FIL  #    (3)  FIL
1626  #         bind fil <flags> <command> <proc>  #         bind fil <flags> <command> <proc>
1627  #         procname <handle> <idx> <text>  #         procname <handle> <idx> <text>
1628  #  #
1629  #         Description: the same as DCC, except this is triggered if the user  #         Description: the same as DCC, except this is triggered if the user
1630  #           is in the file area instead of the party line  #           is in the file area instead of the party line
1631  #         Module: filesys  #         Module: filesys
1632    
1633      (4)  PUB      (4)  PUB
1634           bind pub <flags> <command> <proc>           bind pub <flags> <command> <proc>
1635           procname <nick> <user@host> <handle> <channel> <text>           procname <nick> <user@host> <handle> <channel> <text>
1636    
1637           Description: used for commands given on a channel. The first word           Description: used for commands given on a channel. The first word
1638             becomes the command and everything else is the text argument.             becomes the command and everything else is the text argument.
1639           Module: irc           Module: irc
1640    
1641      (5)  MSGM (stackable)      (5)  MSGM (stackable)
1642           bind msgm <flags> <mask> <proc>           bind msgm <flags> <mask> <proc>
1643           procname <nick> <user@host> <handle> <text>           procname <nick> <user@host> <handle> <text>
1644    
1645           Description: matches the entire line of text from a /msg with the           Description: matches the entire line of text from a /msg with the
1646             mask. This is useful for binding Tcl procs to words or phrases             mask. This is useful for binding Tcl procs to words or phrases
1647             spoken anywhere within a line of text.             spoken anywhere within a line of text.
1648           Module: server           Module: server
1649    
1650      (6)  PUBM (stackable)      (6)  PUBM (stackable)
1651           bind pubm <flags> <mask> <proc>           bind pubm <flags> <mask> <proc>
1652           procname <nick> <user@host> <handle> <channel> <text>           procname <nick> <user@host> <handle> <channel> <text>
1653    
1654           Description: just like MSGM, except it's triggered by things said           Description: just like MSGM, except it's triggered by things said
1655             on a channel instead of things /msg'd to the bot. The mask is             on a channel instead of things /msg'd to the bot. The mask is
1656             matched against the channel name followed by the text and can             matched against the channel name followed by the text and can
1657             contain wildcards. Also, if a line triggers a PUB bind, it will not             contain wildcards. Also, if a line triggers a PUB bind, it will not
1658             trigger a PUBM bind.             trigger a PUBM bind.
1659           Module: irc           Module: irc
1660    
1661  #    (7)  NOTC (stackable)  #    (7)  NOTC (stackable)
1662  #         bind notc <flags> <mask> <proc>  #         bind notc <flags> <mask> <proc>
1663  #         procname <nick> <user@host> <handle> <text> <dest>  #         procname <nick> <user@host> <handle> <text> <dest>
1664  #  #
1665  #         Description: dest will be a nickname (the bot's nickname,  #         Description: dest will be a nickname (the bot's nickname,
1666  #           obviously) or a channel name. mask is matched against the entire  #           obviously) or a channel name. mask is matched against the entire
1667  #           notice and can contain wildcards. It is considered a breach of  #           notice and can contain wildcards. It is considered a breach of
1668  #           protocol to respond to a /notice on IRC, so this is intended for  #           protocol to respond to a /notice on IRC, so this is intended for
1669  #           internal use (logging, etc.) only. Note that server notices do not  #           internal use (logging, etc.) only. Note that server notices do not
1670  #           trigger the NOTC bind.  #           trigger the NOTC bind.
1671  #  #
1672  #           New Tcl procs should be declared as  #           New Tcl procs should be declared as
1673  #             proc notcproc {nick uhost hand text {dest ""}} {  #             proc notcproc {nick uhost hand text {dest ""}} {
1674  #               global botnick; if {$dest == ""} {set dest $botnick}  #               global botnick; if {$dest == ""} {set dest $botnick}
1675  #               ...  #               ...
1676  #             }  #             }
1677  #           for compatibility.  #           for compatibility.
1678  #         Module: server  #         Module: server
1679    
1680  #    (8)  JOIN (stackable)  #    (8)  JOIN (stackable)
1681  #         bind join <flags> <mask> <proc>  #         bind join <flags> <mask> <proc>
1682  #         procname <nick> <user@host> <handle> <channel>  #         procname <nick> <user@host> <handle> <channel>
1683  #  #
1684  #         Description: triggered by someone joining the channel. The mask in  #         Description: triggered by someone joining the channel. The mask in
1685  #           the bind is matched against "#channel nick!user@host" and can  #           the bind is matched against "#channel nick!user@host" and can
1686  #           contain wildcards.  #           contain wildcards.
1687  #         Module: irc  #         Module: irc
1688    
1689  #    (9)  PART (stackable)  #    (9)  PART (stackable)
1690  #         bind part <flags> <mask> <proc>  #         bind part <flags> <mask> <proc>
1691  #         procname <nick> <user@host> <handle> <channel> <msg>  #         procname <nick> <user@host> <handle> <channel> <msg>
1692  #  #
1693  #         Description: triggered by someone leaving the channel. The mask is  #         Description: triggered by someone leaving the channel. The mask is
1694  #           matched against "#channel nick!user@host" and can contain  #           matched against "#channel nick!user@host" and can contain
1695  #           wildcards. If no part message is specified, msg will be set  #           wildcards. If no part message is specified, msg will be set
1696  #           to "".  #           to "".
1697  #  #
1698  #           New Tcl procs should be declared as  #           New Tcl procs should be declared as
1699  #             proc partproc {nick uhost hand chan {msg ""}} { ... }  #             proc partproc {nick uhost hand chan {msg ""}} { ... }
1700  #           for compatibility.  #           for compatibility.
1701  #         Module: irc  #         Module: irc
1702    
1703  #    (10) SIGN (stackable)  #    (10) SIGN (stackable)
1704  #         bind sign <flags> <mask> <proc>  #         bind sign <flags> <mask> <proc>
1705  #         procname <nick> <user@host> <handle> <channel> <reason>  #         procname <nick> <user@host> <handle> <channel> <reason>
1706  #  #
1707  #         Description: triggered by a signoff, or possibly by someone who got  #         Description: triggered by a signoff, or possibly by someone who got
1708  #           netsplit and never returned. The signoff message is the last  #           netsplit and never returned. The signoff message is the last
1709  #           argument to the proc. Wildcards can be used in the mask, which is  #           argument to the proc. Wildcards can be used in the mask, which is
1710  #           matched against '#channel nick!user@host'.  #           matched against '#channel nick!user@host'.
1711  #         Module: irc  #         Module: irc
1712    
1713  #    (11) TOPC (stackable)  #    (11) TOPC (stackable)
1714  #         bind topc <flags> <mask> <proc>  #         bind topc <flags> <mask> <proc>
1715  #         procname <nick> <user@host> <handle> <channel> <topic>  #         procname <nick> <user@host> <handle> <channel> <topic>
1716  #  #
1717  #         Description: triggered by a topic change. mask can contain wildcards  #         Description: triggered by a topic change. mask can contain wildcards
1718  #           and is matched against '#channel <new topic>'.  #           and is matched against '#channel <new topic>'.
1719  #         Module: irc  #         Module: irc
1720    
1721  #    (12) KICK (stackable)  #    (12) KICK (stackable)
1722  #         bind kick <flags> <mask> <proc>  #         bind kick <flags> <mask> <proc>
1723  #         procname <nick> <user@host> <handle> <channel> <target> <reason>  #         procname <nick> <user@host> <handle> <channel> <target> <reason>
1724  #  #
1725  #         Description: triggered when someone is kicked off the channel. The  #         Description: triggered when someone is kicked off the channel. The
1726  #           mask is matched against '#channel target' where the target is  #           mask is matched against '#channel target' where the target is
1727  #           the nickname of the person who got kicked (can contain wildcards).  #           the nickname of the person who got kicked (can contain wildcards).
1728  #           The proc is called with the nick, user@host, and handle of the  #           The proc is called with the nick, user@host, and handle of the
1729  #           kicker, plus the channel, the nickname of the person who was  #           kicker, plus the channel, the nickname of the person who was
1730  #           kicked, and the reason; flags are ignored.  #           kicked, and the reason; flags are ignored.
1731  #         Module: irc  #         Module: irc
1732    
1733  #    (13) NICK (stackable)  #    (13) NICK (stackable)
1734  #         bind nick <flags> <mask> <proc>  #         bind nick <flags> <mask> <proc>
1735  #         procname <nick> <user@host> <handle> <channel> <newnick>  #         procname <nick> <user@host> <handle> <channel> <newnick>
1736  #  #
1737  #         Description: triggered when someone changes nicknames. The mask  #         Description: triggered when someone changes nicknames. The mask
1738  #           is matched against '#channel newnick' and can contain wildcards.  #           is matched against '#channel newnick' and can contain wildcards.
1739  #|          Channel is "*" if the user isn't on a channel (usually the bot not  #|          Channel is "*" if the user isn't on a channel (usually the bot not
1740  #|          yet in a channel).  #|          yet in a channel).
1741  #         Module: irc  #         Module: irc
1742    
1743  #    (14) MODE   (stackable)  #    (14) MODE   (stackable)
1744  #         bind mode <flags> <mask> <proc>  #         bind mode <flags> <mask> <proc>
1745  #         proc-name <nick> <user@host> <handle> <channel> <mode-change> <victim>  #         proc-name <nick> <user@host> <handle> <channel> <mode-change> <victim>
1746  #  #
1747  #         Description: mode changes are broken down into their component  #         Description: mode changes are broken down into their component
1748  #           parts before being sent here, so the <mode-change> will always  #           parts before being sent here, so the <mode-change> will always
1749  #           be a single mode, such as "+m" or "-o". victim will show the  #           be a single mode, such as "+m" or "-o". victim will show the
1750  #           argument of the mode change (for o/v/b/e/I) or "" if the set  #           argument of the mode change (for o/v/b/e/I) or "" if the set
1751  #           mode does not take an argument. Flags are ignored. The bot's  #           mode does not take an argument. Flags are ignored. The bot's
1752  #           automatic response to a mode change will happen AFTER all  #           automatic response to a mode change will happen AFTER all
1753  #           matching Tcl procs are called. The mask will be matched against  #           matching Tcl procs are called. The mask will be matched against
1754  #           '#channel +/-modes' and can contain wildcards.  #           '#channel +/-modes' and can contain wildcards.
1755  #  #
1756  #           If it is a server mode, nick will be "", user@host is the server  #           If it is a server mode, nick will be "", user@host is the server
1757  #           name, and handle is *.  #           name, and handle is *.
1758  #  #
1759  #           Note that "victim" was added in 1.3.23 and that this will break  #           Note that "victim" was added in 1.3.23 and that this will break
1760  #           Tcl scripts that were written for pre-1.3.23 versions and use this  #           Tcl scripts that were written for pre-1.3.23 versions and use this
1761  #           binding. An easy fix (by guppy) is as follows (example):  #           binding. An easy fix (by guppy) is as follows (example):
1762  #  #
1763  #           Old script looks as follows:  #           Old script looks as follows:
1764  #             bind mode - * mode_proc  #             bind mode - * mode_proc
1765  #             proc mode_proc {nick uhost hand chan mc} { ... }  #             proc mode_proc {nick uhost hand chan mc} { ... }
1766  #  #
1767  #           To make it work with 1.3.23+ and stay compatible with older bots, do:  #           To make it work with 1.3.23+ and stay compatible with older bots, do:
1768  #             bind mode - * mode_proc_fix  #             bind mode - * mode_proc_fix
1769  #             proc mode_proc_fix {nick uhost hand chan mc {victim ""}} {  #             proc mode_proc_fix {nick uhost hand chan mc {victim ""}} {
1770  #               if {$victim != ""} {append mc " $victim"}  #               if {$victim != ""} {append mc " $victim"}
1771  #               mode_proc $nick $uhost $hand $chan $mc  #               mode_proc $nick $uhost $hand $chan $mc
1772  #             }  #             }
1773  #             proc mode_proc {nick uhost hand chan mc} { ... }  #             proc mode_proc {nick uhost hand chan mc} { ... }
1774  #         Module: irc  #         Module: irc
1775    
1776  #    (15) CTCP (stackable)  #    (15) CTCP (stackable)
1777  #         bind ctcp <flags> <keyword> <proc>  #         bind ctcp <flags> <keyword> <proc>
1778  #         proc-name <nick> <user@host> <handle> <dest> <keyword> <text>  #         proc-name <nick> <user@host> <handle> <dest> <keyword> <text>
1779  #  #
1780  #         Description: dest will be a nickname (the bot's nickname, obviously)  #         Description: dest will be a nickname (the bot's nickname, obviously)
1781  #           or channel name. keyword is the ctcp command (which can contain  #           or channel name. keyword is the ctcp command (which can contain
1782  #           wildcards), and text may be empty. If the proc returns 0, the bot  #           wildcards), and text may be empty. If the proc returns 0, the bot
1783  #           will attempt its own processing of the ctcp command.  #           will attempt its own processing of the ctcp command.
1784  #         Module: server  #         Module: server
1785    
1786  #    (16) CTCR (stackable)  #    (16) CTCR (stackable)
1787  #         bind ctcr <flags> <keyword> <proc>  #         bind ctcr <flags> <keyword> <proc>
1788  #         proc-name <nick> <user@host> <handle> <dest> <keyword> <text>  #         proc-name <nick> <user@host> <handle> <dest> <keyword> <text>
1789  #  #
1790  #         Description: just like ctcp, but this is triggered for a ctcp-reply  #         Description: just like ctcp, but this is triggered for a ctcp-reply
1791  #           (ctcp embedded in a notice instead of a privmsg)  #           (ctcp embedded in a notice instead of a privmsg)
1792  #         Module: server  #         Module: server
1793  #  #
1794      (17) RAW (stackable)      (17) RAW (stackable)
1795           bind raw <flags> <keyword-mask> <proc>           bind raw <flags> <keyword-mask> <proc>
1796           procname <from> <keyword> <text>           procname <from> <keyword> <text>
1797    
1798           Description: previous versions of Eggdrop required a special compile           Description: previous versions of Eggdrop required a special compile
1799             option to enable this binding, but it's now standard. The mask             option to enable this binding, but it's now standard. The mask
1800             is checked against the keyword (either a numeric, like "368",             is checked against the keyword (either a numeric, like "368",
1801             or a keyword, like "PRIVMSG"). from will be the server name or             or a keyword, like "PRIVMSG"). from will be the server name or
1802             the source user (depending on the keyword); flags are ignored.             the source user (depending on the keyword); flags are ignored.
1803             The order of the arguments is identical to the order that the             The order of the arguments is identical to the order that the
1804             IRC server sends to the bot. The pre-processing only splits it             IRC server sends to the bot. The pre-processing only splits it
1805             apart enough to determine the keyword. If the proc returns 1,             apart enough to determine the keyword. If the proc returns 1,
1806             Eggdrop will not process the line any further (this could cause             Eggdrop will not process the line any further (this could cause
1807             your bot to behave oddly in some cases).             your bot to behave oddly in some cases).
1808           Module: server           Module: server
1809    
1810  #    (18) BOT  #    (18) BOT
1811  #         bind bot <flags> <command> <proc>  #         bind bot <flags> <command> <proc>
1812  #         proc-name <from-bot> <command> <text>  #         proc-name <from-bot> <command> <text>
1813  #  #
1814  #         Description: triggered by a message coming from another bot in  #         Description: triggered by a message coming from another bot in
1815  #           the botnet. The first word is the command and the rest becomes  #           the botnet. The first word is the command and the rest becomes
1816  #           the text argument; flags are ignored.  #           the text argument; flags are ignored.
1817  #         Module: core  #         Module: core
1818    
1819  #    (19) CHON (stackable)  #    (19) CHON (stackable)
1820  #         bind chon <flags> <mask> <proc>  #         bind chon <flags> <mask> <proc>
1821  #         proc-name <handle> <idx>  #         proc-name <handle> <idx>
1822  #  #
1823  #         Description: when someone first enters the party-line area of the  #         Description: when someone first enters the party-line area of the
1824  #           bot via dcc chat or telnet, this is triggered before they are  #           bot via dcc chat or telnet, this is triggered before they are
1825  #           connected to a chat channel (so, yes, you can change the channel  #           connected to a chat channel (so, yes, you can change the channel
1826  #           in a 'chon' proc). mask is matched against the handle and supports  #           in a 'chon' proc). mask is matched against the handle and supports
1827  #           wildcards. This is NOT triggered when someone returns from the  #           wildcards. This is NOT triggered when someone returns from the
1828  #           file area, etc.  #           file area, etc.
1829  #         Module: core  #         Module: core
1830    
1831  #    (20) CHOF (stackable)  #    (20) CHOF (stackable)
1832  #         bind chof <flags> <mask> <proc>  #         bind chof <flags> <mask> <proc>
1833  #         proc-name <handle> <idx>  #         proc-name <handle> <idx>
1834  #  #
1835  #         Description: triggered when someone leaves the party line to  #         Description: triggered when someone leaves the party line to
1836  #           disconnect from the bot. mask is matched against the handle and  #           disconnect from the bot. mask is matched against the handle and
1837  #           can contain wildcards. Note that the connection may have already  #           can contain wildcards. Note that the connection may have already
1838  #           been dropped by the user, so don't send output to the idx.  #           been dropped by the user, so don't send output to the idx.
1839  #         Module: core  #         Module: core
1840    
1841  #    (21) SENT (stackable)  #    (21) SENT (stackable)
1842  #         bind sent <flags> <mask> <proc>  #         bind sent <flags> <mask> <proc>
1843  #         proc-name <handle> <nick> <path/to/file>  #         proc-name <handle> <nick> <path/to/file>
1844  #  #
1845  #         Description: after a user has successfully downloaded a file from  #         Description: after a user has successfully downloaded a file from
1846  #           the bot, this binding is triggered. mask is matched against the  #           the bot, this binding is triggered. mask is matched against the
1847  #           handle of the user that initiated the transfer and supports  #           handle of the user that initiated the transfer and supports
1848  #           wildcards. nick is the actual recipient (on IRC) of the file. The  #           wildcards. nick is the actual recipient (on IRC) of the file. The
1849  #           path is relative to the dcc directory (unless the file transfer  #           path is relative to the dcc directory (unless the file transfer
1850  #           was started by a script call to 'dccsend', in which case the path  #           was started by a script call to 'dccsend', in which case the path
1851  #           is the exact path given in the call to 'dccsend').  #           is the exact path given in the call to 'dccsend').
1852  #         Module: transfer  #         Module: transfer
1853    
1854  #    (22) RCVD (stackable)  #    (22) RCVD (stackable)
1855  #         bind rcvd <flags> <mask> <proc>  #         bind rcvd <flags> <mask> <proc>
1856  #         proc-name <handle> <nick> <path/to/file>  #         proc-name <handle> <nick> <path/to/file>
1857  #  #
1858  #         Description: triggered after a user uploads a file successfully.  #         Description: triggered after a user uploads a file successfully.
1859  #           mask is matched against the user's handle. nick is the IRC  #           mask is matched against the user's handle. nick is the IRC
1860  #           nickname that the file transfer originated from. The path is  #           nickname that the file transfer originated from. The path is
1861  #           where the file ended up, relative to the dcc directory (usually  #           where the file ended up, relative to the dcc directory (usually
1862  #           this is your incoming dir).  #           this is your incoming dir).
1863  #         Module: transfer  #         Module: transfer
1864    
1865  #    (23) CHAT (stackable)  #    (23) CHAT (stackable)
1866  #         bind chat <flags> <mask> <proc>  #         bind chat <flags> <mask> <proc>
1867  #         proc-name <handle> <channel#> <text>  #         proc-name <handle> <channel#> <text>
1868  #  #
1869  #         Description: when someone says something on the botnet, it invokes  #         Description: when someone says something on the botnet, it invokes
1870  #           this binding. Flags are ignored; handle could be a user on this  #           this binding. Flags are ignored; handle could be a user on this
1871  #           bot ("DronePup") or on another bot ("Eden@Wilde") and therefore  #           bot ("DronePup") or on another bot ("Eden@Wilde") and therefore
1872  #           you can't rely on a local user record. The mask is checked against  #           you can't rely on a local user record. The mask is checked against
1873  #           the entire line of text and supports wildcards.  #           the entire line of text and supports wildcards.
1874  #         Module: core  #         Module: core
1875    
1876  #    (24) LINK (stackable)  #    (24) LINK (stackable)
1877  #         bind link <flags> <mask> <proc>  #         bind link <flags> <mask> <proc>
1878  #         proc-name <botname> <via>  #         proc-name <botname> <via>
1879  #  #
1880  #         Description: triggered when a bot links into the botnet. botname  #         Description: triggered when a bot links into the botnet. botname
1881  #           is the botnetnick of the bot that just linked in; via is the bot  #           is the botnetnick of the bot that just linked in; via is the bot
1882  #           it linked through. The mask is checked against the botnetnick of  #           it linked through. The mask is checked against the botnetnick of
1883  #           the bot that linked and supports wildcards. flags are ignored.  #           the bot that linked and supports wildcards. flags are ignored.
1884  #         Module: core  #         Module: core
1885    
1886  #    (25) DISC (stackable)  #    (25) DISC (stackable)
1887  #         bind disc <flags> <mask> <proc>  #         bind disc <flags> <mask> <proc>
1888  #         proc-name <botname>  #         proc-name <botname>
1889  #  #
1890  #         Description: triggered when a bot disconnects from the botnet for  #         Description: triggered when a bot disconnects from the botnet for
1891  #           whatever reason. Just like the link bind, flags are ignored; mask  #           whatever reason. Just like the link bind, flags are ignored; mask
1892  #           is matched against the botnetnick of the bot that unlinked.  #           is matched against the botnetnick of the bot that unlinked.
1893  #           Wildcards are supported in mask.  #           Wildcards are supported in mask.
1894  #         Module: core  #         Module: core
1895    
1896  #   (26) SPLT (stackable)  #   (26) SPLT (stackable)
1897  #         bind splt <flags> <mask> <proc>  #         bind splt <flags> <mask> <proc>
1898  #         procname <nick> <user@host> <handle> <channel>  #         procname <nick> <user@host> <handle> <channel>
1899  #         Description: triggered when someone gets netsplit on the channel.  #         Description: triggered when someone gets netsplit on the channel.
1900  #         Be aware that this may be a false alarm (it's easy to fake a  #         Be aware that this may be a false alarm (it's easy to fake a
1901  #           netsplit signoff message on some networks); mask may contain  #           netsplit signoff message on some networks); mask may contain
1902  #           wildcards and is matched against '#channel nick!user@host'.  #           wildcards and is matched against '#channel nick!user@host'.
1903  #           Anyone who is SPLT will trigger a REJN or SIGN within the next  #           Anyone who is SPLT will trigger a REJN or SIGN within the next
1904  #         wait-split (defined in the config file) minutes.  #         wait-split (defined in the config file) minutes.
1905  #         Module: irc  #         Module: irc
1906    
1907  #    (27) REJN (stackable)  #    (27) REJN (stackable)
1908  #         bind rejn <flags> <mask> <proc>  #         bind rejn <flags> <mask> <proc>
1909  #         procname <nick> <user@host> <handle> <channel>  #         procname <nick> <user@host> <handle> <channel>
1910  #  #
1911  #         Description: someone who was split has rejoined. mask can contain  #         Description: someone who was split has rejoined. mask can contain
1912  #           wildcards, and is matched against '#channel nick!user@host'.  #           wildcards, and is matched against '#channel nick!user@host'.
1913  #         Module: irc  #         Module: irc
1914    
1915  #    (28) FILT (stackable)  #    (28) FILT (stackable)
1916  #         bind filt <flags> <mask> <proc>  #         bind filt <flags> <mask> <proc>
1917  #         procname <idx> <text>  #         procname <idx> <text>
1918  #  #
1919  #         Description: party line and file system users have their text sent  #         Description: party line and file system users have their text sent
1920  #           through filt before being processed. If the proc returns a blank  #           through filt before being processed. If the proc returns a blank
1921  #           string, the text is considered parsed. Otherwise, the bot will use  #           string, the text is considered parsed. Otherwise, the bot will use
1922  #           the text returned from the proc and continue parsing that  #           the text returned from the proc and continue parsing that
1923  #         Module: core  #         Module: core
1924    
1925  #    (29) NEED (stackable)  #    (29) NEED (stackable)
1926  #         bind need <flags> <mask> <proc>  #         bind need <flags> <mask> <proc>
1927  #         procname <channel> <type>  #         procname <channel> <type>
1928  #  #
1929  #         Description: this bind is triggered on certain events, like when  #         Description: this bind is triggered on certain events, like when
1930  #           the bot needs operator status or the key for a channel. The  #           the bot needs operator status or the key for a channel. The
1931  #           types are: op, unban, invite, limit, and key; the mask is  #           types are: op, unban, invite, limit, and key; the mask is
1932  #           matched against '#channel type' and can contain wildcards. flags  #           matched against '#channel type' and can contain wildcards. flags
1933  #           are ignored.  #           are ignored.
1934  #  #
1935  #           Example:  #           Example:
1936  #             bind need - "% op" needop < handles only need op  #             bind need - "% op" needop < handles only need op
1937  #             bind need - "*" needall   < handles all needs  #             bind need - "*" needall   < handles all needs
1938  #         Module: irc  #         Module: irc
1939    
1940  #    (30) FLUD (stackable)  #    (30) FLUD (stackable)
1941  #         bind flud <flags> <type> <proc>  #         bind flud <flags> <type> <proc>
1942  #         procname <nick> <user@host> <handle> <type> <channel>  #         procname <nick> <user@host> <handle> <type> <channel>
1943  #  #
1944  #         Description: any floods detected through the flood control settings  #         Description: any floods detected through the flood control settings
1945  #           (like 'flood-ctcp') are sent here before processing. If the proc  #           (like 'flood-ctcp') are sent here before processing. If the proc
1946  #           returns 1, no further action is taken on the flood; if the proc  #           returns 1, no further action is taken on the flood; if the proc
1947  #           returns 0, the bot will do its normal "punishment" for the flood.  #           returns 0, the bot will do its normal "punishment" for the flood.
1948  #           The flood types are: pub, msg, join, or ctcp (and can be masked to  #           The flood types are: pub, msg, join, or ctcp (and can be masked to
1949  #           "*" for the bind); flags are ignored.  #           "*" for the bind); flags are ignored.
1950  #         Module: server  #         Module: server
1951    
1952  #    (31) NOTE  #    (31) NOTE
1953  #         bind note <flags> <handle> <proc>  #         bind note <flags> <handle> <proc>
1954  #         procname <from> <to> <text>  #         procname <from> <to> <text>
1955  #  #
1956  #         Description: incoming notes (either from the party line, someone on  #         Description: incoming notes (either from the party line, someone on
1957  #           IRC, or someone on another bot on the botnet) are checked against  #           IRC, or someone on another bot on the botnet) are checked against
1958  #           these binds before being processed. If a bind exists, the bot will  #           these binds before being processed. If a bind exists, the bot will
1959  #           not deliver the note. The handle must be an exact match (no wildcards),  #           not deliver the note. The handle must be an exact match (no wildcards),
1960  #           but it is not case sensitive; flags are ignored.  #           but it is not case sensitive; flags are ignored.
1961  #         Module: core  #         Module: core
1962    
1963  #    (32) ACT (stackable)  #    (32) ACT (stackable)
1964  #         bind act <flags> <mask> <proc>  #         bind act <flags> <mask> <proc>
1965  #         proc-name <handle> <channel#> <action>  #         proc-name <handle> <channel#> <action>
1966  #  #
1967  #         Description: when someone does an action on the botnet, it invokes  #         Description: when someone does an action on the botnet, it invokes
1968  #           this binding. flags are ignored; the mask is matched against the  #           this binding. flags are ignored; the mask is matched against the
1969  #           text of the action and can support wildcards.  #           text of the action and can support wildcards.
1970  #         Module: core  #         Module: core
1971    
1972  #|   (33) WALL (stackable)  #|   (33) WALL (stackable)
1973  #|        bind wall <flags> <mask> <proc>  #|        bind wall <flags> <mask> <proc>
1974  #|        proc-name <from> <msg>  #|        proc-name <from> <msg>
1975  #|  #|
1976  #|        Description: when the bot receives a wallops, it invokes this  #|        Description: when the bot receives a wallops, it invokes this
1977  #|          binding. flags are ignored; the mask is matched against the text  #|          binding. flags are ignored; the mask is matched against the text
1978  #|          of the wallops msg. Note that RFC shows the server name as a source  #|          of the wallops msg. Note that RFC shows the server name as a source
1979  #|          of the message, whereas many IRCds send the nick!user@host of the  #|          of the message, whereas many IRCds send the nick!user@host of the
1980  #|          actual sender, thus, Eggdrop will not parse it at all, but simply  #|          actual sender, thus, Eggdrop will not parse it at all, but simply
1981  #|          pass it to bind in its original form.  #|          pass it to bind in its original form.
1982  #|        Module: server  #|        Module: server
1983    
1984  #    (34) BCST (stackable)  #    (34) BCST (stackable)
1985  #         bind bcst <flags> <mask> <proc>  #         bind bcst <flags> <mask> <proc>
1986  #         proc-name <botname> <channel#> <text>  #         proc-name <botname> <channel#> <text>
1987  #  #
1988  #         Description: when a bot broadcasts something on the botnet (see  #         Description: when a bot broadcasts something on the botnet (see
1989  #           'dccbroadcast' above), it invokes this binding. flags are ignored;  #           'dccbroadcast' above), it invokes this binding. flags are ignored;
1990  #           the mask is matched against the message text and can contain  #           the mask is matched against the message text and can contain
1991  #           wildcards.  #           wildcards.
1992  #         Module: core  #         Module: core
1993    
1994  #    (35) CHJN (stackable)  #    (35) CHJN (stackable)
1995  #         bind chjn <flags> <mask> <proc>  #         bind chjn <flags> <mask> <proc>
1996  #         proc-name <botname> <handle> <channel#> <flag> <idx> <user@host>  #         proc-name <botname> <handle> <channel#> <flag> <idx> <user@host>
1997  #  #
1998  #         Description: when someone joins a botnet channel, it invokes this  #         Description: when someone joins a botnet channel, it invokes this
1999  #           binding. The mask is matched against the channel and can contain  #           binding. The mask is matched against the channel and can contain
2000  #           wildcards. flag is one of: * (owner), + (master), @ (op), or %  #           wildcards. flag is one of: * (owner), + (master), @ (op), or %
2001  #           (botnet master).  #           (botnet master).
2002  #         Module: core  #         Module: core
2003    
2004  #    (36) CHPT (stackable)  #    (36) CHPT (stackable)
2005  #         bind chpt <flags> <mask> <proc>  #         bind chpt <flags> <mask> <proc>
2006  #         proc-name <botname> <handle> <idx> <channel#>  #         proc-name <botname> <handle> <idx> <channel#>
2007  #  #
2008  #         Description: when someone parts a botnet channel, it invokes this  #         Description: when someone parts a botnet channel, it invokes this
2009  #           binding. flags are ignored; the mask is matched against the  #           binding. flags are ignored; the mask is matched against the
2010  #           channel and can contain wildcards.  #           channel and can contain wildcards.
2011  #         Module: core  #         Module: core
2012    
2013  #    (37) TIME (stackable)  #    (37) TIME (stackable)
2014  #         bind time <flags> <mask> <proc>  #         bind time <flags> <mask> <proc>
2015  #         proc-name <minute> <hour> <day> <month> <year>  #         proc-name <minute> <hour> <day> <month> <year>
2016  #  #
2017  #         Description: allows you to schedule procedure calls at certain  #         Description: allows you to schedule procedure calls at certain
2018  #           times. mask matches 5 space separated integers of the form:  #           times. mask matches 5 space separated integers of the form:
2019  #           "minute hour day month year". minute, hour, day, month have a  #           "minute hour day month year". minute, hour, day, month have a
2020  #           zero padding so they are exactly two characters long; year is  #           zero padding so they are exactly two characters long; year is
2021  #           extended to four characters in the same way.  #           extended to four characters in the same way.
2022  #         Module: core  #         Module: core
2023    
2024  #    (38) AWAY (stackable)  #    (38) AWAY (stackable)
2025  #         bind away <flags> <mask> <proc>  #         bind away <flags> <mask> <proc>
2026  #         proc-name <botname> <idx> <text>  #         proc-name <botname> <idx> <text>
2027  #  #
2028  #         Description: triggers when a user goes away or comes back on the  #         Description: triggers when a user goes away or comes back on the
2029  #           botnet. text is the reason than has been specified (text is ""  #           botnet. text is the reason than has been specified (text is ""
2030  #           when returning). mask is matched against the botnet-nick of the  #           when returning). mask is matched against the botnet-nick of the
2031  #           bot the user is connected to and supports wildcards. flags are  #           bot the user is connected to and supports wildcards. flags are
2032  #           ignored.  #           ignored.
2033  #         Module: core  #         Module: core
2034    
2035  #    (39) LOAD (stackable)  #    (39) LOAD (stackable)
2036  #         bind load <flags> <mask> <proc>  #         bind load <flags> <mask> <proc>
2037  #         proc-name <module>  #         proc-name <module>
2038  #  #
2039  #         Description: triggers when a module is loaded. mask is matched  #         Description: triggers when a module is loaded. mask is matched
2040  #           against the name of the loaded module and supports wildcards;  #           against the name of the loaded module and supports wildcards;
2041  #           flags are ignored.  #           flags are ignored.
2042  #         Module: core  #         Module: core
2043    
2044  #    (40) UNLD (stackable)  #    (40) UNLD (stackable)
2045  #         bind unld <flags> <mask> <proc>  #         bind unld <flags> <mask> <proc>
2046  #         proc-name <module>  #         proc-name <module>
2047  #  #
2048  #         Description: triggers when a module is unloaded. mask is matched  #         Description: triggers when a module is unloaded. mask is matched
2049  #           against the name of the unloaded module and supports wildcards;  #           against the name of the unloaded module and supports wildcards;
2050  #           flags are ignored.  #           flags are ignored.
2051  #         Module: core  #         Module: core
2052    
2053  #    (41) NKCH (stackable)  #    (41) NKCH (stackable)
2054  #         bind nkch <flags> <mask> <proc>  #         bind nkch <flags> <mask> <proc>
2055  #         proc-name <oldhandle> <newhandle>  #         proc-name <oldhandle> <newhandle>
2056  #  #
2057  #         Description: triggered whenever a local user's handle is changed  #         Description: triggered whenever a local user's handle is changed
2058  #           (in the userfile). mask is matched against the user's old handle  #           (in the userfile). mask is matched against the user's old handle
2059  #           and can contain wildcards; flags are ignored.  #           and can contain wildcards; flags are ignored.
2060  #         Module: core  #         Module: core
2061    
2062      (42) EVNT (stackable)      (42) EVNT (stackable)
2063           bind evnt <flags> <type> <proc>           bind evnt <flags> <type> <proc>
2064           proc-name <type>           proc-name <type>
2065    
2066           Description: triggered whenever one of these events happen. flags           Description: triggered whenever one of these events happen. flags
2067             are ignored; valid events are:             are ignored; valid events are:
2068  #             sighup     - called on a kill -HUP <pid>  #             sighup     - called on a kill -HUP <pid>
2069  #             sigterm    - called on a kill -TERM <pid>  #             sigterm    - called on a kill -TERM <pid>
2070  #             sigill     - called on a kill -ILL <pid>  #             sigill     - called on a kill -ILL <pid>
2071  #             sigquit    - called on a kill -QUIT <pid>  #             sigquit    - called on a kill -QUIT <pid>
2072  #             save       - called when the userfile is saved  #             save       - called when the userfile is saved
2073               rehash     - called just after a rehash               rehash     - called just after a rehash
2074               prerehash  - called just before a rehash               prerehash  - called just before a rehash
2075               prerestart - called just before a restart               prerestart - called just before a restart
2076  #             logfile    - called when the logs are switched daily  #             logfile    - called when the logs are switched daily
2077               loaded     - called when the bot is done loading               loaded     - called when the bot is done loading
2078               connect-server    - called just before we connect to an IRC server               connect-server    - called just before we connect to an IRC server
2079               init-server       - called when we actually get on our IRC server               init-server       - called when we actually get on our IRC server
2080               disconnect-server - called when we disconnect from our IRC server               disconnect-server - called when we disconnect from our IRC server
2081               FixMe: There's a lot more in Tcldrop, document!               FixMe: There's a lot more in Tcldrop, document!
2082           Module: core           Module: core
2083    
2084  #    (43) LOST (stackable)  #    (43) LOST (stackable)
2085  #         bind lost <flags> <mask> <proc>  #         bind lost <flags> <mask> <proc>
2086  #         proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>  #         proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>
2087  #  #
2088  #         Description: triggered when a DCC SEND transfer gets lost, such as  #         Description: triggered when a DCC SEND transfer gets lost, such as
2089  #           when the connection is terminated before all data was successfully  #           when the connection is terminated before all data was successfully
2090  #           sent/received. This is typically caused by a user abort.  #           sent/received. This is typically caused by a user abort.
2091  #         Module: transfer  #         Module: transfer
2092  #  #
2093  #    (44) TOUT (stackable)  #    (44) TOUT (stackable)
2094  #         bind tout <flags> <mask> <proc>  #         bind tout <flags> <mask> <proc>
2095  #         proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>  #         proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>
2096  #  #
2097  #         Description: triggered when a DCC SEND transfer times out. This may  #         Description: triggered when a DCC SEND transfer times out. This may
2098  #           either happen because the dcc connection was not accepted or  #           either happen because the dcc connection was not accepted or
2099  #           because the data transfer stalled for some reason.  #           because the data transfer stalled for some reason.
2100  #         Module: transfer  #         Module: transfer
2101    
2102    
2103  # FixMe: Document the LOG bind type.  # FixMe: Document the LOG bind type.
2104    
2105    
2106    (B) RETURN VALUES    (B) RETURN VALUES
2107    
2108      Several bindings pay attention to the value you return from the proc      Several bindings pay attention to the value you return from the proc
2109      (using 'return <value>'). Usually, they expect a 0 or 1, and returning      (using 'return <value>'). Usually, they expect a 0 or 1, and returning
2110      an empty return is interpreted as a 0. Be aware if you omit the return      an empty return is interpreted as a 0. Be aware if you omit the return
2111      statement, the result of the last Tcl command executed will be returned      statement, the result of the last Tcl command executed will be returned
2112      by the proc. This will not likely produce the results you intended (this      by the proc. This will not likely produce the results you intended (this
2113      is a "feature" of Tcl).      is a "feature" of Tcl).
2114    
2115      Here's a list of the bindings that use the return value from procs      Here's a list of the bindings that use the return value from procs
2116      they trigger:      they trigger:
2117    
2118      (1) MSG   Return 1 to make the command get logged like so:      (1) MSG   Return 1 to make the command get logged like so:
2119                  (nick!user@host) !handle! command                  (nick!user@host) !handle! command
2120    
2121  #    (2) DCC   Return 1 to make the command get logged like so:  #    (2) DCC   Return 1 to make the command get logged like so:
2122  #                #handle# command  #                #handle# command
2123    
2124  #    (3) FIL   Return 1 to make the command get logged like so:  #    (3) FIL   Return 1 to make the command get logged like so:
2125  #                #handle# files: command  #                #handle# files: command
2126    
2127  #    (4) PUB   Return 1 to make the command get logged like so:  #    (4) PUB   Return 1 to make the command get logged like so:
2128  #                <<nick>> !handle! command  #                <<nick>> !handle! command
2129    
2130  #    (5) CTCP  Return 1 to ask the bot not to process the CTCP command on its  #    (5) CTCP  Return 1 to ask the bot not to process the CTCP command on its
2131  #              own. Otherwise, it would send its own response to the CTCP  #              own. Otherwise, it would send its own response to the CTCP
2132  #              (possibly an error message if it doesn't know how to deal with  #              (possibly an error message if it doesn't know how to deal with
2133  #              it).  #              it).
2134    
2135  #    (6) FILT  Return "" to indicate the text has been processed, and the bot  #    (6) FILT  Return "" to indicate the text has been processed, and the bot
2136  #              should just ignore it. Otherwise, it will treat the text like  #              should just ignore it. Otherwise, it will treat the text like
2137  #              any other.  #              any other.
2138    
2139  #    (7) FLUD  Return 1 to ask the bot not to take action on the flood.  #    (7) FLUD  Return 1 to ask the bot not to take action on the flood.
2140  #              Otherwise it will do its normal punishment.  #              Otherwise it will do its normal punishment.
2141    
2142      (8) RAW   Return 1 to ask the bot not to process the server text. This      (8) RAW   Return 1 to ask the bot not to process the server text. This
2143                can affect the bot's performance by causing it to miss things                can affect the bot's performance by causing it to miss things
2144                that it would normally act on -- you have been warned.                that it would normally act on -- you have been warned.
2145    
2146  #    (9) CHON  Return 1 to ask the bot not to process the partyline join event.  #    (9) CHON  Return 1 to ask the bot not to process the partyline join event.
2147    
2148  #    (10) CHOF  Return 1 to ask the bot not to process the partyline part event.  #    (10) CHOF  Return 1 to ask the bot not to process the partyline part event.
2149    
2150  #    (11) WALL  Return 1 to make the command get logged like so:  #    (11) WALL  Return 1 to make the command get logged like so:
2151  #           !nick! msg  #           !nick! msg
2152    
2153  #*** CONTROL PROCEDURES ***  #*** CONTROL PROCEDURES ***
2154    
2155  #  Using the 'control' command, you can put a DCC connection (or outgoing  #  Using the 'control' command, you can put a DCC connection (or outgoing
2156  #  TCP connection) in control of a script. All text received from the  #  TCP connection) in control of a script. All text received from the
2157  #  connection is sent to the proc you specify. All outgoing text should  #  connection is sent to the proc you specify. All outgoing text should
2158  #  be sent with 'putdcc'.  #  be sent with 'putdcc'.
2159  #  #
2160  #  The control procedure is called with these parameters:  #  The control procedure is called with these parameters:
2161  #    procname <idx> <input-text>  #    procname <idx> <input-text>
2162  #  #
2163  #  This allows you to use the same proc for several connections. The  #  This allows you to use the same proc for several connections. The
2164  #  idx will stay the same until the connection is dropped. After that,  #  idx will stay the same until the connection is dropped. After that,
2165  #  it will probably get reused for a later connection.  #  it will probably get reused for a later connection.
2166  #  #
2167  #  To indicate that the connection has closed, your control procedure  #  To indicate that the connection has closed, your control procedure
2168  #  will be called with blank text (the input-text will be ""). This  #  will be called with blank text (the input-text will be ""). This
2169  #  is the only time it will ever be called with "" as the text, and it  #  is the only time it will ever be called with "" as the text, and it
2170  #  is the last time your proc will be called for that connection. Don't  #  is the last time your proc will be called for that connection. Don't
2171  #  call killdcc on the idx when text is blank, it will always fail with  #  call killdcc on the idx when text is blank, it will always fail with
2172  #  "invalid idx".  #  "invalid idx".
2173  #  #
2174  #  If you want to hand control of your connection back to Eggdrop, your  #  If you want to hand control of your connection back to Eggdrop, your
2175  #  proc should return 1. Otherwise, return 0 to retain control.  #  proc should return 1. Otherwise, return 0 to retain control.
2176  #  #
2177    
2178  #*** TCP CONNECTIONS ***  #*** TCP CONNECTIONS ***
2179  #  #
2180  #  Eggdrop allows you to make two types of TCP ("telnet") connections:  #  Eggdrop allows you to make two types of TCP ("telnet") connections:
2181  #  outgoing and incoming. For an outgoing connection, you specify the  #  outgoing and incoming. For an outgoing connection, you specify the
2182  #  remote host and port to connect to. For an incoming connection, you  #  remote host and port to connect to. For an incoming connection, you
2183  #  specify a port to listen on.  #  specify a port to listen on.
2184  #  #
2185  #  All of the connections are *event driven*. This means that the bot will  #  All of the connections are *event driven*. This means that the bot will
2186  #  trigger your procs when something happens on the connection, and your  #  trigger your procs when something happens on the connection, and your
2187  #  proc is expected to return as soon as possible. Waiting in a proc for  #  proc is expected to return as soon as possible. Waiting in a proc for
2188  #  more input is a no-no.  #  more input is a no-no.
2189  #  #
2190  #  To initiate an outgoing connection, use:  #  To initiate an outgoing connection, use:
2191  #    set idx [connect <hostname> <port>]  #    set idx [connect <hostname> <port>]
2192  #  #
2193  #  $idx now contains a new DCC entry for the outgoing connection.  #  $idx now contains a new DCC entry for the outgoing connection.
2194  #  #
2195  #  All connections use non-blocking (commonly called "asynchronous",  #  All connections use non-blocking (commonly called "asynchronous",
2196  #  which is a misnomer) I/O. Without going into a big song and dance  #  which is a misnomer) I/O. Without going into a big song and dance
2197  #  about asynchronous I/O, what this means to you is:  #  about asynchronous I/O, what this means to you is:
2198  #  #
2199  #    * assume the connection succeeded immediately  #    * assume the connection succeeded immediately
2200  #    * if the connection failed, an EOF will arrive for that idx  #    * if the connection failed, an EOF will arrive for that idx
2201  #  #
2202  #  The only time a 'connect' will return an error is if you give it a  #  The only time a 'connect' will return an error is if you give it a
2203  #  hostname that can't be resolved (this is considered a "DNS error").  #  hostname that can't be resolved (this is considered a "DNS error").
2204  #  Otherwise, it will appear to have succeeded. If the connection failed,  #  Otherwise, it will appear to have succeeded. If the connection failed,
2205  #  you will immediately get an EOF.  #  you will immediately get an EOF.
2206  #  #
2207  #  Right after doing a 'connect' call, you should set up a 'control' for  #  Right after doing a 'connect' call, you should set up a 'control' for
2208  #  the new idx (see the section above). From then on, the connection will  #  the new idx (see the section above). From then on, the connection will
2209  #  act just like a normal DCC connection that has been put under the control  #  act just like a normal DCC connection that has been put under the control
2210  #  of a script. If you ever return "1" from the control proc (indicating  #  of a script. If you ever return "1" from the control proc (indicating
2211  #  that you want control to return to Eggdrop), the bot will just close the  #  that you want control to return to Eggdrop), the bot will just close the
2212  #  connection and dispose of it. Other commands that work on normal DCC  #  connection and dispose of it. Other commands that work on normal DCC
2213  #  connections, like 'killdcc' and 'putdcc', will work on this idx, too.  #  connections, like 'killdcc' and 'putdcc', will work on this idx, too.
2214  #  The 'killdcc' command will fail with "invalid idx" if you attempt to use  #  The 'killdcc' command will fail with "invalid idx" if you attempt to use
2215  #  it on a closed socket.  #  it on a closed socket.
2216  #  #
2217  #  To create a listen port, use:  #  To create a listen port, use:
2218  #    listen <port> script <proc>  #    listen <port> script <proc>
2219  #  #
2220  #  Procs should be declared as:  #  Procs should be declared as:
2221  #    <procname> <newidx>  #    <procname> <newidx>
2222  #  #
2223  #  For example:  #  For example:
2224  #    listen 6687 script listen:grab  #    listen 6687 script listen:grab
2225  #  #
2226  #    proc listen:grab {newidx} {  #    proc listen:grab {newidx} {
2227  #      control $newidx listen:control  #      control $newidx listen:control
2228  #    }  #    }
2229  #  #
2230  #    When a new connection arrives in port 6687, Eggdrop will create a new  #    When a new connection arrives in port 6687, Eggdrop will create a new
2231  #    idx for the connection. That idx is sent to 'listen:grab'. The proc  #    idx for the connection. That idx is sent to 'listen:grab'. The proc
2232  #    immediately puts this idx under control. Once 'listen:grab' has been  #    immediately puts this idx under control. Once 'listen:grab' has been
2233  #    called, the idx behaves exactly like an outgoing connection would.  #    called, the idx behaves exactly like an outgoing connection would.
2234  #  #
2235  #  The best way to learn how to use these commands is to find a script that  #  The best way to learn how to use these commands is to find a script that
2236  #  uses them and follow it carefully. However, hopefully this has given you  #  uses them and follow it carefully. However, hopefully this has given you
2237  #  a good start.  #  a good start.
2238  #  #
2239  #  #
2240  #*** MATCH CHARACTERS ***  #*** MATCH CHARACTERS ***
2241  #  #
2242  #  Many of the bindings allow match characters in the arguments. Here  #  Many of the bindings allow match characters in the arguments. Here
2243  #  are the four special characters:  #  are the four special characters:
2244  #  #
2245    ?  matches any single character    ?  matches any single character
2246    *  matches 0 or more characters of any type    *  matches 0 or more characters of any type
2247  #  %  matches 0 or more non-space characters (can be used to match a single  #  %  matches 0 or more non-space characters (can be used to match a single
2248  #     word)  #     word)
2249  #  ~  matches 1 or more space characters (can be used for whitespace between  #  ~  matches 1 or more space characters (can be used for whitespace between
2250  #     words)  #     words)
2251       _________________________________________________________________       _________________________________________________________________

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26