1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
<!-- $Id: tcl-commands.html,v 1.39 2004/05/27 01:30:11 wcc Exp $ -->
6
<title>Eggdrop Documentation: Eggdrop Tcl Commands</title>
11
<p><strong>Eggdrop Tcl Commands</strong></p>
15
<p>This is an exhaustive list of all the Tcl commands added to Eggdrop.
16
All of the normal Tcl built-in commands are still there, of course, but
17
you can also use these to manipulate features of the bot. They are listed
18
according to category.</p>
20
<p>This list is accurate for Eggdrop v1.6.16. Scripts written for
21
v1.3/v1.4 series of Eggdrop should probably work with a few minor
22
modifications depending on the script. Scripts which were written for
23
v0.9, v1.0, v1.1 or v1.2 will probably not work without modification.
24
Commands which have been changed in this version of Eggdrop (or are
25
just new commands) are marked with an asterisk (*).</p>
29
<li><a href="#output">Output commands</a></li>
31
<li><a href="#urmc">User record manipulation commands</a></li>
33
<li><a href="#chancmds">Channel commands</a></li>
35
<li><a href="#dcccmds">DCC commands</a></li>
37
<li><a href="#notes">Notes module</a></li>
39
<li><a href="#assoc">Assoc module</a></li>
41
<li><a href="#compress">Compress module</a></li>
43
<li><a href="#filesys">Filesys module</a></li>
45
<li><a href="#misc">Miscellaneous commands</a></li>
47
<li><a href="#globvars">Global variables</a></li>
50
<a href="#bind">Bind</a>
53
<li><a href="#binda">Bind types</a></li>
55
<li><a href="#bindb">Return values</a></li>
59
<li><a href="#control">Control procedures</a></li>
61
<li><a href="#tcp">TCP connections</a></li>
63
<li><a href="#matchchars">Match characters</a></li>
68
<p><a name="output"></a>1. <strong>Output commands</strong></p>
72
<dt><strong>putserv <text> [options]</strong></dt>
75
<p><strong>Description:</strong> sends text to the server, like
76
'.dump' (intended for direct server commands); output is
77
queued so that the bot won't flood itself off the server.</p>
79
<p><strong>Options:</strong></p>
82
<p><strong>-next</strong>: push messages to the front of the
84
<strong>-normal</strong>: no effect</p>
87
<p><strong>Returns:</strong> nothing</p>
89
<p><strong>Module:</strong> server</p>
92
<dt><strong>puthelp <text> [options]</strong></dt>
95
<p><strong>Description:</strong> sends text to the server, like
96
'putserv', but it uses a different queue intended for
97
sending messages to channels or people.</p>
99
<p><strong>Options:</strong></p>
102
<p><strong>-next</strong>: push messages to the front of the
104
<strong>-normal</strong>: no effect</p>
107
<p><strong>Returns:</strong> nothing</p>
109
<p><strong>Module:</strong> server</p>
112
<dt><strong>putquick <text> [options]</strong></dt>
115
<p><strong>Description:</strong> sends text to the server, like
116
'putserv', but it uses a different (and faster) queue.</p>
118
<p><strong>Options:</strong></p>
121
<p><strong>-next</strong>: push messages to the front of the
123
<strong>-normal</strong>: no effect</p>
126
<p><strong>Returns:</strong> nothing</p>
128
<p><strong>Module:</strong> server</p>
131
<dt><strong>putkick <channel> <nick,nick,...>
132
[reason]</strong></dt>
135
<p><strong>Description:</strong> sends kicks to the server and
136
tries to put as many nicks into one kick command as possible.</p>
138
<p><strong>Returns:</strong> nothing</p>
140
<p><strong>Module:</strong> irc</p>
143
<dt><strong>putlog <text></strong></dt>
146
<p><strong>Description:</strong> sends text to the bot's
147
logfile, marked as 'misc' (o)</p>
149
<p><strong>Returns:</strong> nothing</p>
151
<p><strong>Module:</strong> core</p>
154
<dt><strong>putcmdlog <text></strong></dt>
157
<p><strong>Description:</strong> sends text to the bot's
158
logfile, marked as 'command' (c)</p>
160
<p><strong>Returns:</strong> nothing</p>
162
<p><strong>Module:</strong> core</p>
165
<dt><strong>putxferlog <text></strong></dt>
168
<p><strong>Description:</strong> sends text to the bot's
169
logfile, marked as 'file-area' (x)</p>
171
<p><strong>Returns:</strong> nothing</p>
173
<p><strong>Module:</strong> core</p>
176
<dt><strong>putloglev <level(s)> <channel>
177
<text></strong></dt>
180
<p><strong>Description:</strong> sends text to the bot's
181
logfile, tagged with all of the valid levels given. Use
182
"*" to indicate all log levels.</p>
184
<p><strong>Returns:</strong> nothing</p>
186
<p><strong>Module:</strong> core</p>
189
<dt><strong>dumpfile <nick> <filename></strong></dt>
192
<p><strong>Description:</strong> dumps file from the help/text
193
directory to a user on IRC via msg (one line per msg). The user
194
has no flags, so the flag bindings won't work within the
197
<p><strong>Returns:</strong> nothing</p>
199
<p><strong>Module:</strong> core</p>
202
<dt><strong>queuesize [queue]</strong></dt>
205
<p><strong>Returns:</strong> the number of messages in all queues.
206
If a queue is specified, only the size of this queue is returned.
207
Valid queues are: mode, server, help.</p>
209
<p><strong>Module:</strong> server</p>
212
<dt><strong>clearqueue <queue></strong></dt>
215
<p><strong>Description:</strong> removes all messages from a
216
queue. Valid arguments are: mode, server, help, or all.</p>
218
<p><strong>Returns:</strong> the number of deleted lines from
219
the specified queue.</p>
221
<p><strong>Module:</strong> server</p>
226
<p><a name="urmc"></a>2. <strong>User record manipulation
227
commands</strong></p>
231
<dt><strong>countusers</strong></dt>
234
<p><strong>Returns:</strong> number of users in the bot's
237
<p><strong>Module:</strong> core</p>
240
<dt><strong>validuser <handle></strong></dt>
243
<p><strong>Returns:</strong> 1 if a user by that name exists;
246
<p><strong>Module:</strong> core</p>
249
<dt><strong>finduser <nick!user@host></strong></dt>
252
<p><strong>Description:</strong> finds the user record which most
253
closely matches the given nick!user@host</p>
255
<p><strong>Returns:</strong> the handle found, or "*"
258
<p><strong>Module:</strong> core</p>
261
<dt><strong>userlist [flags]</strong></dt>
264
<p><strong>Returns:</strong> a list of users on the bot. You
265
can use the flag matching system here
266
([global]{&/|}[chan]{&/|}[bot]). '&' specifies
267
"and"; '|' specifies "or".</p>
269
<p><strong>Module:</strong> core</p>
272
<dt><strong>passwdok <handle> <pass></strong></dt>
275
<p><strong>Description:</strong> checks the password given against
276
the user's password. Check against the password ""
277
(a blank string) or "-" to find out if a user has no
280
<p><strong>Returns:</strong> 1 if the password matches for that
281
user; 0 otherwise</p>
283
<p><strong>Module:</strong> core</p>
286
<dt><strong>getuser <handle> <entry-type>
287
[extra info]</strong></dt>
290
<p><strong>Description:</strong> an interface to the new generic
291
userfile support. Valid entry types are:</p>
297
<p><strong>BOTFL</strong></p>
301
<p>returns the current bot-specific flags for the user
308
<p><strong>BOTADDR</strong></p>
312
<p>returns a list containing the bot's address, telnet
313
port, and relay port (bot-only)</p>
319
<p><strong>HOSTS</strong></p>
323
<p>returns a list of hosts for the user</p>
329
<p><strong>LASTON</strong></p>
333
<p>returns a list containing the unixtime last seen and
334
the last seen place. LASTON #channel returns the time
335
last seen time for the channel or 0 if no info exists.</p>
341
<p><strong>INFO</strong></p>
345
<p>returns the user's global info line</p>
351
<p><strong>XTRA</strong></p>
355
<p>returns the user's XTRA info</p>
361
<p><strong>COMMENT</strong></p>
365
<p>returns the master-visible only comment for the user</p>
371
<p><strong>EMAIL</strong></p>
375
<p>returns the user's e-mail address</p>
381
<p><strong>URL</strong></p>
385
<p>returns the user's url</p>
391
<p><strong>HANDLE</strong></p>
395
<p>returns the user's handle as it is saved in the
402
<p><strong>PASS</strong></p>
406
<p>returns the user's encrypted password</p>
412
<p><strong>Returns:</strong> info specific to each entry-type</p>
414
<p><strong>Module:</strong> core</p>
417
<dt><strong>setuser <handle> <entry-type>
418
[extra info]</strong></dt>
421
<p><strong>Description:</strong> this is the counterpart of
422
getuser. It lets you set the various values. Other then the ones
423
listed below, the entry-types are the same as getuser's.</p>
429
<p><strong>HOSTS</strong></p>
433
<p>if used with no third arg, all hosts for the user will
434
be cleared. Otherwise, *1* hostmask is added :P</p>
440
<p><strong>LASTON</strong></p>
444
<p>This setting has 3 forms. "setuser <handle>
445
LASTON <unixtime> <place>" sets global
446
LASTON time, "setuser <handle> LASTON
447
<unixtime>" sets global LASTON time (leaving the
448
place field empty), and "setuser <handle> LASTON
449
<unixtime> <channel>" sets a users LASTON
450
time for a channel (if it is a valid channel).</p>
456
<p><strong>PASS</strong></p>
460
<p>sets a users password (no third arg will clear it)</p>
466
<p><strong>Returns:</strong> nothing</p>
468
<p><strong>Module:</strong> core</p>
471
<dt><strong>chhandle <old-handle>
472
<new-handle></strong></dt>
475
<p><strong>Description:</strong> changes a user's handle</p>
477
<p><strong>Returns:</strong> 1 on success; 0 if the new handle is
478
invalid or already used, or if the user can't be found</p>
480
<p><strong>Module:</strong> core</p>
483
<dt><strong>chattr <handle> [changes [channel]]</strong></dt>
486
<p><strong>Description:</strong> changes the attributes for a user
487
record, if you include any. Changes are of the form '+f',
488
'-o', '+dk', '-o+d', etc. If changes are
489
specified in the format of <changes> <channel<, the
490
channel-specific flags for that channel are altered. You can now
491
use the +o|-o #channel format here too.</p>
493
<p><strong>Returns:</strong> new flags for the user (if you made
494
no changes, the current flags are returned). If a channel was
495
specified, the global AND the channel-specific flags for that
496
channel are returned in the format of globalflags|channelflags.
497
"*" is returned if the specified user does not exist.</p>
499
<p><strong>Module:</strong> core</p>
502
<dt><strong>botattr <handle> [changes [channel]]</strong></dt>
505
<p><strong>Description:</strong> similar to chattr except this
506
modifies bot flags rather than normal user attributes.</p>
508
<p><strong>Returns:</strong> new flags for the bot (if you made
509
no changes, the current flags are returned). If a channel was
510
specified, the global AND the channel-specific flags for that
511
channel are returned in the format of globalflags|channelflags.
512
"*" is returned if the specified bot does not exist.</p>
514
<p><strong>Module:</strong> core</p>
517
<dt><strong>matchattr <handle> <flags>
518
[channel]</strong></dt>
521
<p><strong>Returns:</strong> 1 if the specified user has the
522
specified flags; 0 otherwise</p>
524
<p><strong>Module:</strong> core</p>
527
<dt><strong>adduser <handle> [hostmask]</strong></dt>
530
<p><strong>Description:</strong> creates a new user entry with the
531
handle and hostmask given (with no password and the default
534
<p><strong>Returns:</strong> 1 if successful; 0 if the handle
537
<p><strong>Module:</strong> core</p>
540
<dt><strong>addbot <handle> <address></strong></dt>
543
<p><strong>Description:</strong> adds a new bot to the userlist
544
with the handle and bot address given (with no password and no
547
<p><strong>Returns:</strong> 1 if successful; 0 if the bot
550
<p><strong>Module:</strong> core</p>
553
<dt><strong>deluser <handle></strong></dt>
556
<p><strong>Description:</strong> attempts to erase the user record
559
<p><strong>Returns:</strong> 1 if successful, 0 if no such user
562
<p><strong>Module:</strong> core</p>
565
<dt><strong>delhost <handle> <hostmask></strong></dt>
568
<p><strong>Description:</strong> deletes a hostmask from a
569
user's host list</p>
571
<p><strong>Returns:</strong> 1 on success; 0 if the hostmask (or
572
user) doesn't exist</p>
574
<p><strong>Module:</strong> core</p>
577
<dt><strong>addchanrec <handle> <channel></strong></dt>
580
<p><strong>Description:</strong> adds a channel record for a
583
<p><strong>Returns:</strong> 1 on success; 0 if the user or channel
586
<p><strong>Module:</strong> channels</p>
589
<dt><strong>delchanrec <handle> <channel></strong></dt>
592
<p><strong>Description:</strong> removes a channel record for a
593
user. This includes all associated channel flags.</p>
595
<p><strong>Returns:</strong> 1 on success; 0 if the user or channel
598
<p><strong>Module:</strong> channels</p>
601
<dt><strong>haschanrec <handle> <channel></strong></dt>
604
<p><strong>Returns:</strong> 1 if the given handle has a chanrec
605
for the specified channel; 0 otherwise</p>
607
<p><strong>Module:</strong> channels</p>
610
<dt><strong>getchaninfo <handle> <channel></strong></dt>
613
<p><strong>Returns:</strong> info line for a specific channel
614
(behaves just like 'getinfo')</p>
616
<p><strong>Module:</strong> channels</p>
619
<dt><strong>setchaninfo <handle> <channel>
620
<info></strong></dt>
623
<p><strong>Description:</strong> sets the info line on a specific
624
channel for a user. If info is "none", it will be
627
<p><strong>Returns:</strong> nothing</p>
629
<p><strong>Module:</strong> channels</p>
632
<dt><strong>newchanban <channel> <ban> <creator>
633
<comment> [lifetime] [options]</strong></dt>
636
<p><strong>Description:</strong> adds a ban to the ban list of a
637
channel; creator is given credit for the ban in the ban list.
638
lifetime is specified in minutes. If lifetime is not specified,
639
ban-time (usually 60) is used. Setting the lifetime to 0 makes
640
it a permanent ban.</p>
642
<p><strong>Options:</strong></p>
645
<p><strong>sticky</strong>: forces the ban to be always active
646
on a channel, even with dynamicbans on<br>
647
<strong>none</strong>: no effect</p>
650
<p><strong>Returns:</strong> nothing</p>
652
<p><strong>Module:</strong> channels</p>
655
<dt><strong>newban <ban> <creator> <comment>
656
[lifetime] [options]</strong></dt>
659
<p><strong>Description:</strong> adds a ban to the global ban list
660
(which takes effect on all channels); creator is given credit for
661
the ban in the ban list. lifetime is specified in minutes. If
662
lifetime is not specified, global-ban-time (usually 60) is used.
663
Setting the lifetime to 0 makes it a permanent ban.</p>
665
<p><strong>Options:</strong></p>
668
<p><strong>sticky</strong>: forces the ban to be always active
669
on a channel, even with dynamicbans on<br>
670
<strong>none</strong>: no effect</p>
673
<p><strong>Returns:</strong> nothing</p>
675
<p><strong>Module:</strong> channels</p>
678
<dt><strong>newchanexempt <channel> <exempt>
679
<creator> <comment> [lifetime] [options]</strong></dt>
682
<p><strong>Description:</strong> adds a exempt to the exempt list
683
of a channel; creator is given credit for the exempt in the exempt
684
list. lifetime is specified in minutes. If lifetime is not
685
specified, exempt-time (usually 60) is used. Setting the lifetime
686
to 0 makes it a permanent exempt. The exempt will not be removed
687
until the corresponding ban has been removed. For timed bans,
688
once the time period has expired, the exempt will not be removed
689
until the corresponding ban has either expired or been removed.</p>
691
<p><strong>Options:</strong></p>
694
<p><strong>sticky</strong>: forces the exempt to be always active
695
on a channel, even with dynamicexempts on<br>
696
<strong>none</strong>: no effect</p>
699
<p><strong>Returns:</strong> nothing</p>
701
<p><strong>Module:</strong> channels</p>
704
<dt><strong>newexempt <exempt> <creator> <comment>
705
[lifetime] [options]</strong></dt>
708
<p><strong>Description:</strong> adds a exempt to the global
709
exempt list (which takes effect on all channels); creator is
710
given credit for the exempt in the exempt list. lifetime is
711
specified in minutes. If lifetime is not specified, exempt-time
712
(usually 60) is used. Setting the lifetime to 0 makes it a
713
permanent exempt. The exempt will not be removed until the
714
corresponding ban has been removed.</p>
716
<p><strong>Options:</strong></p>
719
<p><strong>sticky</strong>: forces the exempt to be always active
720
on a channel, even with dynamicexempts on<br>
721
<strong>none</strong>: no effect</p>
724
<p><strong>Returns:</strong> nothing</p>
726
<p><strong>Module:</strong> channels</p>
729
<dt><strong>newchaninvite <channel> <invite>
730
<creator> <comment> [lifetime] [options]</strong></dt>
733
<p><strong>Description:</strong> adds a invite to the invite list
734
of a channel; creator is given credit for the invite in the invite
735
list. lifetime is specified in minutes. If lifetime is not
736
specified, invite-time (usually 60) is used. Setting the lifetime
737
to 0 makes it a permanent invite. The invite will not be removed
738
until the channel has gone -i.</p>
740
<p><strong>Options:</strong></p>
743
<p><strong>sticky</strong>: forces the invite to be always active
744
on a channel, even with dynamicinvites on<br>
745
<strong>none</strong>: no effect</p>
748
<p><strong>Returns:</strong> nothing</p>
750
<p><strong>Module:</strong> channels</p>
753
<dt><strong>newinvite <invite> <creator> <comment>
754
[lifetime] [options]</strong></dt>
757
<p><strong>Description:</strong> adds a invite to the global invite
758
list (which takes effect on all channels); creator is given credit
759
for the invite in the invite list. lifetime is specified in
760
minutes. If lifetime is not specified, invite-time (usually 60)
761
is used. Setting the lifetime to 0 makes it a permanent invite.
762
The invite will not be removed until the channel has gone -i.</p>
764
<p><strong>Options:</strong></p>
767
<p><strong>sticky</strong>: forces the invite to be always active
768
on a channel, even with dynamicinvites on<br>
769
<strong>none</strong>: no effect</p>
772
<p><strong>Returns:</strong> nothing</p>
774
<p><strong>Module:</strong> channels</p>
777
<dt><strong>stick <banmask> [channel]</strong></dt>
780
<p><strong>Description:</strong> makes a ban sticky, or, if a
781
channel is specified, then it is set sticky on that channel
784
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
786
<p><strong>Module:</strong> channels</p>
789
<dt><strong>unstick <banmask> [channel]</strong></dt>
792
<p><strong>Description:</strong> makes a ban no longer sticky,
793
or, if a channel is specified, then it is unstuck on that channel
796
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
798
<p><strong>Module:</strong> channels</p>
801
<dt><strong>stickexempt <exemptmask> [channel]</strong></dt>
804
<p><strong>Description:</strong> makes an exempt sticky, or, if
805
a channel is specified, then it is set sticky on that channel
808
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
810
<p><strong>Module:</strong> channels</p>
813
<dt><strong>unstickexempt <exemptmask> [channel]</strong></dt>
816
<p><strong>Description:</strong> makes an exempt no longer sticky,
817
or, if a channel is specified, then it is unstuck on that channel
820
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
822
<p><strong>Module:</strong> channels</p>
825
<dt><strong>stickinvite <invitemask> [channel]</strong></dt>
828
<p><strong>Description:</strong> makes an invite sticky, or, if
829
a channel is specified, then it is set sticky on that channel
832
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
834
<p><strong>Module:</strong> channels</p>
837
<dt><strong>unstickinvite <invitemask> [channel]</strong></dt>
840
<p><strong>Description:</strong> makes an invite no longer sticky,
841
or, if a channel is specified, then it is unstuck on that channel
844
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
846
<p><strong>Module:</strong> channels</p>
849
<dt><strong>killchanban <channel> <ban></strong></dt>
852
<p><strong>Description:</strong> removes a ban from the ban list
855
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
857
<p><strong>Module:</strong> channels</p>
860
<dt><strong>killban <ban></strong></dt>
863
<p><strong>Description:</strong> removes a ban from the global
866
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
868
<p><strong>Module:</strong> channels</p>
871
<dt><strong>killchanexempt <channel>
872
<exempt></strong></dt>
875
<p><strong>Description:</strong> removes an exempt from the exempt
876
list for a channel</p>
878
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
880
<p><strong>Module:</strong> channels</p>
883
<dt><strong>killexempt <exempt></strong></dt>
886
<p><strong>Description:</strong> removes an exempt from the global
889
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
891
<p><strong>Module:</strong> channels</p>
894
<dt><strong>killchaninvite <channel> <invite></strong></dt>
897
<p><strong>Description:</strong> removes an invite from the invite
898
list for a channel</p>
900
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
902
<p><strong>Module:</strong> channels</p>
905
<dt><strong>killinvite <invite></strong></dt>
908
<p><strong>Description:</strong> removes an invite from the global
911
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
913
<p><strong>Module:</strong> channels</p>
916
<dt><strong>ischanjuped <channel></strong></dt>
919
<p><strong>Returns:</strong> 1 if the channel is juped, and the
920
bot is unable to join; 0 otherwise</p>
922
<p><strong>Module:</strong> channels</p>
925
<dt><strong>isban <ban> [channel]</strong></dt>
928
<p><strong>Returns:</strong> 1 if the specified ban is in the
929
global ban list; 0 otherwise. If a channel is specified, that
930
channel's ban list is checked as well.</p>
932
<p><strong>Module:</strong> channels</p>
935
<dt><strong>ispermban <ban> [channel]</strong></dt>
938
<p><strong>Returns:</strong> 1 if the specified ban is in the
939
global ban list AND is marked as permanent; 0 otherwise. If a
940
channel is specified, that channel's ban list is checked as
943
<p><strong>Module:</strong> channels</p>
946
<dt><strong>isexempt <exempt> [channel]</strong></dt>
949
<p><strong>Returns:</strong> 1 if the specified exempt is in the
950
global exempt list; 0 otherwise. If a channel is specified, that
951
channel's exempt list is checked as well.</p>
953
<p><strong>Module:</strong> channels</p>
956
<dt><strong>ispermexempt <exempt> [channel]</strong></dt>
959
<p><strong>Returns:</strong> 1 if the specified exempt is in the
960
global exempt list AND is marked as permanent; 0 otherwise. If a
961
channel is specified, that channel's exempt list is checked
964
<p><strong>Module:</strong> channels</p>
967
<dt><strong>isinvite <invite> [channel]</strong></dt>
970
<p><strong>Returns:</strong> 1 if the specified invite is in
971
the global invite list; 0 otherwise. If a channel is specified,
972
that channel's invite list is checked as well.</p>
974
<p><strong>Module:</strong> channels</p>
977
<dt><strong>isperminvite <invite> [channel]</strong></dt>
980
<p><strong>Returns:</strong> 1 if the specified invite is in
981
the global invite list AND is marked as permanent; 0 otherwise.
982
If a channel is specified, that channel's invite list is
985
<p><strong>Module:</strong> channels</p>
988
<dt><strong>isbansticky <ban> [channel]</strong></dt>
991
<p><strong>Returns:</strong> 1 if the specified ban is marked as
992
sticky in the global ban list; 0 otherwise. If a channel is
993
specified, that channel's ban list is checked as well.</p>
995
<p><strong>Module:</strong> channels</p>
998
<dt><strong>isexemptsticky <exempt> [channel]</strong></dt>
1001
<p><strong>Returns:</strong> 1 if the specified exempt is marked
1002
as sticky in the global exempt list; 0 otherwise. If a channel is
1003
specified, that channel's exempt list is checked as well.</p>
1005
<p><strong>Module:</strong> channels</p>
1008
<dt><strong>isinvitesticky <invite> [channel]</strong></dt>
1011
<p><strong>Returns:</strong> 1 if the specified invite is marked
1012
as sticky in the global invite list; 0 otherwise. If a channel
1013
is specified, that channel's invite list is checked as well.</p>
1015
<p><strong>Module:</strong> channels</p>
1018
<dt><strong>matchban <nick!user@host> [channel]</strong></dt>
1021
<p><strong>Returns:</strong> 1 if the specified nick!user@host
1022
matches a ban in the global ban list; 0 otherwise. If a channel
1023
is specified, that channel's ban list is checked as well.</p>
1025
<p><strong>Module:</strong> channels</p>
1028
<dt><strong>matchexempt <nick!user@host>
1029
[channel]</strong></dt>
1032
<p><strong>Returns:</strong> 1 if the specified nick!user@host
1033
matches an exempt in the global exempt list; 0 otherwise. If a
1034
channel is specified, that channel's exempt list is checked
1037
<p><strong>Module:</strong> channels</p>
1040
<dt><strong>matchinvite <nick!user@host> [channel]</strong></dt>
1043
<p><strong>Returns:</strong> 1 if the specified nick!user@host
1044
matches an invite in the global invite list; 0 otherwise. If a
1045
channel is specified, that channel's invite list is checked
1048
<p><strong>Module:</strong> channels</p>
1051
<dt><strong>banlist [channel]</strong></dt>
1054
<p><strong>Returns:</strong> a list of global bans, or, if a
1055
channel is specified, a list of channel-specific bans. Each entry
1056
is a sublist containing: hostmask, comment, expiration timestamp,
1057
time added, last time active, and creator. The three timestamps
1058
are in unixtime format.</p>
1060
<p><strong>Module:</strong> channels</p>
1063
<dt><strong>exemptlist [channel]</strong></dt>
1066
<p><strong>Returns:</strong> a list of global exempts, or, if a
1067
channel is specified, a list of channel-specific exempts. Each
1068
entry is a sublist containing: hostmask, comment, expiration
1069
timestamp, time added, last time active, and creator. The three
1070
timestamps are in unixtime format.</p>
1072
<p><strong>Module:</strong> channels</p>
1075
<dt><strong>invitelist [channel]</strong></dt>
1078
<p><strong>Returns:</strong> a list of global invites, or, if a
1079
channel is specified, a list of channel-specific invites. Each
1080
entry is a sublist containing: hostmask, comment, expiration
1081
timestamp, time added, last time active, and creator. The three
1082
timestamps are in unixtime format.</p>
1084
<p><strong>Module:</strong> channels</p>
1087
<dt><strong>newignore <hostmask> <creator>
1088
<comment> [lifetime]</strong></dt>
1091
<p><strong>Description:</strong> adds an entry to the ignore list;
1092
creator is given credit for the ignore. lifetime is how many
1093
minutes until the ignore expires and is removed. If lifetime is
1094
not specified, ignore-time (usually 60) is used. Setting the
1095
lifetime to 0 makes it a permanent ignore.</p>
1097
<p><strong>Returns:</strong> nothing</p>
1099
<p><strong>Module:</strong> core</p>
1102
<dt><strong>killignore <hostmask></strong></dt>
1105
<p><strong>Description:</strong> removes an entry from the ignore
1108
<p><strong>Returns:</strong> 1 if successful; 0 otherwise</p>
1110
<p><strong>Module:</strong> core</p>
1113
<dt><strong>ignorelist</strong></dt>
1116
<p><strong>Returns:</strong> a list of ignores. Each entry is a
1117
sublist containing: hostmask, comment, expiration timestamp, time
1118
added, and creator. The timestamps are in unixtime format.</p>
1120
<p><strong>Module:</strong> core</p>
1123
<dt><strong>isignore <hostmask></strong></dt>
1126
<p><strong>Returns:</strong> 1 if the ignore is in the list;
1129
<p><strong>Module:</strong> core</p>
1132
<dt><strong>save</strong></dt>
1135
<p><strong>Description:</strong> writes the user and channel files
1138
<p><strong>Returns:</strong> nothing</p>
1140
<p><strong>Module:</strong> core</p>
1143
<dt><strong>reload</strong></dt>
1146
<p><strong>Description:</strong> loads the userfile from disk,
1147
replacing whatever is in memory</p>
1149
<p><strong>Returns:</strong> nothing</p>
1151
<p><strong>Module:</strong> core</p>
1154
<dt><strong>backup</strong></dt>
1157
<p><strong>Description:</strong> makes a simple backup of the
1158
userfile that's on disk. If the channels module is loaded,
1159
this also makes a simple backup of the channel file.</p>
1161
<p><strong>Returns:</strong> nothing</p>
1163
<p><strong>Module:</strong> core</p>
1166
<dt><strong>getting-users</strong></dt>
1169
<p><strong>Returns:</strong> 1 if the bot is currently downloading
1170
a userfile from a sharebot (and hence, user records are about to
1171
drastically change); 0 if not</p>
1173
<p><strong>Module:</strong> core</p>
1178
<p><a name="chancmds"></a>3. <strong>Channel commands</strong></p>
1182
<dt><strong>channel add <name> [option-list]</strong></dt>
1185
<p><strong>Description:</strong> adds a channel record for the
1186
bot to monitor. The full list of possible options are given in
1187
doc/settings/mod.channels. Note that the channel options must be
1188
in a list (enclosed in {}).</p>
1190
<p><strong>Returns:</strong> nothing</p>
1192
<p><strong>Module:</strong> channels</p>
1195
<dt><strong>channel set <name> <options...></strong></dt>
1198
<p><strong>Description:</strong> sets options for the channel
1199
specified. The full list of possible options are given in
1200
doc/settings/mod.channels.</p>
1202
<p><strong>Returns:</strong> nothing</p>
1204
<p><strong>Module:</strong> channels</p>
1207
<dt><strong>channel info <name></strong></dt>
1210
<p><strong>Returns:</strong> a list of info about the specified
1211
channel's settings.</p>
1213
<p><strong>Module:</strong> channels</p>
1216
<dt><strong>channel get <name> <setting></strong></dt>
1219
<p><strong>Returns:</strong> The value of the setting you specify.
1220
For flags, a value of 0 means it is disabled (-), and non-zero means
1223
<p><strong>Module:</strong> channels</p>
1226
<dt><strong>channel remove <name></strong></dt>
1229
<p><strong>Description:</strong> removes a channel record from
1230
the bot and makes the bot no longer monitor the channel</p>
1232
<p><strong>Returns:</strong> nothing</p>
1234
<p><strong>Module:</strong> channels</p>
1237
<dt><strong>savechannels</strong></dt>
1240
<p><strong>Description:</strong> saves the channel settings to
1241
the channel-file if one is defined.</p>
1243
<p><strong>Returns:</strong> nothing</p>
1245
<p><strong>Module:</strong> channels</p>
1248
<dt><strong>loadchannels</strong></dt>
1251
<p><strong>Description:</strong> reloads the channel settings from
1252
the channel-file if one is defined.</p>
1254
<p><strong>Returns:</strong> nothing</p>
1256
<p><strong>Module:</strong> channels</p>
1259
<dt><strong>channels</strong></dt>
1262
<p><strong>Returns:</strong> a list of the channels the bot has
1263
a channel record for</p>
1265
<p><strong>Module:</strong> channels</p>
1268
<dt><strong>channame2dname <channel-name></strong></dt>
1269
<dt><strong>chandname2name <channel-dname></strong></dt>
1272
<p><strong>Description:</strong> these two functions are important
1273
to correctly support !channels. The bot differentiates between
1274
channel description names (chan dnames) and real channel names
1275
(chan names). The chan dnames are what you would normally call
1276
the channel, such as "!channel". The chan names are
1277
what the IRC server uses to identify the channel. They consist
1278
of the chan dname prefixed with an ID; such as
1279
"!ABCDEchannel".</p>
1281
<p>For bot functions like isop, isvoice, etc. you need to know
1282
the chan dnames. If you communicate with the server, you usually
1283
get the chan name, though. That's what you need the
1284
channame2dname function for.</p>
1286
<p>If you only have the chan dname and want to directly send raw
1287
server commands, use the chandname2name command.</p>
1289
<p>For non-!channels, chan dname and chan name are the same.</p>
1291
<p><strong>Module:</strong> irc</p>
1294
<dt><strong>isbotnick <nick></strong></dt>
1297
<p><strong>Returns:</strong> 1 if the nick matches the botnick;
1300
<p><strong>Module:</strong> server</p>
1303
<dt><strong>botisop [channel]</strong></dt>
1306
<p><strong>Returns:</strong> 1 if the bot has ops on the specified
1307
channel (or any channel if no channel is specified); 0
1310
<p><strong>Module:</strong> irc</p>
1313
<dt><strong>botishalfop [channel]</strong></dt>
1316
<p><strong>Returns:</strong> 1 if the bot has halfops on the
1317
specified channel (or any channel if no channel is specified); 0
1320
<p><strong>Module:</strong> irc</p>
1323
<dt><strong>botisvoice [channel]</strong></dt>
1326
<p><strong>Returns:</strong> 1 if the bot has a voice on the
1327
specified channel (or any channel if no channel is specified); 0
1330
<p><strong>Module:</strong> irc</p>
1333
<dt><strong>botonchan [channel]</strong></dt>
1336
<p><strong>Returns:</strong> 1 if the bot is on the specified
1337
channel (or any channel if no channel is specified); 0
1340
<p><strong>Module:</strong> irc</p>
1343
<dt><strong>isop <nickname> [channel]</strong></dt>
1346
<p><strong>Returns:</strong> 1 if someone by the specified
1347
nickname is on the channel (or any channel if no channel name is
1348
specified) and has ops; 0 otherwise</p>
1350
<p><strong>Module:</strong> irc</p>
1353
<dt><strong>ishalfop <nickname> [channel]</strong></dt>
1356
<p><strong>Returns:</strong> 1 if someone by the specified
1357
nickname is on the channel (or any channel if no channel name is
1358
specified) and has halfops; 0 otherwise</p>
1360
<p><strong>Module:</strong> irc</p>
1363
<dt><strong>wasop <nickname> <channel></strong></dt>
1366
<p><strong>Returns:</strong> 1 if someone that just got
1367
opped/deopped in the chan had op before the modechange; 0
1370
<p><strong>Module:</strong> irc</p>
1373
<dt><strong>washalfop <nickname> <channel></strong></dt>
1376
<p><strong>Returns:</strong> 1 if someone that just got
1377
halfopped/dehalopped in the chan had halfop before the modechange; 0
1380
<p><strong>Module:</strong> irc</p>
1383
<dt><strong>isvoice <nickname> [channel]</strong></dt>
1386
<p><strong>Returns:</strong> 1 if someone by that nickname is on
1387
the channel (or any channel if no channel is specified) and has
1388
voice (+v); 0 otherwise</p>
1390
<p><strong>Module:</strong> irc</p>
1393
<dt><strong>onchan <nickname> [channel]</strong></dt>
1396
<p><strong>Returns:</strong> 1 if someone by that nickname is on
1397
the specified channel (or any channel if none is specified); 0
1400
<p><strong>Module:</strong> irc</p>
1403
<dt><strong>nick2hand <nickname> [channel]</strong></dt>
1406
<p><strong>Returns:</strong> the handle of a nickname on a channel.
1407
If a channel is not specified, the bot will check all of its
1408
channels. If the nick is not found, "" is returned. If
1409
the nick is found but does not have a handle, "*" is
1412
<p><strong>Module:</strong> irc</p>
1415
<dt><strong>hand2nick <handle> [channel]</strong></dt>
1418
<p><strong>Returns:</strong> nickname of the first person on the
1419
specified channel (if one is specified) whose nick!user@host
1420
matches the given handle; "" is returned if no match
1421
is found. If no channel is specified, all channels are checked.</p>
1423
<p><strong>Module:</strong> irc</p>
1426
<dt><strong>handonchan <handle> [channel]</strong></dt>
1429
<p><strong>Returns:</strong> 1 if the the nick!user@host for
1430
someone on the channel (or any channel if no channel name is
1431
specified) matches for the handle given; 0 otherwise</p>
1433
<p><strong>Module:</strong> irc</p>
1436
<dt><strong>ischanban <ban> <channel></strong></dt>
1439
<p><strong>Returns:</strong> 1 if the specified ban is on the
1440
given channel's ban list (not the bot's banlist for the
1443
<p><strong>Module:</strong> irc</p>
1446
<dt><strong>ischanexempt <exempt> <channel></strong></dt>
1449
<p><strong>Returns:</strong> 1 if the specified exempt is on the
1450
given channel's exempt list (not the bot's exemptlist for
1453
<p><strong>Module:</strong> irc</p>
1456
<dt><strong>ischaninvite <invite> <channel></strong></dt>
1459
<p><strong>Returns:</strong> 1 if the specified invite is on the
1460
given channel's invite list (not the bot's invitelist for
1463
<p><strong>Module:</strong> irc</p>
1466
<dt><strong>chanbans <channel></strong></dt>
1469
<p><strong>Returns:</strong> a list of the current bans on the
1470
channel. Each element is a sublist of the form {<ban>
1471
<bywho> <age>}. age is seconds from the bot's
1474
<p><strong>Module:</strong> irc</p>
1477
<dt><strong>chanexempts <channel></strong></dt>
1480
<p><strong>Returns:</strong> a list of the current exempts on the
1481
channel. Each element is a sublist of the form {<exempts>
1482
<bywho> <age>}. age is seconds from the bot's
1485
<p><strong>Module:</strong> irc</p>
1488
<dt><strong>chaninvites <channel></strong></dt>
1491
<p><strong>Returns:</strong> a list of the current invites on the
1492
channel. Each element is a sublist of the form {<invites>
1493
<bywho> <age>}. age is seconds from the bot's
1496
<p><strong>Module:</strong> irc</p>
1499
<dt><strong>resetbans <channel></strong></dt>
1502
<p><strong>Description:</strong> removes all bans on the channel
1503
that aren't in the bot's ban list and refreshes any bans
1504
that should be on the channel but aren't</p>
1506
<p><strong>Returns:</strong> nothing</p>
1508
<p><strong>Module:</strong> irc</p>
1511
<dt><strong>resetexempts [channel]</strong></dt>
1514
<p><strong>Description:</strong> removes all exempt on the channel
1515
that aren't in the bot's exempt list and refreshes any
1516
exempts that should be on the channel but aren't</p>
1518
<p><strong>Returns:</strong> nothing</p>
1520
<p><strong>Module:</strong> irc</p>
1523
<dt><strong>resetinvites [channel]</strong></dt>
1526
<p><strong>Description:</strong> removes all invites on the channel
1527
that aren't in the bot's invite list and refreshes any
1528
invites that should be on the channel but aren't</p>
1530
<p><strong>Returns:</strong> nothing</p>
1532
<p><strong>Module:</strong> irc</p>
1535
<dt><strong>resetchan <channel></strong></dt>
1538
<p><strong>Description:</strong> </p>
1540
<p><strong>Returns:</strong> rereads in the channel info from the
1543
<p><strong>Module:</strong> irc</p>
1546
<dt><strong>getchanhost <nickname> [channel]</strong></dt>
1549
<p><strong>Returns:</strong> user@host of the specified nickname
1550
(the nickname is not included in the returned host). If a channel
1551
is not specified, bot will check all of its channels. If the
1552
nickname is not on the channel(s), "" is returned.</p>
1554
<p><strong>Module:</strong> irc</p>
1557
<dt><strong>getchanjoin <nickname> <channel></strong></dt>
1560
<p><strong>Returns:</strong> timestamp (unixtime format) of when
1561
the specified nickname joined the channel</p>
1563
<p><strong>Module:</strong> irc</p>
1566
<dt><strong>onchansplit <nick> [channel]</strong></dt>
1569
<p><strong>Returns:</strong> 1 if that nick is split from the
1570
channel (or any channel if no channel is specified); 0
1573
<p><strong>Module:</strong> irc</p>
1576
<dt><strong>chanlist <channel>
1577
[flags[&chanflags]]</strong></dt>
1580
<p><strong>Description:</strong> flags are any global flags; the
1581
'&' denotes to look for channel specific flags.
1588
<p><strong>n</strong></p>
1598
<p><strong>&n</strong></p>
1602
<p>Channel Owner</p>
1608
<p><strong>o&m</strong></p>
1612
<p>Global Op, Channel Master</p>
1618
<p><strong>Returns:</strong> list of nicknames currently on the
1619
bot's channel that have all of the flags specified;. If no
1620
flags are given, all of the nicknames are returned. Please note
1621
that if you're executing chanlist after a part or sign bind,
1622
the gone user will still be listed, so you can check for wasop,
1625
<p><strong>Module:</strong> irc</p>
1628
<dt><strong>getchanidle <nickname> <channel></strong></dt>
1631
<p><strong>Returns:</strong> number of minutes that person has
1632
been idle; 0 if the specified user isn't on the channel</p>
1634
<p><strong>Module:</strong> irc</p>
1637
<dt><strong>getchanmode <channel></strong></dt>
1640
<p><strong>Returns:</strong> string of the type "+ntik
1641
key" for the channel specified</p>
1643
<p><strong>Module:</strong> irc</p>
1646
<dt><strong>jump [server [port [password]]]</strong></dt>
1649
<p><strong>Description:</strong> jumps to the server specified,
1650
or (if none is specified) the next server in the bot's
1653
<p><strong>Returns:</strong> nothing</p>
1655
<p><strong>Module:</strong> server</p>
1658
<dt><strong>pushmode <channel> <mode> [arg]</strong></dt>
1661
<p><strong>Description:</strong> sends out a channel mode change
1662
(ex: pushmode #lame +o goober) through the bot's queuing
1663
system. All the mode changes will be sent out at once (combined
1664
into one line as much as possible) after the script finishes, or
1665
when 'flushmode' is called.</p>
1667
<p><strong>Returns:</strong> nothing</p>
1669
<p><strong>Module:</strong> irc</p>
1672
<dt><strong>flushmode <channel></strong></dt>
1675
<p><strong>Description:</strong> forces all previously pushed
1676
channel mode changes to be sent to the server, instead of when
1677
the script is finished (just for the channel specified)</p>
1679
<p><strong>Returns:</strong> nothing</p>
1681
<p><strong>Module:</strong> irc</p>
1684
<dt><strong>topic <channel></strong></dt>
1687
<p><strong>Returns:</strong> string containing the current topic
1688
of the specified channel</p>
1690
<p><strong>Module:</strong> irc</p>
1693
<dt><strong>validchan <channel></strong></dt>
1696
<p><strong>Description:</strong> checks if the bot has a channel
1697
record for the specified channel. Note that this does not
1698
necessarily mean that the bot is ON the channel.</p>
1700
<p><strong>Returns:</strong> 1 if the channel exists, 0 if not</p>
1702
<p><strong>Module:</strong> nothing</p>
1705
<dt><strong>isdynamic <channel></strong></dt>
1708
<p><strong>Returns:</strong> 1 if the channel is a dynamic
1709
channel; 0 otherwise</p>
1711
<p><strong>Module:</strong> channels</p>
1714
<dt><strong>setudef <flag/int/str> <name></strong></dt>
1717
<p><strong>Description:</strong> initializes a user defined channel
1718
flag, string, or integer setting. You can use it like any other
1719
flag/setting. IMPORTANT: Don't forget to reinitialize your
1720
flags/settings after a restart, or it'll be lost.</p>
1722
<p><strong>Returns:</strong> nothing</p>
1724
<p><strong>Module:</strong> channels</p>
1727
<dt><strong>renudef <flag/int/str> <oldname>
1728
<newname></strong></dt>
1731
<p><strong>Description:</strong> renames a user defined channel
1732
flag, string, or integer setting.</p>
1734
<p><strong>Returns:</strong> nothing</p>
1736
<p><strong>Module:</strong> channels</p>
1739
<dt><strong>deludef <flag/int/str> <name></strong></dt>
1742
<p><strong>Description:</strong> deletes a user defined channel
1743
flag, string, or integer setting.</p>
1745
<p><strong>Returns:</strong> nothing</p>
1747
<p><strong>Module:</strong> channels</p>
1752
<p><a name="dcccmds"></a>4. <strong>Dcc commands</strong></p>
1756
<dt><strong>putdcc <idx> <text></strong></dt>
1759
<p><strong>Description:</strong> sends text to the idx specified</p>
1761
<p><strong>Returns:</strong> nothing</p>
1763
<p><strong>Module:</strong> core</p>
1766
<dt><strong>dccbroadcast <message></strong></dt>
1769
<p><strong>Description:</strong> sends a message to everyone on
1770
the party line across the botnet, in the form of "***
1771
<message>" for local users and "*** (Bot)
1772
<message>" for users on other bots</p>
1774
<p><strong>Returns:</strong> nothing</p>
1776
<p><strong>Module:</strong> core</p>
1779
<dt><strong>dccputchan <channel> <message></strong></dt>
1782
<p><strong>Description:</strong> sends your message to everyone
1783
on a certain channel on the botnet, in a form exactly like
1784
dccbroadcast does. Valid channels are 0 through 99999.</p>
1786
<p><strong>Returns:</strong> nothing</p>
1788
<p><strong>Module:</strong> core</p>
1791
<dt><strong>boot <user@bot> [reason]</strong></dt>
1794
<p><strong>Description:</strong> boots a user from the partyline</p>
1796
<p><strong>Returns:</strong> nothing</p>
1798
<p><strong>Module:</strong> core</p>
1801
<dt><strong>dccsimul <idx> <text></strong></dt>
1804
<p><strong>Description:</strong> simulates text typed in by the
1805
dcc user specified. Note that in v0.9, this only simulated
1806
commands; now a command must be preceded by a '.' to be
1809
<p><strong>Returns:</strong> nothing</p>
1811
<p><strong>Module:</strong> core</p>
1814
<dt><strong>hand2idx <handle></strong></dt>
1817
<p><strong>Returns:</strong> the idx (a number greater than or
1818
equal to zero) for the user given if the user is on the party
1819
line in chat mode (even if she is currently on a channel or in
1820
chat off), the file area, or in the control of a script. -1 is
1821
returned if no idx is found. If the user is on multiple times,
1822
the oldest idx is returned.</p>
1824
<p><strong>Module:</strong> core</p>
1827
<dt><strong>idx2hand <idx></strong></dt>
1830
<p><strong>Returns:</strong> handle of the user with the given
1833
<p><strong>Module:</strong> core</p>
1836
<dt><strong>valididx <idx></strong></dt>
1839
<p><strong>Returns:</strong> 1 if the idx currently exists; 0
1842
<p><strong>Module:</strong> core</p>
1845
<dt><strong>getchan <idx></strong></dt>
1848
<p><strong>Returns:</strong> the current party line channel
1849
for a user on the party line; "0" indicates he's
1850
on the group party line, "-1" means he has chat off,
1851
and a value from 1 to 99999 is a private channel</p>
1853
<p><strong>Module:</strong> core</p>
1856
<dt><strong>setchan <idx> <channel></strong></dt>
1859
<p><strong>Description:</strong> sets a party line user's
1860
channel. The party line user is not notified that she is now on
1861
a new channel. A channel name can be used (provided it exists).</p>
1863
<p><strong>Returns:</strong> nothing</p>
1865
<p><strong>Module:</strong> core</p>
1868
<dt><strong>console <idx> [channel]
1869
[console-modes]</strong></dt>
1872
<p><strong>Description:</strong> changes a dcc user's console
1873
mode, either to an absolute mode (like "mpj") or just
1874
adding/removing flags (like "+pj" or "-moc"
1875
or "+mp-c"). The user's console channel view can be
1876
changed also (as long as the new channel is a valid channel).</p>
1878
<p><strong>Returns:</strong> a list containing the user's (new)
1879
channel view and (new) console modes, or nothing if that user
1880
isn't currently on the partyline</p>
1882
<p><strong>Module:</strong> core</p>
1885
<dt><strong>echo <idx> [status]</strong></dt>
1888
<p><strong>Description:</strong> turns a user's echo on or
1889
off; the status has to be a 1 or 0</p>
1891
<p><strong>Returns:</strong> new value of echo for that user (or
1892
the current value, if status was omitted)</p>
1894
<p><strong>Module:</strong> core</p>
1897
<dt><strong>strip <idx> [+/-strip-flags]</strong></dt>
1900
<p><strong>Description:</strong> modifies the strip-flags for a
1903
<p><strong>Returns:</strong> new strip-flags for the specified user
1904
(or the current flags, if strip-flags was omitted)</p>
1906
<p><strong>Module:</strong> core</p>
1909
<dt><strong>putbot <bot-nick> <message></strong></dt>
1912
<p><strong>Description:</strong> sends a message across the
1913
botnet to another bot. If no script intercepts the message on
1914
the other end, the message is ignored.</p>
1916
<p><strong>Returns:</strong> nothing</p>
1918
<p><strong>Module:</strong> core</p>
1921
<dt><strong>putallbots <message></strong></dt>
1924
<p><strong>Description:</strong> sends a message across the botnet
1925
to all bots. If no script intercepts the message on the other end,
1926
the message is ignored.</p>
1928
<p><strong>Returns:</strong> nothing</p>
1930
<p><strong>Module:</strong> core</p>
1933
<dt><strong>killdcc <idx></strong></dt>
1936
<p><strong>Description:</strong> kills a partyline or file area
1939
<p><strong>Returns:</strong> nothing</p>
1941
<p><strong>Module:</strong> core</p>
1944
<dt><strong>bots</strong></dt>
1947
<p><strong>Returns:</strong> list of the bots currently connected
1950
<p><strong>Module:</strong> core</p>
1953
<dt><strong>botlist</strong></dt>
1956
<p><strong>Returns:</strong> a list of bots currently on the
1957
botnet. Each item in the list is a sublist with four elements:
1958
bot, uplink, version, sharing status:</p>
1964
<p><strong>bot</strong></p>
1968
<p>the bot's botnetnick</p>
1974
<p><strong>uplink</strong></p>
1978
<p>the bot the bot is connected to</p>
1984
<p><strong>version</strong></p>
1988
<p>its current numeric version</p>
1994
<p><strong>sharing</strong></p>
1998
<p>a "+" if the bot is a sharebot; "-"
2005
<p><strong>Module:</strong> core</p>
2008
<dt><strong>killdcc <idx></strong></dt>
2011
<p><strong>Description:</strong> kills a partyline or file area
2014
<p><strong>Returns:</strong> nothing</p>
2016
<p><strong>Module:</strong> core</p>
2019
<dt><strong>islinked <bot></strong></dt>
2022
<p><strong>Returns:</strong> 1 if the bot is currently linked; 0
2025
<p><strong>Module:</strong> core</p>
2028
<dt><strong>dccused</strong></dt>
2031
<p><strong>Returns:</strong> number of dcc connections currently
2034
<p><strong>Module:</strong> core</p>
2037
<dt><strong>dcclist [type]</strong></dt>
2040
<p><strong>Returns:</strong> a list of active connections, each
2041
item in the list is a sublist containing six elements: {<idx>
2042
<handle> <hostname> <type> {<other>}
2043
<timestamp>}</p>
2045
<p>The types are: chat, bot, files, file_receiving, file_sending,
2046
file_send_pending, script, socket (these are connections that
2047
have not yet been put under 'control'), telnet, and server.
2048
The timestamp is in unixtime format.</p>
2050
<p><strong>Module:</strong> core</p>
2053
<dt><strong>whom <chan></strong></dt>
2056
<p><strong>Returns:</strong> list of people on the botnet who are
2057
on that channel. 0 is the default party line. Each item in the
2058
list is a sublist with six elements: nickname, bot, hostname,
2059
access flag ('-', '@', '+', or
2060
'*'), minutes idle, and away message (blank if the user
2061
is not away). If you specify * for channel, every user on the
2062
botnet is returned with an extra argument indicating the channel
2065
<p><strong>Module:</strong> core</p>
2068
<dt><strong>getdccidle <idx></strong></dt>
2071
<p><strong>Returns:</strong> number of seconds the dcc chat/file
2072
system/script user has been idle</p>
2074
<p><strong>Module:</strong> core</p>
2077
<dt><strong>getdccaway <idx></strong></dt>
2080
<p><strong>Returns:</strong> away message for a dcc chat user
2081
(or "" if the user is not set away)</p>
2083
<p><strong>Module:</strong> core</p>
2086
<dt><strong>setdccaway <idx> <message></strong></dt>
2089
<p><strong>Description:</strong> sets a party line user's away
2090
message and marks them away. If set to "", the user is
2091
marked as no longer away.</p>
2093
<p><strong>Returns:</strong> nothing</p>
2095
<p><strong>Module:</strong> core</p>
2098
<dt><strong>connect <host> <port></strong></dt>
2101
<p><strong>Description:</strong> makes an outgoing connection
2102
attempt and creates a dcc entry for it. A 'control'
2103
command should be used immediately after a successful
2104
'connect' so no input is lost.</p>
2106
<p><strong>Returns:</strong> idx of the new connection</p>
2108
<p><strong>Module:</strong> core</p>
2111
<dt><strong>listen <port> <type> [options]
2112
[flag]</strong></dt>
2115
<p><strong>Description:</strong> opens a listening port to accept
2116
incoming telnets; type must be one of "bots",
2117
"all", "users", "script", or
2118
"off":</p>
2122
<dt><strong>listen <port> bots [mask]</strong></dt>
2125
<p><strong>Description:</strong> accepts connections from
2126
bots only; the optional mask is used to identify permitted
2127
bot names. If the mask begins with '@', it is
2128
interpreted to be a mask of permitted hosts to accept
2129
connections from.</p>
2131
<p><strong>Returns:</strong> port number</p>
2134
<dt><strong>listen <port> users [mask]</strong></dt>
2137
<p><strong>Description:</strong> accepts connections from
2138
users only (no bots); the optional mask is used to identify
2139
permitted nicknames. If the mask begins with '@', it
2140
is interpreted to be a mask of permitted hosts to accept
2141
connections from.</p>
2143
<p><strong>Returns:</strong> port number</p>
2146
<dt><strong>listen <port> all [mask]</strong></dt>
2149
<p><strong>Description:</strong> accepts connections from
2150
anyone; the optional mask is used to identify permitted
2151
nicknames/botnames. If the mask begins with '@',
2152
it is interpreted to be a mask of permitted hosts to accept
2153
connections from.</p>
2155
<p><strong>Returns:</strong> port number</p>
2158
<dt><strong>listen <port> script <proc>
2159
[flag]</strong></dt>
2162
<p><strong>Description:</strong> accepts connections which
2163
are immediately routed to a proc. The proc is called with
2164
one parameter: the idx of the new connection. Flag may
2165
currently only be 'pub', which makes the bot allow
2166
anyone to connect.</p>
2168
<p><strong>Returns:</strong> port number</p>
2171
<dt><strong>listen <port> off</strong></dt>
2174
<p><strong>Description:</strong> stop listening on a port</p>
2176
<p><strong>Returns:</strong> nothing</p>
2181
<p><strong>Module:</strong> core</p>
2184
<dt><strong>dccdumpfile <idx> <filename></strong></dt>
2187
<p><strong>Description:</strong> dumps out a file from the text
2188
directory to a dcc chat user. The flag matching that's used
2189
everywhere else works here, too.</p>
2191
<p><strong>Returns:</strong> nothing</p>
2193
<p><strong>Module:</strong> core</p>
2198
<p><a name="notes"></a>5. <strong>Notes module</strong></p>
2202
<dt><strong>notes <user> [numberlist]</strong></dt>
2205
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
2206
failure. If a numberlist is not specified, the number of notes
2207
stored for the user is returned. Otherwise, a list of sublists
2208
containing information about notes stored for the user is
2209
returned. Each sublist is in the format of: {<from>
2210
<timestamp> <note text>}.</p>
2212
<p><strong>Module:</strong> notes</p>
2215
<dt><strong>erasenotes <user> <numberlist></strong></dt>
2218
<p><strong>Description:</strong> erases some or all stored notes
2219
for a user. Use '-' to erase all notes.</p>
2221
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
2222
failure, 0 if no such note, or number of erased notes.</p>
2224
<p><strong>Module:</strong> notes</p>
2227
<dt><strong>listnotes <user> <numberlist></strong></dt>
2230
<p><strong>Description:</strong> lists existing notes according
2231
to the numberlist (ex: "2-4;8;16-")</p>
2233
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
2234
failure, 0 if no such note, list of existing notes.</p>
2236
<p><strong>Module:</strong> notes</p>
2239
<dt><strong>storenote <from> <to> <msg>
2240
<idx></strong></dt>
2243
<p><strong>Description:</strong> stores a note for later reading,
2244
notifies idx of any results (use idx -1 for no notify).</p>
2246
<p><strong>Returns:</strong> 0 on success; non-0 on failure</p>
2248
<p><strong>Module:</strong> notes</p>
2253
<p><a name="assoc"></a>6. <strong>Assoc module</strong></p>
2257
<dt><strong>assoc <chan> [name]</strong></dt>
2260
<p><strong>Description:</strong> sets the name associated with a
2261
botnet channel, if you specify one</p>
2263
<p><strong>Returns:</strong> current name for that channel, if
2266
<p><strong>Module:</strong> assoc</p>
2269
<dt><strong>killassoc <chan></strong></dt>
2272
<p><strong>Description:</strong> removes the name associated
2273
with a botnet channel, if any exists. Use 'killassoc &'
2274
to kill all assocs.</p>
2276
<p><strong>Returns:</strong> nothing</p>
2278
<p><strong>Module:</strong> assoc</p>
2283
<p><a name="compress"></a>7. <strong>Compress module</strong></p>
2287
<dt><strong>compressfile [-level <level>] <src-file>
2289
uncompressfile <src-file> [target-file]</strong></dt>
2292
<p><strong>Description:</strong> compresses or un-compresses
2293
files. The level option specifies the compression mode to use
2294
when compressing. Available modes are from 0 (minimum CPU usage,
2295
minimum compression) all the way up to 9 (maximum CPU usage,
2296
maximum compression). If you don't specify the target-file,
2297
the src-file will be overwritten.</p>
2299
<p><strong>Returns:</strong> nothing</p>
2301
<p><strong>Module:</strong> compress</p>
2304
<dt><strong>iscompressed <filename></strong></dt>
2307
<p><strong>Description:</strong> determines whether
2308
<filename> is gzip compressed. Returns 1 if it is, 0 if it
2309
isn't, and 2 if some kind of error prevented the checks from
2312
<p><strong>Returns:</strong> nothing</p>
2314
<p><strong>Module:</strong> compress</p>
2319
<p><a name="filesys"></a>8. <strong>Filesys module</strong></p>
2323
<dt><strong>setpwd <idx> <dir></strong></dt>
2326
<p><strong>Description:</strong> changes the directory of a file
2327
system user, in exactly the same way as a 'cd' command
2328
would. The directory can be specified relative or absolute.</p>
2330
<p><strong>Returns:</strong> nothing</p>
2332
<p><strong>Module:</strong> filesys</p>
2335
<dt><strong>getpwd <idx></strong></dt>
2338
<p><strong>Returns:</strong> the current directory of a file
2341
<p><strong>Module:</strong> filesys</p>
2344
<dt><strong>getfiles <dir></strong></dt>
2347
<p><strong>Returns:</strong> a list of files in the directory
2348
given; the directory is relative to dcc-path</p>
2350
<p><strong>Module:</strong> filesys</p>
2353
<dt><strong>getdirs <dir></strong></dt>
2356
<p><strong>Returns:</strong> a list of subdirectories in the
2357
directory given; the directory is relative to dcc-path</p>
2359
<p><strong>Module:</strong> filesys</p>
2362
<dt><strong>dccsend <filename> <ircnick></strong></dt>
2365
<p><strong>Description:</strong> attempts to start a dcc file
2366
transfer to the given nick; the filename must be specified either
2367
by full pathname or in relation to the bot's startup
2370
<p><strong>Returns:</strong></p>
2376
<p><strong>0</strong></p>
2386
<p><strong>1</strong></p>
2390
<p>the dcc table is full (too many connections)</p>
2396
<p><strong>2</strong></p>
2400
<p>can't open a socket for the transfer</p>
2406
<p><strong>3</strong></p>
2410
<p>the file doesn't exist</p>
2416
<p><strong>4</strong></p>
2420
<p>the file was queued for later transfer, which means that
2421
person has too many file transfers going right now</p>
2427
<p><strong>5</strong></p>
2431
<p>copy-to-tmp is enabled and the file already exists in the
2438
<p><strong>Module:</strong> transfer</p>
2441
<dt><strong>filesend <idx> <filename>
2442
[ircnick]</strong></dt>
2445
<p><strong>Description:</strong> like dccsend, except it operates
2446
for a current filesystem user, and the filename is assumed to be
2447
a relative path from that user's current directory</p>
2449
<p><strong>Returns:</strong> 0 on failure; 1 on success (either an
2450
immediate send or a queued send)</p>
2452
<p><strong>Module:</strong> filesys</p>
2455
<dt><strong>fileresend <idx> <filename>
2456
[ircnick]</strong></dt>
2459
<p><strong>Description:</strong> functions like filesend, only that
2460
it sends a DCC RESEND instead of a DCC SEND, which allows people
2461
to resume aborted file transfers if their client supports that
2462
protocol. ircII/BitchX/etc. support it; mIRC does not.</p>
2464
<p><strong>Returns:</strong> 0 on failure; 1 on success (either
2465
an immediate send or a queued send)</p>
2467
<p><strong>Module:</strong> filesys</p>
2470
<dt><strong>setdesc <dir> <file> <desc></strong></dt>
2473
<p><strong>Description:</strong> sets the description for a file
2474
in a file system directory; the directory is relative to
2477
<p><strong>Returns:</strong> nothing</p>
2479
<p><strong>Module:</strong> filesys</p>
2482
<dt><strong>getdesc <dir> <file></strong></dt>
2485
<p><strong>Returns:</strong> the description for a file in the
2486
file system, if one exists</p>
2488
<p><strong>Module:</strong> filesys</p>
2491
<dt><strong>setowner <dir> <file>
2492
<handle></strong></dt>
2495
<p><strong>Description:</strong> changes the owner for a file in
2496
the file system; the directory is relative to dcc-path</p>
2498
<p><strong>Returns:</strong> nothing</p>
2500
<p><strong>Module:</strong> filesys</p>
2503
<dt><strong>getowner <dir> <file></strong></dt>
2506
<p><strong>Returns:</strong> the owner of a file in the file
2509
<p><strong>Module:</strong> filesys</p>
2512
<dt><strong>setlink <dir> <file> <link></strong></dt>
2515
<p><strong>Description:</strong> creates or changes a linked file
2516
(a file that actually exists on another bot); the directory is
2517
relative to dcc-path</p>
2519
<p><strong>Returns:</strong> nothing</p>
2521
<p><strong>Module:</strong> filesys</p>
2524
<dt><strong>getlink <dir> <file></strong></dt>
2527
<p><strong>Returns:</strong> the link for a linked file, if it
2530
<p><strong>Module:</strong> filesys</p>
2533
<dt><strong>getfileq <handle></strong></dt>
2536
<p><strong>Returns:</strong> list of files queued by someone;
2537
each item in the list will be a sublist with two elements: nickname
2538
the file is being sent to and the filename</p>
2540
<p><strong>Module:</strong> transfer</p>
2543
<dt><strong>getfilesendtime <idx></strong></dt>
2546
<p><strong>Returns:</strong> the unixtime value for when a file
2547
transfer started, or a negative number:</p>
2553
<p><strong>-1</strong></p>
2557
<p>no matching transfer with the specified idx was found</p>
2563
<p><strong>-2</strong></p>
2567
<p>the idx matches an entry which is not a file transfer</p>
2573
<p><strong>Module:</strong> transfer</p>
2576
<dt><strong>mkdir <directory> [<required-flags>
2577
[channel]]</strong></dt>
2580
<p><strong>Description:</strong> creates a directory in the file
2581
system. Only users with the required flags may access it.</p>
2583
<p><strong>Returns:</strong></p>
2589
<p><strong>0</strong></p>
2599
<p><strong>1</strong></p>
2603
<p>can't create directory</p>
2609
<p><strong>2</strong></p>
2613
<p>directory exists but is not a directory</p>
2619
<p><strong>Module:</strong> filesys</p>
2622
<dt><strong>rmdir <directory></strong></dt>
2625
<p><strong>Description:</strong> removes a directory from the
2628
<p><strong>Returns:</strong> 0 on success; 1 on failure</p>
2630
<p><strong>Module:</strong> filesys</p>
2633
<dt><strong>mv <file> <destination></strong></dt>
2636
<p><strong>Description:</strong> moves a file from its source to
2637
the given destination. The file can also be a mask, such as
2638
/incoming/*, provided the destination is a directory.</p>
2640
<p><strong>Returns:</strong> If the command was successful, the
2641
number of files moved will be returned. Otherwise, a negative
2642
number will be returned:</p>
2648
<p><strong>-1</strong></p>
2652
<p>invalid source file</p>
2658
<p><strong>-2</strong></p>
2662
<p>invalid destination</p>
2668
<p><strong>-3</strong></p>
2672
<p>destination file exists</p>
2678
<p><strong>-4</strong></p>
2682
<p>no matches found</p>
2688
<p><strong>Module:</strong> filesys</p>
2691
<dt><strong>cp <file> <destination></strong></dt>
2694
<p><strong>Description:</strong> copies a file from its source
2695
to the given destination. The file can also be a mask, such as
2696
/incoming/*, provided the destination is a directory.</p>
2698
<p><strong>Returns:</strong> If the command was successful, the
2699
number of files copied will be returned. Otherwise, a negative
2700
number will be returned:</p>
2706
<p><strong>-1</strong></p>
2710
<p>invalid source file</p>
2716
<p><strong>-2</strong></p>
2720
<p>invalid destination</p>
2726
<p><strong>-3</strong></p>
2730
<p>destination file exists</p>
2736
<p><strong>-4</strong></p>
2740
<p>no matches found</p>
2746
<p><strong>Module:</strong> filesys</p>
2749
<dt><strong>getflags <dir></strong></dt>
2752
<p><strong>Returns:</strong> the flags required to access a
2755
<p><strong>Module:</strong> filesys</p>
2758
<dt><strong>setflags <dir> [<flags>
2759
[channel]]</strong></dt>
2762
<p><strong>Description:</strong> sets the flags required to
2763
access a directory</p>
2765
<p><strong>Returns:</strong> 0 on success; -1 on failure</p>
2767
<p><strong>Module:</strong> filesys</p>
2772
<p><a name="misc"></a>9. <strong>Miscellaneous commands</strong></p>
2776
<dt><strong>bind <type> <flags> <keyword/mask>
2777
[proc-name]</strong></dt>
2780
<p><strong>Description:</strong> You can use the 'bind'
2781
command to attach Tcl procedures to certain events. flags are the
2782
flags the user must have to trigger the event (if applicable).
2783
proc-name is the name of the Tcl procedure to call for this
2784
command (see below for the format of the procedure call). If the
2785
proc-name is omitted, no binding is added. Instead, the current
2786
binding is returned (if it's stackable, a list of the current
2787
bindings is returned).</p>
2789
<p><strong>Returns:</strong> name of the command that was added,
2790
or (if proc-name was omitted), a list of the current bindings for
2793
<p><strong>Module:</strong> core</p>
2796
<dt><strong>unbind <type> <flags> <keyword/mask>
2797
<proc-name></strong></dt>
2800
<p><strong>Description:</strong> removes a previously created
2803
<p><strong>Returns:</strong> name of the command that was
2806
<p><strong>Module:</strong> core</p>
2809
<dt><strong>binds [type/mask]</strong></dt>
2812
<p><strong>Returns:</strong> a list of Tcl binds, each item in the
2813
list is a sublist of five elements: {<type> <flags>
2814
<name> <hits> <proc>}</p>
2816
<p><strong>Module:</strong> core</p>
2819
<dt><strong>logfile [<modes> <channel>
2820
<filename>]</strong></dt>
2823
<p><strong>Description:</strong> creates a new logfile, which will
2824
log the modes given for the channel listed. If no logfile is
2825
specified, a list of existing logfiles will be returned.
2826
"*" indicates all channels. You can also change the
2827
modes and channel of an existing logfile with this command.
2828
Entering a blank mode and channel ("") makes the bot
2829
stop logging there.</p>
2831
<p><strong>Returns:</strong> filename of logfile created, or, if
2832
no logfile is specified, a list of logfiles such as: {mco *
2833
eggdrop.log} {jp #lame lame.log}</p>
2835
<p><strong>Module:</strong> core</p>
2838
<dt><strong>maskhost <nick!user@host></strong></dt>
2841
<p><strong>Returns:</strong> masked hostmask for the string
2842
given ("n!u@1.2.3.4" -> "*!u@1.2.3.*",
2843
"n!u@lame.com" -> "*!u@lame.com",
2844
"n!u@a.b.edu" -> "*!u@*.b.edu")</p>
2846
<p><strong>Module:</strong> core</p>
2849
<dt><strong>timer <minutes> <tcl-command></strong></dt>
2852
<p><strong>Description:</strong> executes the given Tcl command
2853
after a certain number of minutes have passed</p>
2855
<p><strong>Returns:</strong> a timerID</p>
2857
<p><strong>Module:</strong> core</p>
2860
<dt><strong>utimer <seconds> <tcl-command></strong></dt>
2863
<p><strong>Description:</strong> executes the given Tcl command
2864
after a certain number of seconds have passed</p>
2866
<p><strong>Returns:</strong> a timerID</p>
2868
<p><strong>Module:</strong> core</p>
2871
<dt><strong>timers</strong></dt>
2874
<p><strong>Returns:</strong> a list of active minutely timers.
2875
Each entry in the list contains the number of minutes left till
2876
activation, the command that will be executed, and the timerID.</p>
2878
<p><strong>Module:</strong> core</p>
2881
<dt><strong>utimers</strong></dt>
2884
<p><strong>Returns:</strong> a list of active secondly timers.
2885
Each entry in the list contains the number of minutes left till
2886
activation, the command that will be executed, and the timerID.</p>
2888
<p><strong>Module:</strong> core</p>
2891
<dt><strong>killtimer <timerID></strong></dt>
2894
<p><strong>Description:</strong> removes a minutely timer from
2897
<p><strong>Returns:</strong> nothing</p>
2899
<p><strong>Module:</strong> core</p>
2902
<dt><strong>killutimer <timerID></strong></dt>
2905
<p><strong>Description:</strong> removes a secondly timer from
2908
<p><strong>Returns:</strong> nothing</p>
2910
<p><strong>Module:</strong> core</p>
2913
<dt><strong>unixtime</strong></dt>
2916
<p><strong>Returns:</strong> a long integer which represents the
2917
number of seconds that have passed since 00:00 Jan 1, 1970 (GMT).</p>
2919
<p><strong>Module:</strong> core</p>
2922
<dt><strong>duration <seconds></strong></dt>
2925
<p><strong>Returns:</strong> the number of seconds converted
2926
into years, weeks, days, hours, minutes, and seconds. 804600
2927
seconds is turned into 1 week 2 days 7 hours 30 minutes.</p>
2929
<p><strong>Module:</strong> core</p>
2932
<dt><strong>strftime <formatstring> [time]</strong></dt>
2935
<p><strong>Returns:</strong> a formatted string of time using
2936
standard strftime format. If time is specified, the value of the
2937
specified time is used. Otherwise, the current time is used.</p>
2939
<p><strong>Module:</strong> core</p>
2942
<dt><strong>ctime <unixtime></strong></dt>
2945
<p><strong>Returns:</strong> a formatted date/time string based
2946
on the current locale settings from the unixtime string given; for
2947
example "Fri Aug 3 11:34:55 1973"</p>
2949
<p><strong>Module:</strong> core</p>
2952
<dt><strong>myip</strong></dt>
2955
<p><strong>Returns:</strong> a long number representing the
2956
bot's IP address, as it might appear in (for example) a DCC
2959
<p><strong>Module:</strong> core</p>
2962
<dt><strong>rand <limit></strong></dt>
2965
<p><strong>Returns:</strong> a random integer between 0 and
2968
<p><strong>Module:</strong> core</p>
2971
<dt><strong>control <idx> <command></strong></dt>
2974
<p><strong>Description:</strong> removes an idx from the party line
2975
and sends all future input to the Tcl command given. The command
2976
will be called with two parameters: the idx and the input text.
2977
The command should return 0 to indicate success and 1 to indicate
2978
that it relinquishes control of the user back to the bot. If the
2979
input text is blank (""), it indicates that the
2980
connection has been dropped. Also, if the input text is blank,
2981
never call killdcc on it, as it will fail with "invalid
2984
<p><strong>Returns:</strong> nothing</p>
2986
<p><strong>Module:</strong> core</p>
2989
<dt><strong>sendnote <from> <to[@bot]>
2990
<message></strong></dt>
2993
<p><strong>Description:</strong> simulates what happens when one
2994
user sends a note to another</p>
2996
<p><strong>Returns:</strong></p>
3002
<p><strong>0</strong></p>
3006
<p>the send failed</p>
3012
<p><strong>1</strong></p>
3016
<p>the note was delivered locally or sent to another
3023
<p><strong>2</strong></p>
3027
<p>the note was stored locally</p>
3033
<p><strong>3</strong></p>
3037
<p>the user's notebox is too full to store a note</p>
3043
<p><strong>4</strong></p>
3047
<p>a Tcl binding caught the note</p>
3053
<p><strong>5</strong></p>
3057
<p>the note was stored because the user is away</p>
3063
<p><strong>Module:</strong> core</p>
3066
<dt><strong>link [via-bot] <bot></strong></dt>
3069
<p><strong>Description:</strong> attempts to link to another bot
3070
directly. If you specify a via-bot, it tells the via-bot to
3071
attempt the link.</p>
3073
<p><strong>Returns:</strong> 1 if the link will be attempted; 0
3076
<p><strong>Module:</strong> core</p>
3079
<dt><strong>unlink <bot></strong></dt>
3082
<p><strong>Description:</strong> attempts to unlink a bot from
3085
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
3087
<p><strong>Module:</strong> core</p>
3090
<dt><strong>encrypt <key> <string></strong></dt>
3093
<p><strong>Returns:</strong> encrypted string (using the currently
3094
loaded encryption module), encoded into ASCII using base-64</p>
3096
<p><strong>Module:</strong> encryption</p>
3099
<dt><strong>decrypt <key>
3100
<encrypted-base64-string></strong></dt>
3103
<p><strong>Returns:</strong> decrypted string (using the
3104
currently loaded encryption module)</p>
3106
<p><strong>Module:</strong> encryption</p>
3109
<dt><strong>encpass <password></strong></dt>
3112
<p><strong>Returns:</strong> encrypted string (using the currently
3113
loaded encryption module)</p>
3115
<p><strong>Module:</strong> encryption</p>
3118
<dt><strong>die [reason]</strong></dt>
3121
<p><strong>Description:</strong> causes the bot to log a fatal
3122
error and exit completely. If no reason is given,
3123
"EXIT" is used.</p>
3125
<p><strong>Returns:</strong> nothing</p>
3127
<p><strong>Module:</strong> core</p>
3130
<dt><strong>unames</strong></dt>
3133
<p><strong>Returns:</strong> the current operating system the
3136
<p><strong>Module:</strong> core</p>
3139
<dt><strong>dnslookup <ip-address/hostname> <proc>
3140
[[arg1] [arg2] ... [argN]]</strong></dt>
3143
<p><strong>Description:</strong> This issues an asynchronous dns
3144
lookup request. The command will block if dns module is not loaded;
3145
otherwise it will either return immediately or immediately call
3146
the specified proc (e.g. if the lookup is already cached).</p>
3148
<p>As soon as the request completes, the specified proc will be
3149
called as follows: <proc> <ipaddress> <hostname>
3150
<status> [[arg1] [arg2] ... [argN]]</p>
3152
<p>status is 1 if the lookup was successful and 0 if it
3153
wasn't. All additional parameters (called arg1, arg2 and argN
3154
above) get appended to the proc's other parameters.</p>
3156
<p><strong>Returns:</strong> nothing</p>
3158
<p><strong>Module:</strong> core</p>
3161
<dt><strong>md5 <string></strong></dt>
3164
<p><strong>Returns:</strong> the 128 bit MD5 message-digest of
3165
the specified string</p>
3167
<p><strong>Module:</strong> core</p>
3170
<dt><strong>callevent <event></strong></dt>
3173
<p><strong>Description:</strong> triggers the evnt bind manually
3174
for a certain event. For example: callevent rehash.</p>
3176
<p><strong>Returns:</strong> nothing</p>
3178
<p><strong>Module:</strong> core</p>
3181
<dt><strong>traffic</strong></dt>
3184
<p><strong>Returns:</strong> a list of sublists containing
3185
information about the bot's traffic usage in bytes. Each
3186
sublist contains five elements: type, in-traffic today,
3187
in-traffic total, out-traffic today, out-traffic total (in that
3190
<p><strong>Module:</strong> core</p>
3193
<dt><strong>modules</strong></dt>
3196
<p><strong>Returns:</strong> a list of sublists containing
3197
information about the bot's currently loaded modules. Each
3198
sublist contains three elements: module, version, and
3199
dependencies. Each dependency is also a sublist containing the
3200
module name and version.</p>
3202
<p><strong>Module:</strong> core</p>
3205
<dt><strong>loadmodule <module></strong></dt>
3208
<p><strong>Description:</strong> attempts to load the specified
3211
<p><strong>Returns:</strong> "Already loaded." if the
3212
module is already loaded, "" if successful, or the
3213
reason the module couldn't be loaded.</p>
3215
<p><strong>Module:</strong> core</p>
3218
<dt><strong>unloadmodule <module></strong></dt>
3221
<p><strong>Description:</strong> attempts to unload the specified
3224
<p><strong>Returns:</strong> "No such module" if the
3225
module is not loaded, "" otherwise.</p>
3227
<p><strong>Module:</strong> core</p>
3230
<dt><strong>loadhelp <helpfile-name></strong></dt>
3233
<p><strong>Description:</strong> attempts to load the specified
3234
help file from the help/ directory.</p>
3236
<p><strong>Returns:</strong> nothing</p>
3238
<p><strong>Module:</strong> core</p>
3241
<dt><strong>unloadhelp <helpfile-name></strong></dt>
3244
<p><strong>Description:</strong> attempts to unload the specified
3247
<p><strong>Returns:</strong> nothing</p>
3249
<p><strong>Module:</strong> core</p>
3252
<dt><strong>reloadhelp</strong></dt>
3255
<p><strong>Description:</strong> reloads the bot's help
3258
<p><strong>Returns:</strong> nothing</p>
3260
<p><strong>Module:</strong> core</p>
3263
<dt><strong>restart</strong></dt>
3266
<p><strong>Description:</strong> rehashes the bot, kills all
3267
timers, reloads all modules, and reconnects the bot to the next
3268
server in its list.</p>
3270
<p><strong>Returns:</strong> nothing</p>
3272
<p><strong>Module:</strong> core</p>
3275
<dt><strong>rehash</strong></dt>
3278
<p><strong>Description:</strong> rehashes the bot</p>
3280
<p><strong>Returns:</strong> nothing</p>
3282
<p><strong>Module:</strong> core</p>
3287
<p><a name="globvars"></a>10. <strong>Global variables</strong></p>
3290
<p><strong>NOTE:</strong> All config file variables are also global.</p>
3293
<dt><strong>botnick</strong></dt>
3296
<p><strong>Value:</strong> the current nickname the bot is using
3297
(for example: "Valis", "Valis0", etc.)</p>
3299
<p><strong>Module:</strong> server</p>
3302
<dt><strong>botname</strong></dt>
3305
<p><strong>Value:</strong> the current nick!user@host that the
3306
server sees (for example: "Valis!valis@crappy.com")</p>
3308
<p><strong>Module:</strong> server</p>
3311
<dt><strong>server</strong></dt>
3314
<p><strong>Value:</strong> the current server's real name (what
3315
server calls itself) and port bot is connected to (for example:
3316
"irc.math.ufl.edu:6667") Note that this does not nececerilly match
3317
the servers internet address.</p>
3319
<p><strong>Module:</strong> server</p>
3322
<dt><strong>serveraddress</strong></dt>
3325
<p><strong>Value:</strong> the current server's internet address
3326
(hostname or IP) and port bot is connected to. This will correspond
3327
to the entry in server list (for example: "eu.undernet.org:6667").
3328
Note that this does not necessarily match the name server calls
3331
<p><strong>Module:</strong> server</p>
3334
<dt><strong>version</strong></dt>
3337
<p><strong>Value:</strong> current bot version "1.1.2+pl1
3338
1010201 pl1"; first item is the text version, second item
3339
is a numerical version, and any following items are the names of
3340
patches that have been added</p>
3342
<p><strong>Module:</strong> core</p>
3345
<dt><strong>numversion</strong></dt>
3348
<p><strong>Value:</strong> the current numeric bot version (for
3349
example: "1010201"). Numerical version is in the format
3350
of "MNNRRPP", where:</p>
3356
<p><strong>M</strong></p>
3360
<p>major release number</p>
3366
<p><strong>NN</strong></p>
3370
<p>minor release number</p>
3376
<p><strong>RR</strong></p>
3380
<p>sub-release number</p>
3386
<p><strong>PP</strong></p>
3390
<p>patch level for that sub-release</p>
3396
<p><strong>Module:</strong> core</p>
3399
<dt><strong>uptime</strong></dt>
3402
<p><strong>Value:</strong> the unixtime value for when the bot
3405
<p><strong>Module:</strong> core</p>
3408
<dt><strong>server-online</strong></dt>
3411
<p><strong>Value:</strong> the unixtime value for when the bot
3412
connected to its current server</p>
3414
<p><strong>Module:</strong> server</p>
3417
<dt><strong>lastbind</strong></dt>
3420
<p><strong>Value:</strong> the last command binding which was
3421
triggered. This allows you to identify which command triggered
3424
<p><strong>Module:</strong> core</p>
3427
<dt><strong>isjuped</strong></dt>
3430
<p><strong>Value:</strong> 1 if bot's nick is juped(437);
3433
<p><strong>Module:</strong> server</p>
3436
<dt><strong>handlen</strong></dt>
3439
<p><strong>Value:</strong> the value of the HANDLEN define in
3442
<p><strong>Module:</strong> core</p>
3445
<dt><strong>config</strong></dt>
3448
<p><strong>Value:</strong> the filename of the config file Eggdrop
3449
is currently using</p>
3451
<p><strong>Module:</strong> core</p>
3456
<p><a name="bind"></a>11. <strong>Bind</strong></p>
3459
<p>You can use the 'bind' command to attach Tcl procedures
3460
to certain events. For example, you can write a Tcl procedure that
3461
gets called every time a user says "danger" on the
3464
<p>Some bind types are marked as "stackable". That means
3465
that you can bind multiple commands to the same trigger. Normally, for
3466
example, a bind such as 'bind msg - stop msg:stop' (which
3467
makes a msg-command "stop" call the Tcl proc
3468
"msg:stop") will overwrite any previous binding you had for
3469
then msg command "stop". With stackable bindings, like
3470
'msgm' for example, you can bind the same command to multiple
3471
procs. When the bind is triggered, ALL of the Tcl procs that are
3472
bound to it will be called.</p>
3474
<p>To remove a bind, use the 'unbind' command. For example,
3475
to remove the bind for the "stop" msg command, use
3476
'unbind msg - stop msg:stop'.</p>
3480
<p><a name="binda"></a><strong>Bind types</strong></p>
3484
<p><strong>MSG</strong></p>
3486
<p><strong>bind msg <flags> <command>
3488
procname <nick> <user@host> <handle>
3489
<text></strong></p>
3491
<p><strong>Description:</strong> used for /msg commands. The
3492
first word of the user's msg is the command, and
3493
everything else becomes the text argument.</p>
3495
<p><strong>Module:</strong> server</p>
3499
<p><strong>DCC</strong></p>
3501
<p><strong>bind dcc <flags> <command>
3503
procname <handle> <idx> <text></strong></p>
3505
<p><strong>Description:</strong> used for partyline commands;
3506
the command is the first word and everything else becomes
3507
the text argument. The idx is valid until the user disconnects.
3508
After that, it may be reused, so be careful about storing an
3509
idx for long periods of time.</p>
3511
<p><strong>Module:</strong> core</p>
3515
<p><strong>FIL</strong></p>
3517
<p><strong>bind fil <flags> <command>
3519
procname <handle> <idx> <text></strong></p>
3521
<p><strong>Description:</strong> the same as DCC, except this
3522
is triggered if the user is in the file area instead of the
3525
<p><strong>Module:</strong> filesys</p>
3529
<p><strong>PUB</strong></p>
3531
<p><strong>bind pub <flags> <command>
3533
procname <nick> <user@host> <handle>
3534
<channel> <text></strong></p>
3536
<p><strong>Description:</strong> used for commands given on
3537
a channel. The first word becomes the command and everything
3538
else is the text argument.</p>
3540
<p><strong>Module:</strong> irc</p>
3544
<p><strong>MSGM (stackable)</strong></p>
3546
<p><strong>bind msgm <flags> <mask>
3548
procname <nick> <user@host> <handle>
3549
<text></strong></p>
3551
<p><strong>Description:</strong> matches the entire line of
3552
text from a /msg with the mask. This is useful for binding
3553
Tcl procs to words or phrases spoken anywhere within a line
3556
<p><strong>Module:</strong> server</p>
3560
<p><strong>PUBM (stackable)</strong></p>
3562
<p><strong>bind pubm <flags> <mask>
3564
procname <nick> <user@host> <handle>
3565
<channel> <text></strong></p>
3567
<p><strong>Description:</strong> just like MSGM, except
3568
it's triggered by things said on a channel instead of
3569
things /msg'd to the bot. The mask is matched against
3570
the channel name followed by the text and can contain
3571
wildcards. Also, if a line triggers a PUB bind, it will not
3572
trigger a PUBM bind.</p>
3574
<p><strong>Module:</strong> irc</p>
3578
<p><strong>NOTC (stackable)</strong></p>
3580
<p><strong>bind notc <flags> <mask> <proc><br>
3581
procname <nick> <user@host> <handle>
3582
<text> <dest></strong></p>
3584
<p><strong>Description:</strong> dest will be a nickname (the
3585
bot's nickname, obviously) or a channel name. mask is
3586
matched against the entire notice and can contain wildcards.
3587
It is considered a breach of protocol to respond to a /notice
3588
on IRC, so this is intended for internal use (logging, etc.)
3589
only.Note that server notices do not trigger the NOTC bind.</p>
3591
<p>New Tcl procs should be declared as</p>
3594
proc notcproc {nick uhost hand text {dest ""}} {
3595
global botnick; if {$dest == ""} {set dest $botnick}
3600
<p>for compatibility.</p>
3602
<p><strong>Module:</strong> server</p>
3606
<p><strong>JOIN (stackable)</strong></p>
3608
<p><strong>bind join <flags> <mask> <proc><br>
3609
procname <nick> <user@host> <handle>
3610
<channel></strong></p>
3612
<p><strong>Description:</strong> triggered by someone joining
3613
the channel. The mask in the bind is matched against
3614
"#channel nick!user@host" and can contain
3617
<p><strong>Module:</strong> irc</p>
3621
<p><strong>PART (stackable)</strong></p>
3623
<p><strong>bind part <flags> <mask> <proc><br>
3624
procname <nick> <user@host> <handle>
3625
<channel> <msg></strong></p>
3627
<p><strong>Description:</strong> triggered by someone leaving
3628
the channel. The mask is matched against "#channel
3629
nick!user@host" and can contain wildcards. If no part
3630
message is specified, msg will be set to "".</p>
3632
<p>New Tcl procs should be declared as</p>
3635
proc partproc {nick uhost hand chan {msg ""}} { ... }
3638
<p>for compatibility.</p>
3640
<p><strong>Module:</strong> irc</p>
3644
<p><strong>SIGN (stackable)</strong></p>
3646
<p><strong>bind sign <flags> <mask> <proc><br>
3647
procname <nick> <user@host> <handle>
3648
<channel> <reason></strong></p>
3650
<p><strong>Description:</strong> triggered by a signoff, or
3651
possibly by someone who got netsplit and never returned. The
3652
signoff message is the last argument to the proc. Wildcards
3653
can be used in the mask, which is matched against '#channel
3654
nick!user@host'.</p>
3656
<p><strong>Module:</strong> irc</p>
3660
<p><strong>TOPC (stackable)</strong></p>
3662
<p><strong>bind topc <flags> <mask> <proc><br>
3663
procname <nick> <user@host> <handle>
3664
<channel> <topic></strong></p>
3666
<p><strong>Description:</strong> triggered by a topic change.
3667
mask can contain wildcards and is matched against '#channel
3668
<new topic>'.</p>
3670
<p><strong>Module:</strong> irc</p>
3674
<p><strong>KICK (stackable)</strong></p>
3676
<p><strong>bind kick <flags> <mask> <proc><br>
3677
procname <nick> <user@host> <handle>
3678
<channel> <target> <reason></strong></p>
3680
<p><strong>Description:</strong> triggered when someone is
3681
kicked off the channel. The mask is matched against
3682
'#channel target reason' where the target is the nickname of
3683
the person who got kicked (can contain wildcards). The proc
3684
is called with the nick, user@host, and handle of the kicker,
3685
plus the channel, the nickname of the person who was kicked,
3686
and the reason; flags are ignored.</p>
3688
<p><strong>Module:</strong> irc</p>
3692
<p><strong>NICK (stackable)</strong></p>
3694
<p><strong>bind nick <flags> <mask> <proc><br>
3695
procname <nick> <user@host> <handle>
3696
<channel> <newnick></strong></p>
3698
<p><strong>Description:</strong> triggered when someone changes
3699
nicknames. The mask is matched against '#channel newnick'
3700
and can contain wildcards. Channel is "*" if the user isn't
3701
on a channel (usually the bot not yet in a channel).</p>
3703
<p><strong>Module:</strong> irc</p>
3707
<p><strong>MODE (stackable)</strong></p>
3709
<p><strong>bind mode <flags> <mask> <proc><br>
3710
proc-name <nick> <user@host> <handle>
3711
<channel> <mode-change> <victim></strong></p>
3713
<p><strong>Description:</strong> mode changes are broken down
3714
into their component parts before being sent here, so the
3715
<mode-change> will always be a single mode, such as
3716
"+m" or "-o". victim will show the argument
3717
of the mode change (for o/v/b/e/I) or "" if the set
3718
mode does not take an argument. Flags are ignored. The
3719
bot's automatic response to a mode change will happen
3720
AFTER all matching Tcl procs are called. The mask will be
3721
matched against '#channel +/-modes' and can
3722
contain wildcards.</p>
3724
<p>If it is a server mode, nick will be "", user@host
3725
is the server name, and handle is *.</p>
3727
<p>Note that "victim" was added in 1.3.23 and that
3728
this will break Tcl scripts that were written for pre-1.3.23
3729
versions and use this binding. An easy fix (by guppy) is as
3730
follows (example):</p>
3732
<p>Old script looks as follows:</p>
3735
bind mode - * mode_proc
3736
proc mode_proc {nick uhost hand chan mc} { ... }
3739
<p>To make it work with 1.3.23+ and stay compatible with older
3743
bind mode - * mode_proc_fix
3744
proc mode_proc_fix {nick uhost hand chan mc {victim ""}} {
3745
if {$victim != ""} {append mc " $victim"}
3746
mode_proc $nick $uhost $hand $chan $mc
3748
proc mode_proc {nick uhost hand chan mc} { ... }
3751
<p><strong>Module:</strong> irc</p>
3755
<p><strong>CTCP (stackable)</strong></p>
3757
<p><strong>bind ctcp <flags> <keyword>
3759
proc-name <nick> <user@host> <handle>
3760
<dest> <keyword> <text></strong></p>
3762
<p><strong>Description:</strong> dest will be a nickname (the
3763
bot's nickname, obviously) or channel name. keyword is
3764
the ctcp command (which can contain wildcards), and text may
3765
be empty. If the proc returns 0, the bot will attempt its
3766
own processing of the ctcp command.</p>
3768
<p><strong>Module:</strong> server</p>
3772
<p><strong>CTCR (stackable)</strong></p>
3774
<p><strong>bind ctcr <flags> <keyword>
3776
proc-name <nick> <user@host> <handle>
3777
<dest> <keyword> <text></strong></p>
3779
<p><strong>Description:</strong> just like ctcp, but this is
3780
triggered for a ctcp-reply (ctcp embedded in a notice instead
3783
<p><strong>Module:</strong> server</p>
3787
<p><strong>RAW (stackable)</strong></p>
3789
<p><strong>bind raw <flags> <keyword-mask>
3791
procname <from> <keyword> <text></strong></p>
3793
<p><strong>Description:</strong> previous versions of Eggdrop
3794
required a special compile option to enable this binding, but
3795
it's now standard. The keyword is either a numeric, like
3796
"368", or a keyword, such as "PRIVMSG". from
3797
will be the server name or the source user (depending on the
3798
keyword); flags are ignored. The order of the arguments is
3799
identical to the order that the IRC server sends to the bot. The
3800
pre-processing only splits it apart enough to determine the
3801
keyword. If the proc returns 1, Eggdrop will not process the line
3802
any further (this could cause unexpected behavior in some
3805
<p><strong>Module:</strong> server</p>
3809
<p><strong>BOT</strong></p>
3811
<p><strong>bind bot <flags> <command>
3813
proc-name <from-bot> <command>
3814
<text></strong></p>
3816
<p><strong>Description:</strong> triggered by a message coming
3817
from another bot in the botnet. The first word is the command
3818
and the rest becomes the text argument; flags are ignored.</p>
3820
<p><strong>Module:</strong> core</p>
3823
<p><strong>CHON (stackable)</strong></p>
3825
<p><strong>bind chon <flags> <mask> <proc><br>
3826
proc-name <handle> <idx></strong></p>
3828
<p><strong>Description:</strong> when someone first enters the
3829
party-line area of the bot via dcc chat or telnet, this is
3830
triggered before they are connected to a chat channel (so,
3831
yes, you can change the channel in a 'chon' proc).
3832
mask is matched against the handle and supports wildcards.
3833
This is NOT triggered when someone returns from the file area,
3836
<p><strong>Module:</strong> core</p>
3840
<p><strong>CHOF (stackable)</strong></p>
3842
<p><strong>bind chof <flags> <mask> <proc><br>
3843
proc-name <handle> <idx></strong></p>
3845
<p><strong>Description:</strong> triggered when someone leaves
3846
the party line to disconnect from the bot. mask is matched
3847
against the handle and can contain wildcards. Note that the
3848
connection may have already been dropped by the user, so
3849
don't send output to the idx.</p>
3851
<p><strong>Module:</strong> core</p>
3855
<p><strong>SENT (stackable)</strong></p>
3857
<p><strong>bind sent <flags> <mask> <proc><br>
3858
proc-name <handle> <nick>
3859
<path/to/file></strong></p>
3861
<p><strong>Description:</strong> after a user has successfully
3862
downloaded a file from the bot, this binding is triggered. mask
3863
is matched against the handle of the user that initiated the
3864
transfer and supports wildcards. nick is the actual recipient
3865
(on IRC) of the file. The path is relative to the dcc
3866
directory (unless the file transfer was started by a script
3867
call to 'dccsend', in which case the path is the
3868
exact path given in the call to 'dccsend').</p>
3870
<p><strong>Module:</strong> transfer</p>
3874
<p><strong>RCVD (stackable)</strong></p>
3876
<p><strong>bind rcvd <flags> <mask> <proc><br>
3877
proc-name <handle> <nick>
3878
<path/to/file></strong></p>
3880
<p><strong>Description:</strong> triggered after a user
3881
uploads a file successfully. mask is matched against the
3882
user's handle. nick is the IRC nickname that the file
3883
transfer originated from. The path is where the file ended
3884
up, relative to the dcc directory (usually this is your
3887
<p><strong>Module:</strong> transfer</p>
3891
<p><strong>CHAT (stackable)</strong></p>
3893
<p><strong>bind chat <flags> <mask> <proc><br>
3894
proc-name <handle> <channel#>
3895
<text></strong></p>
3897
<p><strong>Description:</strong> when someone says something on
3898
the botnet, it invokes this binding. Flags are ignored; handle
3899
could be a user on this bot ("DronePup") or on
3900
another bot ("Eden@Wilde") and therefore you can't
3901
rely on a local user record. The mask is checked against the
3902
entire line of text and supports wildcards.</p>
3904
<p><strong>Module:</strong> core</p>
3908
<p><strong>LINK (stackable)</strong></p>
3910
<p><strong>bind link <flags> <mask> <proc><br>
3911
proc-name <botname> <via></strong></p>
3913
<p><strong>Description:</strong> triggered when a bot links
3914
into the botnet. botname is the botnetnick of the bot that
3915
just linked in; via is the bot it linked through. The mask
3916
is checked against the botnetnick of the bot that linked and
3917
supports wildcards. flags are ignored.</p>
3919
<p><strong>Module:</strong> core</p>
3923
<p><strong>DISC (stackable)</strong></p>
3925
<p><strong>bind disc <flags> <mask> <proc><br>
3926
proc-name <botname></strong></p>
3928
<p><strong>Description:</strong> triggered when a bot
3929
disconnects from the botnet for whatever reason. Just like
3930
the link bind, flags are ignored; mask is matched against
3931
the botnetnick of the bot that unlinked. Wildcards are
3932
supported in mask.</p>
3934
<p><strong>Module:</strong> core</p>
3938
<p><strong>SPLT (stackable)</strong></p>
3940
<p><strong>bind splt <flags> <mask> <proc><br>
3941
procname <nick> <user@host> <handle>
3942
<channel></strong></p>
3944
<p><strong>Description:</strong> triggered when someone gets
3945
netsplit on the channel. Be aware that this may be a false
3946
alarm (it's easy to fake a netsplit signoff message on
3947
some networks); mask may contain wildcards and is matched
3948
against '#channel nick!user@host'. Anyone who is SPLT
3949
will trigger a REJN or SIGN within the next wait-split
3950
(defined in the config file) minutes.</p>
3952
<p><strong>Module:</strong> irc</p>
3956
<p><strong>REJN (stackable)</strong></p>
3958
<p><strong>bind rejn <flags> <mask> <proc><br>
3959
procname <nick> <user@host> <handle>
3960
<channel></strong></p>
3962
<p><strong>Description:</strong> someone who was split has
3963
rejoined. mask can contain wildcards, and is matched against
3964
'#channel nick!user@host'.</p>
3966
<p><strong>Module:</strong> irc</p>
3970
<p><strong>FILT (stackable)</strong></p>
3972
<p><strong>bind filt <flags> <mask> <proc><br>
3973
procname <idx> <text></strong></p>
3975
<p><strong>Description:</strong> party line and file system
3976
users have their text sent through filt before being
3977
processed. If the proc returns a blank string, the text is
3978
considered parsed. Otherwise, the bot will use the text
3979
returned from the proc and continue parsing that.</p>
3981
<p><strong>Module:</strong> core</p>
3985
<p><strong>NEED (stackable)</strong></p>
3987
<p><strong>bind need <flags> <mask> <proc><br>
3988
procname <channel> <type></strong></p>
3990
<p><strong>Description:</strong> this bind is triggered on
3991
certain events, like when the bot needs operator status or
3992
the key for a channel. The types are: op, unban, invite,
3993
limit, and key; the mask is matched against '#channel
3994
type' and can contain wildcards. flags are ignored.</p>
3998
<p>bind need - "% op" needop < handles only need
4000
bind need - "*" needall < handles all needs</p>
4002
<p><strong>Module:</strong> irc</p>
4006
<p><strong>FLUD (stackable)</strong></p>
4008
<p><strong>bind flud <flags> <type> <proc><br>
4009
procname <nick> <user@host> <handle>
4010
<type> <channel></strong></p>
4012
<p><strong>Description:</strong> any floods detected through
4013
the flood control settings (like 'flood-ctcp') are
4014
sent here before processing. If the proc returns 1, no
4015
further action is taken on the flood; if the proc returns 0,
4016
the bot will do its normal "punishment" for the
4017
flood. The flood types are: pub, msg, join, or ctcp (and can
4018
be masked to "*" for the bind); flags are ignored.</p>
4020
<p><strong>Module:</strong> server</p>
4024
<p><strong>NOTE</strong></p>
4026
<p><strong>bind note <flags> <handle> <proc><br>
4027
procname <from> <to> <text></strong></p>
4029
<p><strong>Description:</strong> incoming notes (either from
4030
the party line, someone on IRC, or someone on another bot on
4031
the botnet) are checked against these binds before being
4032
processed. If a bind exists, the bot will not deliver the
4033
note. The handle must be an exact match (no wildcards), but
4034
it is not case sensitive; flags are ignored.</p>
4036
<p><strong>Module:</strong> core</p>
4040
<p><strong>ACT (stackable)</strong></p>
4042
<p><strong>bind act <flags> <mask> <proc><br>
4043
proc-name <handle> <channel#>
4044
<action></strong></p>
4046
<p><strong>Description:</strong> when someone does an action
4047
on the botnet, it invokes this binding. flags are ignored;
4048
the mask is matched against the text of the action and can
4049
support wildcards.</p>
4051
<p><strong>Module:</strong> core</p>
4055
<p><strong>WALL (stackable)</strong></p>
4057
<p><strong>bind wall <flags> <mask> <proc><br>
4058
proc-name <handle> <msg></strong></p>
4060
<p><strong>Description:</strong> when the bot receives a
4061
wallops, it invokes this binding. flags are ignored; the
4062
mask is matched against the text of the wallops msg.</p>
4064
<p><strong>Module:</strong> server</p>
4068
<p><strong>BCST (stackable)</strong></p>
4070
<p><strong>bind bcst <flags> <mask> <proc><br>
4071
proc-name <botname> <channel#>
4072
<text></strong></p>
4074
<p><strong>Description:</strong> when a bot broadcasts
4075
something on the botnet (see 'dccbroadcast' above),
4076
it invokes this binding. flags are ignored; the mask is
4077
matched against the message text and can contain wildcards.</p>
4079
<p><strong>Module:</strong> core</p>
4083
<p><strong>CHJN (stackable)</strong></p>
4085
<p><strong>bind chjn <flags> <mask> <proc><br>
4086
proc-name <botname> <handle> <channel#>
4087
<flag> <idx> <user@host></strong></p>
4089
<p><strong>Description:</strong> when someone joins a botnet
4090
channel, it invokes this binding. The mask is matched against
4091
the channel and can contain wildcards. flag is one of: *
4092
(owner), + (master), @ (op), or % (botnet master).</p>
4094
<p><strong>Module:</strong> core</p>
4098
<p><strong>CHPT (stackable)</strong></p>
4100
<p><strong>bind chpt <flags> <mask> <proc><br>
4101
proc-name <botname> <handle> <idx>
4102
<channel#></strong></p>
4104
<p><strong>Description:</strong> when someone parts a botnet
4105
channel, it invokes this binding. flags are ignored; the mask
4106
is matched against the channel and can contain wildcards.</p>
4108
<p><strong>Module:</strong> core</p>
4112
<p><strong>TIME (stackable)</strong></p>
4114
<p><strong>bind time <flags> <mask> <proc><br>
4115
proc-name <minute> <hour> <day> <month>
4116
<year></strong></p>
4118
<p><strong>Description:</strong> allows you to schedule
4119
procedure calls at certain times. mask matches 5 space
4120
separated integers of the form: "minute hour day month
4121
year". minute, hour, day, month have a zero padding so
4122
they are exactly two characters long; year is extended to
4123
four characters in the same way. flags are ignored.</p>
4125
<p><strong>Module:</strong> core</p>
4129
<p><strong>AWAY (stackable)</strong></p>
4131
<p><strong>bind away <flags> <mask> <proc><br>
4132
proc-name <botname> <idx> <text></strong></p>
4134
<p><strong>Description:</strong> triggers when a user goes
4135
away or comes back on the botnet. text is the reason than has
4136
been specified (text is "" when returning). mask is
4137
matched against the botnet-nick of the bot the user is
4138
connected to and supports wildcards. flags are ignored.</p>
4140
<p><strong>Module:</strong> core</p>
4144
<p><strong>LOAD (stackable)</strong></p>
4146
<p><strong>bind load <flags> <mask> <proc><br>
4147
proc-name <module></strong></p>
4149
<p><strong>Description:</strong> triggers when a module is
4150
loaded. mask is matched against the name of the loaded module
4151
and supports wildcards; flags are ignored.</p>
4153
<p><strong>Module:</strong> core</p>
4157
<p><strong>UNLD (stackable)</strong></p>
4159
<p><strong>bind unld <flags> <mask> <proc><br>
4160
proc-name <module></strong></p>
4162
<p><strong>Description:</strong> triggers when a module is
4163
unloaded. mask is matched against the name of the unloaded
4164
module and supports wildcards; flags are ignored.</p>
4166
<p><strong>Module:</strong> core</p>
4170
<p><strong>NKCH (stackable)</strong></p>
4172
<p><strong>bind nkch <flags> <mask> <proc><br>
4173
proc-name <oldhandle> <newhandle></strong></p>
4175
<p><strong>Description:</strong> triggered whenever a local
4176
user's handle is changed (in the userfile). mask is
4177
matched against the user's old handle and can contain
4178
wildcards; flags are ignored.</p>
4180
<p><strong>Module:</strong> core</p>
4184
<p><strong>EVNT (stackable)</strong></p>
4186
<p><strong>bind evnt <flags> <type> <proc><br>
4187
proc-name <type></strong></p>
4189
<p><strong>Description:</strong> Description: triggered whenever
4190
one of these events happen; flags are ignored; valid events
4197
<p><strong>sighup</strong></p>
4201
<p>called on a kill -HUP <pid></p>
4207
<p><strong>sigterm</strong></p>
4211
<p>called on a kill -TERM <pid></p>
4217
<p><strong>sigill</strong></p>
4221
<p>called on a kill -ILL <pid></p>
4227
<p><strong>sigquit</strong></p>
4231
<p>called on a kill -QUIT <pid></p>
4237
<p><strong>save</strong></p>
4241
<p>called when the userfile is saved</p>
4247
<p><strong>rehash</strong></p>
4251
<p>called just after a rehash</p>
4257
<p><strong>prerehash</strong></p>
4261
<p>called just before a rehash</p>
4267
<p><strong>prerestart</strong></p>
4271
<p>called just before a restart</p>
4277
<p><strong>logfile</strong></p>
4281
<p>called when the logs are switched daily</p>
4287
<p><strong>loaded</strong></p>
4291
<p>called when the bot is done loading</p>
4297
<p><strong>* userfile-loaded</strong></p>
4301
<p>called after userfile has been loaded</p>
4311
<p><strong>connect-server</strong></p>
4315
<p>called just before we connect to an IRC server</p>
4321
<p><strong>init-server</strong></p>
4325
<p>called when we actually get on our IRC server</p>
4331
<p><strong>disconnect-server</strong></p>
4335
<p>called when we disconnect from our IRC server</p>
4341
<p><strong>Module:</strong> core</p>
4345
<p><strong>LOST (stackable)</strong></p>
4347
<p><strong>bind lost <flags> <mask> <proc><br>
4348
proc-name <handle> <nick> <path>
4349
<bytes-transferred> <length-of-file></strong></p>
4351
<p><strong>Description:</strong> triggered when a DCC SEND
4352
transfer gets lost, such as when the connection is
4353
terminated before all data was successfully sent/received.
4354
This is typically caused by a user abort.</p>
4356
<p><strong>Module:</strong> transfer</p>
4360
<p><strong>TOUT (stackable)</strong></p>
4362
<p><strong>bind tout <flags> <mask> <proc><br>
4363
proc-name <handle> <nick> <path>
4364
<bytes-transferred> <length-of-file></strong></p>
4366
<p><strong>Description:</strong> triggered when a DCC SEND
4367
transfer times out. This may either happen because the dcc
4368
connection was not accepted or because the data transfer
4369
stalled for some reason.</p>
4371
<p><strong>Module:</strong> transfer</p>
4377
<p><a name="bindb"></a><strong>Return Values</strong></p>
4379
<p>Several bindings pay attention to the value you return from
4380
the proc (using 'return <value>'). Usually, they
4381
expect a 0 or 1, and returning an empty return is interpreted
4382
as a 0. Be aware if you omit the return statement, the result
4383
of the last Tcl command executed will be returned by the proc.
4384
This will not likely produce the results you intended (this is
4385
a "feature" of Tcl).</p>
4387
<p>Here's a list of the bindings that use the return value
4388
from procs they trigger:</p>
4392
<p><strong>MSG</strong>
4394
<p>Return 1 to make the command get logged like so:</p>
4397
<p>(nick!user@host) !handle! command</p>
4402
<p><strong>DCC</strong>
4404
<p>Return 1 to make the command get logged like so:</p>
4407
<p>#handle# command</p>
4412
<p><strong>FIL</strong>
4414
<p>Return 1 to make the command get logged like so:</p>
4417
<p>#handle# files: command</p>
4422
<p><strong>PUB</strong>
4424
<p>Return 1 to make the command get logged like so:</p>
4427
<p><<nick>> !handle! command</p>
4432
<p><strong>CTCP</strong>
4434
<p>Return 1 to ask the bot not to process the CTCP command on
4435
its own. Otherwise, it would send its own response to the CTCP
4436
(possibly an error message if it doesn't know how to deal
4441
<p><strong>FILT</strong>
4443
<p>Return "" to indicate the text has been processed, and the
4444
bot should just ignore it. Otherwise, it will treat the text
4449
<p><strong>FLUD</strong>
4451
<p>Return 1 to ask the bot not to take action on the flood.
4452
Otherwise it will do its normal punishment.</p>
4456
<p><strong>RAW</strong>
4458
<p>Return 1 to ask the bot not to process the server text.
4459
This can affect the bot's performance by causing it to
4460
miss things that it would normally act on -- you have been
4465
<p><strong>CHON</strong>
4467
<p>Return 1 to ask the bot not to process the partyline join
4472
<p><strong>CHOF</strong>
4474
<p>Return 1 to ask the bot not to process the partyline part
4479
<p><strong>WALL</strong>
4481
<p>Return 1 to make the command get logged like so:</p>
4492
<p><a name="control"></a>12. <strong>Control procedures</strong></p>
4495
<p>Using the 'control' command, you can put a DCC connection
4496
(or outgoing TCP connection) in control of a script. All text received
4497
from the connection is sent to the proc you specify. All outgoing text
4498
should be sent with 'putdcc'.</p>
4500
<p>The control procedure is called with these parameters:</p>
4503
<p>procname <idx> <input-text></p>
4506
<p>This allows you to use the same proc for several connections. The
4507
idx will stay the same until the connection is dropped. After that,
4508
it will probably get reused for a later connection.</p>
4510
<p>To indicate that the connection has closed, your control procedure
4511
will be called with blank text (the input-text will be "").
4512
This is the only time it will ever be called with "" as the
4513
text, and it is the last time your proc will be called for that
4514
connection. Don't call killdcc on the idx when text is blank, it
4515
will always fail with "invalid idx".</p>
4517
<p>If you want to hand control of your connection back to Eggdrop,
4518
your proc should return 1. Otherwise, return 0 to retain
4522
<p><a name="tcp"></a>13. <strong>TCP connections</strong></p>
4525
<p>Eggdrop allows you to make two types of TCP ("telnet")
4526
connections: outgoing and incoming. For an outgoing connection, you
4527
specify the remote host and port to connect to. For an incoming
4528
connection, you specify a port to listen on.</p>
4530
<p>All of the connections are *event driven*. This means that the bot
4531
will trigger your procs when something happens on the connection, and
4532
your proc is expected to return as soon as possible. Waiting in a proc
4533
for more input is a no-no.</p>
4535
<p>To initiate an outgoing connection, use:</p>
4538
<p>set idx [connect <hostname> <port>]</p>
4541
<p>$idx now contains a new DCC entry for the outgoing connection.</p>
4543
<p>All connections use non-blocking (commonly called
4544
"asynchronous", which is a misnomer) I/O. Without going
4545
into a big song and dance about asynchronous I/O, what this means
4550
<p>assume the connection succeeded immediately</p>
4554
<p>if the connection failed, an EOF will arrive for that idx</p>
4558
<p>The only time a 'connect' will return an error is if you
4559
give it a hostname that can't be resolved (this is considered a
4560
"DNS error"). Otherwise, it will appear to have succeeded.
4561
If the connection failed, you will immediately get an EOF.</p>
4563
<p>Right after doing a 'connect' call, you should set up a
4564
'control' for the new idx (see the section above). From then
4565
on, the connection will act just like a normal DCC connection that
4566
has been put under the control of a script. If you ever return
4567
"1" from the control proc (indicating that you want control
4568
to return to Eggdrop), the bot will just close the connection and
4569
dispose of it. Other commands that work on normal DCC connections,
4570
like 'killdcc' and 'putdcc', will work on this idx,
4571
too. The 'killdcc' command will fail with "invalid
4572
idx" if you attempt to use it on a closed socket.</p>
4574
<p>To create a listen port, use:</p>
4577
<p>listen <port> script <proc></p>
4580
<p>Procs should be declared as:</p>
4583
<p>procname <newidx></p>
4589
listen 6687 script listen:grab
4591
proc listen:grab {newidx} {
4592
control $newidx listen:control
4596
<p>When a new connection arrives in port 6687, Eggdrop will create a
4597
new idx for the connection. That idx is sent to 'listen:grab'.
4598
The proc immediately puts this idx under control. Once
4599
'listen:grab' has been called, the idx behaves exactly like
4600
an outgoing connection would.</p>
4602
<p>The best way to learn how to use these commands is to find a
4603
script that uses them and follow it carefully. However, hopefully
4604
this has given you a good start.</p>
4607
<p><a name="matchchars"></a>14. <strong>Match characters</strong></p>
4610
<p>Many of the bindings allow match characters in the arguments. Here
4611
are the four special characters:</p>
4616
<p><strong>?</strong></p>
4620
<p>matches any single character</p>
4626
<p><strong>*</strong></p>
4630
<p>matches 0 or more characters of any type</p>
4636
<p><strong>%</strong></p>
4640
<p>matches 0 or more non-space characters (can be used to match
4647
<p><strong>~</strong></p>
4651
<p>matches 1 or more space characters (can be used for whitespace
4659
<p><em>Copyright © 1997 Robey Pointer<br>
4660
Copyright © 1999, 2000, 2001, 2002, 2003, 2004
4661
<a href="http://www.eggheads.org/"> Eggheads Development Team</a></em></p>