/[cvs]/eggdrop1.7/doc/TCL-COMMANDS
ViewVC logotype

Contents of /eggdrop1.7/doc/TCL-COMMANDS

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Mon Nov 20 13:53:24 2006 UTC (12 years, 5 months ago) by tothwolf
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
* Updated copyright dates for 2006 (better late than never).

1 $Id: TCL-COMMANDS,v 1.5 2005-07-31 03:49:35 wcc Exp $
2
3 Eggdrop Tcl Commands
4 Last revised: August 24, 2004
5 _____________________________________________________________________
6
7 Eggdrop Tcl Commands
8
9
10 This is an exhaustive list of all the Tcl commands added to Eggdrop. All
11 of the normal Tcl built-in commands are still there, of course, but you
12 can also use these to manipulate features of the bot. They are listed
13 according to category.
14
15 This list is accurate for Eggdrop v1.7.0. Scripts written for v1.3/v1.4
16 series of Eggdrop should probably work with a few minor modifications
17 depending on the script. 1.6 scripts should work without modification.
18 Scripts which were written for v0.9, v1.0, v1.1 or v1.2 will probably
19 not work without modification. Commands which have been changed in this
20 version of Eggdrop (or are just new commands) are marked with vertical
21 bars (|) on the left.
22
23
24 *** OUTPUT COMMANDS ***
25
26 putserv <text> [options]
27 Description: sends text to the server, like '.dump' (intended for direct
28 server commands); output is queued so that the bot won't flood itself
29 off the server.
30 Options:
31 -next: push messages to the front of the queue
32 -normal: no effect
33 Returns: nothing
34 Module: server
35
36 puthelp <text> [options]
37 Description: sends text to the server, like 'putserv', but it uses a
38 different queue intended for sending messages to channels or people.
39 Options:
40 -next: push messages to the front of the queue
41 -normal: no effect
42 Returns: nothing
43 Module: server
44
45 putquick <text> [options]
46 Description: sends text to the server, like 'putserv', but it uses a
47 different (and faster) queue.
48 Options:
49 -next: push messages to the front of the queue
50 -normal: no effect
51 Returns: nothing
52 Module: server
53
54 putkick <channel> <nick,nick,...> [reason]
55 Description: sends kicks to the server and tries to put as many nicks
56 into one kick command as possible.
57 Returns: nothing
58 Module: irc
59
60 putlog <text>
61 Description: sends text to the bot's logfile, marked as 'misc' (o)
62 Returns: nothing
63 Module: core
64
65 putcmdlog <text>
66 Description: sends text to the bot's logfile, marked as 'command' (c)
67 Returns: nothing
68 Module: core
69
70 putxferlog <text>
71 Description: sends text to the bot's logfile, marked as 'file-area' (x)
72 Returns: nothing
73 Module: core
74
75 putloglev <level(s)> <channel> <text>
76 Description: sends text to the bot's logfile, tagged with all of the
77 valid levels given. Use "*" to indicate all log levels.
78 Returns: nothing
79 Module: core
80
81 dumpfile <nick> <filename>
82 Description: dumps file from the help/text directory to a user on IRC via
83 msg (one line per msg). The user has no flags, so the flag bindings
84 won't work within the file.
85 Returns: nothing
86 Module: core
87
88 queuesize [queue]
89 Returns: the number of messages in all queues. If a queue is specified,
90 only the size of this queue is returned. Valid queues are: mode,
91 server, help.
92 Module: server
93
94 clearqueue <queue>
95 Description: removes all messages from a queue. Valid arguments are:
96 mode, server, help, or all.
97 Returns: the number of deleted lines from the specified queue.
98 Module: server
99
100
101 *** USER RECORD MANIPULATION COMMANDS ***
102
103 countusers
104 Returns: number of users in the bot's database
105 Module: core
106
107 validuser <handle>
108 Returns: 1 if a user by that name exists; 0 otherwise
109 Module: core
110
111 finduser <nick!user@host>
112 Description: finds the user record which most closely matches the given
113 nick!user@host
114 Returns: the handle found, or "*" if none
115 Module: core
116
117 userlist [flags]
118 Returns: a list of users on the bot. You can use the flag matching
119 system here ([global]{&/|}[chan]{&/|}[bot]). '&' specifies "and";
120 '|' specifies "or".
121 Module: core
122
123 passwdok <handle> <pass>
124 Description: checks the password given against the user's password.
125 Check against the password "" (a blank string) or "-" to find out
126 if a user has no password set.
127 Returns: 1 if the password matches for that user; 0 otherwise
128 Module: core
129
130 getuser <handle> <entry-type> [extra info]
131 Description: an interface to the new generic userfile support. Valid
132 entry types are:
133 BOTFL - returns the current bot-specific flags for the user
134 (bot-only)
135 BOTADDR - returns a list containing the bot's address, telnet port,
136 and relay port (bot-only)
137 HOSTS - returns a list of hosts for the user
138 LASTON - returns a list containing the unixtime last seen and the
139 last seen place. LASTON #channel returns the time last
140 seen time for the channel or 0 if no info exists.
141 INFO - returns the user's global info line
142 XTRA - returns the user's XTRA info
143 COMMENT - returns the master-visible only comment for the user
144 EMAIL - returns the user's e-mail address
145 URL - returns the user's url
146 HANDLE - returns the user's handle as it is saved in the userfile
147 PASS - returns the user's encrypted password
148 Returns: info specific to each entry-type
149 Module: core
150
151 setuser <handle> <entry-type> [extra info]
152 Description: this is the counterpart of getuser. It lets you set the
153 various values. Other then the ones listed below, the entry-types are
154 the same as getuser's.
155 PASS - sets a users password (no third arg will clear it)
156 HOSTS - if used with no third arg, all hosts for the user will be
157 be cleared. Otherwise, *1* hostmask is added :P
158 LASTON - This setting has 3 forms. "setuser <handle> LASTON
159 <unixtime> <place>" sets global LASTON time, "setuser
160 <handle> LASTON <unixtime>" sets global LASTON time
161 (leaving the place field empty), and "setuser <handle>
162 LASTON <unixtime> <channel>" sets a users LASTON time for
163 a channel (if it is a valid channel).
164 Returns: nothing
165 Module: core
166
167 chhandle <old-handle> <new-handle>
168 Description: changes a user's handle
169 Returns: 1 on success; 0 if the new handle is invalid or already used,
170 or if the user can't be found
171 Module: core
172
173 chattr <handle> [changes [channel]]
174 Description: changes the attributes for a user record, if you include any.
175 Changes are of the form '+f', '-o', '+dk', '-o+d', etc. If changes are
176 specified in the format of |<changes> <channel>, the channel-specific
177 flags for that channel are altered. You can now use the +o|-o #channel
178 format here too.
179 Returns: new flags for the user (if you made no changes, the current
180 flags are returned). If a channel was specified, the global AND the
181 channel-specific flags for that channel are returned in the format of
182 globalflags|channelflags. "*" is returned if the specified user does
183 not exist.
184 Module: core
185
186 botattr <handle> [changes [channel]]
187 Description: similar to chattr except this modifies bot flags rather
188 than normal user attributes.
189 Returns: new flags for the bot (if you made no changes, the current
190 flags are returned). If a channel was specified, the global AND the
191 channel-specific flags for that channel are returned in the format of
192 globalflags|channelflags. "*" is returned if the specified bot does
193 not exist.
194 Module: core
195
196 matchattr <handle> <flags> [channel]
197 Returns: 1 if the specified user has the specified flags; 0 otherwise
198 Module: core
199
200 adduser <handle> [hostmask]
201 Description: creates a new user entry with the handle and hostmask given
202 (with no password and the default flags)
203 Returns: 1 if successful; 0 if the handle already exists
204 Module: core
205
206 addbot <handle> <address>
207 Description: adds a new bot to the userlist with the handle and bot
208 address given (with no password and no flags)
209 Returns: 1 if successful; 0 if the bot already exists
210 Module: core
211
212 deluser <handle>
213 Description: attempts to erase the user record for a handle
214 Returns: 1 if successful, 0 if no such user exists
215 Module: core
216
217 delhost <handle> <hostmask>
218 Description: deletes a hostmask from a user's host list
219 Returns: 1 on success; 0 if the hostmask (or user) doesn't exist
220 Module: core
221
222 addchanrec <handle> <channel>
223 Description: adds a channel record for a user
224 Returns: 1 on success; 0 if the user or channel does not exist
225 Module: channels
226
227 delchanrec <handle> <channel>
228 Description: removes a channel record for a user. This includes all
229 associated channel flags.
230 Returns: 1 on success; 0 if the user or channel does not exist
231 Module: channels
232
233 haschanrec <handle> <channel>
234 Returns: 1 if the given handle has a chanrec for the specified channel;
235 0 otherwise
236 Module: channels
237
238 getchaninfo <handle> <channel>
239 Returns: info line for a specific channel (behaves just like 'getinfo')
240 Module: channels
241
242 setchaninfo <handle> <channel> <info>
243 Description: sets the info line on a specific channel for a user. If
244 info is "none", it will be removed.
245 Returns: nothing
246 Module: channels
247
248 newchanban <channel> <ban> <creator> <comment> [lifetime] [options]
249 Description: adds a ban to the ban list of a channel; creator is given
250 credit for the ban in the ban list. lifetime is specified in
251 minutes. If lifetime is not specified, ban-time (usually 60) is
252 used. Setting the lifetime to 0 makes it a permanent ban.
253 Options:
254 sticky: forces the ban to be always active on a channel, even
255 with dynamicbans on
256 none: no effect
257 Returns: nothing
258 Module: channels
259
260 newban <ban> <creator> <comment> [lifetime] [options]
261 Description: adds a ban to the global ban list (which takes effect on
262 all channels); creator is given credit for the ban in the ban list.
263 lifetime is specified in minutes. If lifetime is not specified,
264 global-ban-time (usually 60) is used. Setting the lifetime to 0 makes
265 it a permanent ban.
266 Options:
267 sticky: forces the ban to be always active on a channel, even
268 with dynamicbans on
269 none: no effect
270 Returns: nothing
271 Module: channels
272
273 newchanexempt <channel> <exempt> <creator> <comment> [lifetime] [options]
274 Description: adds a exempt to the exempt list of a channel; creator is
275 given credit for the exempt in the exempt list. lifetime is specified
276 in minutes. If lifetime is not specified, exempt-time (usually 60) is
277 used. Setting the lifetime to 0 makes it a permanent exempt. The exempt
278 will not be removed until the corresponding ban has been removed. For
279 timed bans, once the time period has expired, the exempt will not be
280 removed until the corresponding ban has either expired or been removed.
281 Options:
282 sticky: forces the exempt to be always active on a channel, even
283 with dynamicexempts on
284 none: no effect
285 Returns: nothing
286 Module: channels
287
288 newexempt <exempt> <creator> <comment> [lifetime] [options]
289 Description: adds a exempt to the global exempt list (which takes effect
290 on all channels); creator is given credit for the exempt in the exempt
291 list. lifetime is specified in minutes. If lifetime is not specified,
292 exempt-time (usually 60) is used. Setting the lifetime to 0 makes it a
293 permanent exempt. The exempt will not be removed until the
294 corresponding ban has been removed.
295 Options:
296 sticky: forces the exempt to be always active on a channel, even
297 with dynamicexempts on
298 none: no effect
299 Returns: nothing
300 Module: channels
301
302 newchaninvite <channel> <invite> <creator> <comment> [lifetime] [options]
303 Description: adds a invite to the invite list of a channel; creator is
304 given credit for the invite in the invite list. lifetime is specified
305 in minutes. If lifetime is not specified, invite-time (usually 60) is
306 used. Setting the lifetime to 0 makes it a permanent invite. The invite
307 will not be removed until the channel has gone -i.
308 Options:
309 sticky: forces the invite to be always active on a channel, even
310 with dynamicinvites on
311 none: no effect
312 Returns: nothing
313 Module: channels
314
315 newinvite <invite> <creator> <comment> [lifetime] [options]
316 Description: adds a invite to the global invite list (which takes effect
317 on all channels); creator is given credit for the invite in the invite
318 list. lifetime is specified in minutes. If lifetime is not specified,
319 invite-time (usually 60) is used. Setting the lifetime to 0 makes it
320 a permanent invite. The invite will not be removed until the channel
321 has gone -i.
322 Options:
323 sticky: forces the invite to be always active on a channel, even
324 with dynamicinvites on
325 none: no effect
326 Returns: nothing
327 Module: channels
328
329 stick <banmask> [channel]
330 Description: makes a ban sticky, or, if a channel is specified, then it
331 is set sticky on that channel only.
332 Returns: 1 on success; 0 otherwise
333 Module: channels
334
335 unstick <banmask> [channel]
336 Description: makes a ban no longer sticky, or, if a channel is
337 specified, then it is unstuck on that channel only.
338 Returns: 1 on success; 0 otherwise
339 Module: channels
340
341 stickexempt <exemptmask> [channel]
342 Description: makes an exempt sticky, or, if a channel is specified,
343 then it is set sticky on that channel only.
344 Returns: 1 on success; 0 otherwise
345 Module: channels
346
347 unstickexempt <exemptmask> [channel]
348 Description: makes an exempt no longer sticky, or, if a channel is
349 specified, then it is unstuck on that channel only.
350 Returns: 1 on success; 0 otherwise
351 Module: channels
352
353 stickinvite <invitemask> [channel]
354 Description: makes an invite sticky, or, if a channel is specified,
355 then it is set sticky on that channel only.
356 Returns: 1 on success; 0 otherwise
357 Module: channels
358
359 unstickinvite <invitemask> [channel]
360 Description: makes an invite no longer sticky, or, if a channel is
361 specified, then it is unstuck on that channel only.
362 Returns: 1 on success; 0 otherwise
363 Module: channels
364
365 killchanban <channel> <ban>
366 Description: removes a ban from the ban list for a channel
367 Returns: 1 on success; 0 otherwise
368 Module: channels
369
370 killban <ban>
371 Description: removes a ban from the global ban list
372 Returns: 1 on success; 0 otherwise
373 Module: channels
374
375 killchanexempt <channel> <exempt>
376 Description: removes an exempt from the exempt list for a channel
377 Returns: 1 on success; 0 otherwise
378 Module: channels
379
380 killexempt <exempt>
381 Description: removes an exempt from the global exempt list
382 Returns: 1 on success; 0 otherwise
383 Module: channels
384
385 killchaninvite <channel> <invite>
386 Description: removes an invite from the invite list for a channel
387 Returns: 1 on success; 0 otherwise
388 Module: channels
389
390 killinvite <invite>
391 Description: removes an invite from the global invite list
392 Returns: 1 on success; 0 otherwise
393 Module: channels
394
395 ischanjuped <channel>
396 Returns: 1 if the channel is juped, and the bot is unable to join; 0
397 otherwise
398 Module: channels
399
400 isban <ban> [channel]
401 Returns: 1 if the specified ban is in the global ban list; 0 otherwise.
402 If a channel is specified, that channel's ban list is checked as well.
403 Module: channels
404
405 ispermban <ban> [channel]
406 Returns: 1 if the specified ban is in the global ban list AND is marked
407 as permanent; 0 otherwise. If a channel is specified, that channel's
408 ban list is checked as well.
409 Module: channels
410
411 isexempt <exempt> [channel]
412 Returns: 1 if the specified exempt is in the global exempt list; 0
413 otherwise. If a channel is specified, that channel's exempt list is
414 checked as well.
415 Module: channels
416
417 ispermexempt <exempt> [channel]
418 Returns: 1 if the specified exempt is in the global exempt list AND is
419 marked as permanent; 0 otherwise. If a channel is specified, that
420 channel's exempt list is checked as well.
421 Module: channels
422
423 isinvite <invite> [channel]
424 Returns: 1 if the specified invite is in the global invite list; 0
425 otherwise. If a channel is specified, that channel's invite list is
426 checked as well.
427 Module: channels
428
429 isperminvite <invite> [channel]
430 Returns: 1 if the specified invite is in the global invite list AND is
431 marked as permanent; 0 otherwise. If a channel is specified, that
432 channel's invite list is checked as well.
433 Module: channels
434
435 isbansticky <ban> [channel]
436 Returns: 1 if the specified ban is marked as sticky in the global ban
437 list; 0 otherwise. If a channel is specified, that channel's ban list
438 is checked as well.
439 Module: channels
440
441 isexemptsticky <exempt> [channel]
442 Returns: 1 if the specified exempt is marked as sticky in the global
443 exempt list; 0 otherwise. If a channel is specified, that channel's
444 exempt list is checked as well.
445 Module: channels
446
447 isinvitesticky <invite> [channel]
448 Returns: 1 if the specified invite is marked as sticky in the global
449 invite list; 0 otherwise. If a channel is specified, that channel's
450 invite list is checked as well.
451 Module: channels
452
453 matchban <nick!user@host> [channel]
454 Returns: 1 if the specified nick!user@host matches a ban in the global
455 ban list; 0 otherwise. If a channel is specified, that channel's ban
456 list is checked as well.
457 Module: channels
458
459 matchexempt <nick!user@host> [channel]
460 Returns: 1 if the specified nick!user@host matches an exempt in the
461 global exempt list; 0 otherwise. If a channel is specified, that
462 channel's exempt list is checked as well.
463 Module: channels
464
465 matchinvite <nick!user@host> [channel]
466 Returns: 1 if the specified nick!user@host matches an invite in the
467 global invite list; 0 otherwise. If a channel is specified, that
468 channel's invite list is checked as well.
469 Module: channels
470
471 banlist [channel]
472 Returns: a list of global bans, or, if a channel is specified, a
473 list of channel-specific bans. Each entry is a sublist containing:
474 hostmask, comment, expiration timestamp, time added, last time
475 active, and creator. The three timestamps are in unixtime format.
476 Module: channels
477
478 exemptlist [channel]
479 Returns: a list of global exempts, or, if a channel is specified, a
480 list of channel-specific exempts. Each entry is a sublist containing:
481 hostmask, comment, expiration timestamp, time added, last time
482 active, and creator. The three timestamps are in unixtime format.
483 Module: channels
484
485 invitelist [channel]
486 Returns: a list of global invites, or, if a channel is specified, a
487 list of channel-specific invites. Each entry is a sublist containing:
488 hostmask, comment, expiration timestamp, time added, last time
489 active, and creator. The three timestamps are in unixtime format.
490 Module: channels
491
492 newignore <hostmask> <creator> <comment> [lifetime]
493 Description: adds an entry to the ignore list; creator is given credit
494 for the ignore. lifetime is how many minutes until the ignore expires
495 and is removed. If lifetime is not specified, ignore-time (usually 60)
496 is used. Setting the lifetime to 0 makes it a permanent ignore.
497 Returns: nothing
498 Module: core
499
500 killignore <hostmask>
501 Description: removes an entry from the ignore list
502 Returns: 1 if successful; 0 otherwise
503 Module: core
504
505 ignorelist
506 Returns: a list of ignores. Each entry is a sublist containing:
507 hostmask, comment, expiration timestamp, time added, and creator.
508 The timestamps are in unixtime format.
509 Module: core
510
511 isignore <hostmask>
512 Returns: 1 if the ignore is in the list; 0 otherwise
513 Module: core
514
515 save
516 Description: writes the user and channel files to disk
517 Returns: nothing
518 Module: core
519
520 reload
521 Description: loads the userfile from disk, replacing whatever is in
522 memory
523 Returns: nothing
524 Module: core
525
526 backup
527 Description: makes a simple backup of the userfile that's on disk.
528 If the channels module is loaded, this also makes a simple backup
529 of the channel file.
530 Returns: nothing
531 Module: core
532
533 getting-users
534 Returns: 1 if the bot is currently downloading a userfile from
535 a sharebot (and hence, user records are about to drastically
536 change); 0 if not
537 Module: core
538
539 *** CHANNEL COMMANDS ***
540
541 channel add <name> [option-list]
542 Description: adds a channel record for the bot to monitor. The full
543 list of possible options are given in doc/settings/mod.channels. Note
544 that the channel options must be in a list (enclosed in {}).
545 Returns: nothing
546 Module: channels
547
548 channel set <name> <options...>
549 Description: sets options for the channel specified. The full list of
550 possible options are given in doc/settings/mod.channels.
551 Returns: nothing
552 Module: channels
553
554 channel info <name>
555 Returns: a list of info about the specified channel's settings.
556 Module: channels
557
558 channel get <name> <setting>
559 Returns: The value of the setting you specify. For flags, a value of 0
560 means it is disabled (-), and non-zero means enabled (+).
561 Module: channels
562
563 channel remove <name>
564 Description: removes a channel record from the bot and makes the bot no
565 longer monitor the channel
566 Returns: nothing
567 Module: channels
568
569 savechannels
570 Description: saves the channel settings to the channel-file if one is
571 defined.
572 Returns: nothing
573 Module: channels
574
575 loadchannels
576 Description: reloads the channel settings from the channel-file if one
577 is defined.
578 Returns: nothing
579 Module: channels
580
581 channels
582 Returns: a list of the channels the bot has a channel record for
583 Module: channels
584
585 channame2dname <channel-name>
586 chandname2name <channel-dname>
587 Description: these two functions are important to correctly support
588 !channels. The bot differentiates between channel description names
589 (chan dnames) and real channel names (chan names). The chan dnames
590 are what you would normally call the channel, such as "!channel". The
591 chan names are what the IRC server uses to identify the channel. They
592 consist of the chan dname prefixed with an ID; such as "!ABCDEchannel".
593
594 For bot functions like isop, isvoice, etc. you need to know the chan
595 dnames. If you communicate with the server, you usually get the chan
596 name, though. That's what you need the channame2dname function for.
597
598 If you only have the chan dname and want to directly send raw server
599 commands, use the chandname2name command.
600
601 NOTE: For non-!channels, chan dname and chan name are the same.
602 Module: irc
603
604 isbotnick <nick>
605 Returns: 1 if the nick matches the botnick; 0 otherwise
606 Module: server
607
608 botisop [channel]
609 Returns: 1 if the bot has ops on the specified channel (or any channel
610 if no channel is specified); 0 otherwise
611 Module: irc
612
613 botishalfop [channel]
614 Returns: 1 if the bot has halfops on the specified channel (or any channel
615 if no channel is specified); 0 otherwise
616 Module: irc
617
618 botisvoice [channel]
619 Returns: 1 if the bot has a voice on the specified channel (or any
620 channel if no channel is specified); 0 otherwise
621 Module: irc
622
623 botonchan [channel]
624 Returns: 1 if the bot is on the specified channel (or any channel if
625 no channel is specified); 0 otherwise
626 Module: irc
627
628 isop <nickname> [channel]
629 Returns: 1 if someone by the specified nickname is on the channel (or
630 any channel if no channel name is specified) and has ops; 0 otherwise
631 Module: irc
632
633 ishalfop <nickname> [channel]
634 Returns: 1 if someone by the specified nickname is on the channel (or
635 any channel if no channel name is specified) and has halfops; 0 otherwise
636 Module: irc
637
638 wasop <nickname> <channel>
639 Returns: 1 if someone that just got opped/deopped in the chan had op
640 before the modechange; 0 otherwise
641 Module: irc
642
643 washalfop <nickname> <channel>
644 Returns: 1 if someone that just got halfopped/dehalfopped in the chan
645 had halfop before the modechange; 0 otherwise
646 Module: irc
647
648 isvoice <nickname> [channel]
649 Returns: 1 if someone by that nickname is on the channel (or any
650 channel if no channel is specified) and has voice (+v); 0 otherwise
651 Module: irc
652
653 onchan <nickname> [channel]
654 Returns: 1 if someone by that nickname is on the specified channel (or
655 any channel if none is specified); 0 otherwise
656 Module: irc
657
658 nick2hand <nickname> [channel]
659 Returns: the handle of a nickname on a channel. If a channel is not
660 specified, the bot will check all of its channels. If the nick is
661 not found, "" is returned. If the nick is found but does not have
662 a handle, "*" is returned.
663 Module: irc
664
665 hand2nick <handle> [channel]
666 Returns: nickname of the first person on the specified channel (if one
667 is specified) whose nick!user@host matches the given handle; "" is
668 returned if no match is found. If no channel is specified, all channels
669 are checked.
670 Module: irc
671
672 handonchan <handle> [channel]
673 Returns: 1 if the the nick!user@host for someone on the channel (or any
674 channel if no channel name is specified) matches for the handle given;
675 0 otherwise
676 Module: irc
677
678 ischanban <ban> <channel>
679 Returns: 1 if the specified ban is on the given channel's ban list
680 (not the bot's banlist for the channel)
681 Module: irc
682
683 ischanexempt <exempt> <channel>
684 Returns: 1 if the specified exempt is on the given channel's exempt
685 list (not the bot's exemptlist for the channel)
686 Module: irc
687
688 ischaninvite <invite> <channel>
689 Returns: 1 if the specified invite is on the given channel's invite
690 list (not the bot's invitelist for the channel)
691 Module: irc
692
693 chanbans <channel>
694 Returns: a list of the current bans on the channel. Each element is
695 a sublist of the form {<ban> <bywho> <age>}. age is seconds from the
696 bot's point of view
697 Module: irc
698
699 chanexempts <channel>
700 Returns: a list of the current exempts on the channel. Each element is
701 a sublist of the form {<exempts> <bywho> <age>}. age is seconds from the
702 bot's point of view
703 Module: irc
704
705 chaninvites <channel>
706 Returns: a list of the current invites on the channel. Each element is
707 a sublist of the form {<invites> <bywho> <age>}. age is seconds from the
708 bot's point of view
709 Module: irc
710
711 resetbans <channel>
712 Description: removes all bans on the channel that aren't in the bot's
713 ban list and refreshes any bans that should be on the channel but
714 aren't
715 Returns: nothing
716 Module: irc
717
718 resetexempts <channel>
719 Description: removes all exempt on the channel that aren't in the bot's
720 exempt list and refreshes any exempts that should be on the channel
721 but aren't
722 Returns: nothing
723 Module: irc
724
725 resetinvites <channel>
726 Description: removes all invites on the channel that aren't in the bot's
727 invite list and refreshes any invites that should be on the channel
728 but aren't
729 Returns: nothing
730 Module: irc
731
732 resetchan <channel>
733 Description: rereads in the channel info from the server
734 Returns: nothing
735 Module: irc
736
737 getchanhost <nickname> [channel]
738 Returns: user@host of the specified nickname (the nickname is not included
739 in the returned host). If a channel is not specified, bot will check
740 all of its channels. If the nickname is not on the channel(s), "" is
741 returned.
742 Module: irc
743
744 getchanjoin <nickname> <channel>
745 Returns: timestamp (unixtime format) of when the specified nickname
746 joined the channel
747 Module: irc
748
749 onchansplit <nick> [channel]
750 Returns: 1 if that nick is split from the channel (or any channel if no
751 channel is specified); 0 otherwise
752 Module: irc
753
754 chanlist <channel> [flags[&chanflags]]
755 Description: flags are any global flags; the '&' denotes to look for
756 channel specific flags. Examples:
757 n (Global Owner)
758 &n (Channel Owner)
759 o&m (Global Op, Channel Master)
760 Now you can use even more complex matching of flags, including +&- flags
761 and & or | (and or or) matching.
762 Returns: list of nicknames currently on the bot's channel that have all
763 of the flags specified;. If no flags are given, all of the nicknames
764 are returned. Please note that if you're executing chanlist after a
765 part or sign bind, the gone user will still be listed, so you can
766 check for wasop, isop, etc.
767 Module: irc
768
769
770 getchanidle <nickname> <channel>
771 Returns: number of minutes that person has been idle; 0 if the
772 specified user isn't on the channel
773 Module: irc
774
775 getchanmode <channel>
776 Returns: string of the type "+ntik key" for the channel specified
777 Module: irc
778
779 jump [server [port [password]]]
780 Description: jumps to the server specified, or (if none is specified)
781 the next server in the bot's serverlist
782 Returns: nothing
783 Module: server
784
785 pushmode <channel> <mode> [arg]
786 Description: sends out a channel mode change (ex: pushmode #lame +o
787 goober) through the bot's queuing system. All the mode changes will
788 be sent out at once (combined into one line as much as possible) after
789 the script finishes, or when 'flushmode' is called.
790 Returns: nothing
791 Module: irc
792
793 flushmode <channel>
794 Description: forces all previously pushed channel mode changes to be
795 sent to the server, instead of when the script is finished (just for
796 the channel specified)
797 Returns: nothing
798 Module: irc
799
800 topic <channel>
801 Returns: string containing the current topic of the specified channel
802 Module: irc
803
804 validchan <channel>
805 Description: checks if the bot has a channel record for the specified
806 channel. Note that this does not necessarily mean that the bot is ON
807 the channel.
808 Returns: 1 if the channel exists, 0 if not
809 Module: channels
810
811 isdynamic <channel>
812 Returns: 1 if the channel is a dynamic channel; 0 otherwise
813 Module: channels
814
815 setudef <flag/int/str> <name>
816 Description: initializes a user defined channel flag, string or integer
817 setting. You can use it like any other flag/setting. IMPORTANT: Don't
818 forget to reinitialize your flags/settings after a restart, or it'll be
819 lost.
820 Returns: nothing
821 Module: channels
822
823 renudef <flag/int/str> <oldname> <newname>
824 Description: renames a user defined channel flag, string, or integer
825 setting.
826 Returns: nothing
827 Module: channels
828
829 deludef <flag/int/str> <name>
830 Description: deletes a user defined channel flag, string, or integer
831 setting.
832 Returns: nothing
833 Module: channels
834
835 *** DCC COMMANDS ***
836
837 putdcc <idx> <text>
838 Description: sends text to the idx specified
839 Returns: nothing
840 Module: core
841
842 dccbroadcast <message>
843 Description: sends a message to everyone on the party line across the
844 botnet, in the form of "*** <message>" for local users and
845 "*** (Bot) <message>" for users on other bots
846 Returns: nothing
847 Module: core
848
849 dccputchan <channel> <message>
850 Description: sends your message to everyone on a certain channel on the
851 botnet, in a form exactly like dccbroadcast does. Valid channels are 0
852 through 99999.
853 Returns: nothing
854 Module: core
855
856 boot <user@bot> [reason]
857 Description: boots a user from the partyline
858 Returns: nothing
859 Module: core
860
861 dccsimul <idx> <text>
862 Description: simulates text typed in by the dcc user specified. Note
863 that in v0.9, this only simulated commands; now a command must be
864 preceded by a '.' to be simulated.
865 Returns: nothing
866 Module: core
867
868 hand2idx <handle>
869 Returns: the idx (a number greater than or equal to zero) for the user
870 given if the user is on the party line in chat mode (even if she is
871 currently on a channel or in chat off), the file area, or in the control
872 of a script. -1 is returned if no idx is found. If the user is on
873 multiple times, the oldest idx is returned.
874 Module: core
875
876 idx2hand <idx>
877 Returns: handle of the user with the given idx
878 Module: core
879
880 valididx <idx>
881 Returns: 1 if the idx currently exists; 0 otherwise
882 Module: core
883
884 getchan <idx>
885 Returns: the current party line channel for a user on the party line;
886 "0" indicates he's on the group party line, "-1" means he has chat off,
887 and a value from 1 to 99999 is a private channel
888 Module: core
889
890 setchan <idx> <channel>
891 Description: sets a party line user's channel. The party line user
892 is not notified that she is now on a new channel. A channel name
893 can be used (provided it exists).
894 Returns: nothing
895 Module: core
896
897 console <idx> [channel] [console-modes]
898 Description: changes a dcc user's console mode, either to an absolute
899 mode (like "mpj") or just adding/removing flags (like "+pj" or "-moc"
900 or "+mp-c"). The user's console channel view can be changed also (as
901 long as the new channel is a valid channel).
902 Returns: a list containing the user's (new) channel view and (new)
903 console modes, or nothing if that user isn't currently on the partyline
904 Module: core
905
906 echo <idx> [status]
907 Description: turns a user's echo on or off; the status has to be a 1 or 0
908 Returns: new value of echo for that user (or the current value, if status
909 was omitted)
910 Module: core
911
912 strip <idx> [+/-strip-flags]
913 Description: modifies the strip-flags for a user. The supported
914 strip-flags are:
915 b - remove all boldface codes
916 c - remove all color codes
917 r - remove all reverse video codes
918 u - remove all underline codes
919 a - remove all ANSI codes
920 g - remove all ctrl-g (bell) codes
921 Returns: new strip-flags for the specified user (or the current
922 flags, if strip-flags was omitted)
923 Module: core
924
925 putbot <bot-nick> <message>
926 Description: sends a message across the botnet to another bot. If no
927 script intercepts the message on the other end, the message is
928 ignored.
929 Returns: nothing
930 Module: core
931
932 putallbots <message>
933 Description: sends a message across the botnet to all bots. If no
934 script intercepts the message on the other end, the message is
935 ignored.
936 Returns: nothing
937 Module: core
938
939 killdcc <idx>
940 Description: kills a partyline or file area connection
941 Returns: nothing
942 Module: core
943
944 bots
945 Returns: list of the bots currently connected to the botnet
946 Module: core
947
948 botlist
949 Returns: a list of bots currently on the botnet. Each item in the list
950 is a sublist with four elements: bot, uplink, version, sharing status:
951 bot: the bot's botnetnick
952 uplink: the bot the bot is connected to
953 version: its current numeric version
954 sharing: a "+" if the bot is a sharebot; "-" otherwise
955 Module: core
956
957 islinked <bot>
958 Returns: 1 if the bot is currently linked; 0 otherwise
959 Module: core
960
961 dccused
962 Returns: number of dcc connections currently in use
963 Module: core
964
965 dcclist [type]
966 Returns: a list of active connections, each item in the list is a
967 sublist containing six elements:
968 {<idx> <handle> <hostname> <type> {<other>} <timestamp>}.
969
970 The types are: chat, bot, files, file_receiving, file_sending,
971 file_send_pending, script, socket (these are connections that have
972 not yet been put under 'control'), telnet, and server. The timestamp
973 is in unixtime format.
974 Module: core
975
976 whom <chan>
977 Returns: list of people on the botnet who are on that channel. 0 is
978 the default party line. Each item in the list is a sublist with six
979 elements: nickname, bot, hostname, access flag ('-', '@', '+', or
980 '*'), minutes idle, and away message (blank if the user is not away).
981 If you specify * for channel, every user on the botnet is returned
982 with an extra argument indicating the channel the user is on.
983 Module: core
984
985 getdccidle <idx>
986 Returns: number of seconds the dcc chat/file system/script user has
987 been idle
988 Module: core
989
990 getdccaway <idx>
991 Returns: away message for a dcc chat user (or "" if the user is not
992 set away)
993 Module: core
994
995 setdccaway <idx> <message>
996 Description: sets a party line user's away message and marks them away.
997 If set to "", the user is marked as no longer away.
998 Returns: nothing
999 Module: core
1000
1001 connect <host> <port>
1002 Description: makes an outgoing connection attempt and creates a dcc
1003 entry for it. A 'control' command should be used immediately after
1004 a successful 'connect' so no input is lost.
1005 Returns: idx of the new connection
1006 Module: core
1007
1008 listen <port> <type> [options] [flag]
1009 Description: opens a listening port to accept incoming telnets; type
1010 must be one of "bots", "all", "users", "script", or "off":
1011
1012 listen <port> bots [mask]
1013 Description: accepts connections from bots only; the optional mask
1014 is used to identify permitted bot names. If the mask begins with
1015 '@', it is interpreted to be a mask of permitted hosts to accept
1016 connections from.
1017 Returns: port number
1018
1019 listen <port> users [mask]
1020 Description: accepts connections from users only (no bots); the
1021 optional mask is used to identify permitted nicknames. If the
1022 mask begins with '@', it is interpreted to be a mask of permitted
1023 hosts to accept connections from.
1024 Returns: port number
1025
1026 listen <port> all [mask]
1027 Description: accepts connections from anyone; the optional mask
1028 is used to identify permitted nicknames/botnames. If the mask
1029 begins with '@', it is interpreted to be a mask of permitted
1030 hosts to accept connections from.
1031 Returns: port number
1032
1033 listen <port> script <proc> [flag]
1034 Description: accepts connections which are immediately routed to
1035 a proc. The proc is called with one parameter: the idx of the
1036 new connection. Flag may currently only be 'pub', which makes
1037 the bot allow anyone to connect.
1038 Returns: port number
1039
1040 listen <port> off
1041 Description: stop listening on a port
1042 Returns: nothing
1043 Module: core
1044
1045 dccdumpfile <idx> <filename>
1046 Description: dumps out a file from the text directory to a dcc chat
1047 user. The flag matching that's used everywhere else works here, too.
1048 Returns: nothing
1049 Module: core
1050
1051 *** NOTES MODULE ***
1052
1053 notes <user> [numberlist]
1054 Returns: -1 if no such user, -2 if notefile failure. If a numberlist
1055 is not specified, the number of notes stored for the user is returned.
1056 Otherwise, a list of sublists containing information about notes
1057 stored for the user is returned. Each sublist is in the format of:
1058 {<from> <timestamp> <note text>}.
1059 Module: notes
1060
1061 erasenotes <user> <numberlist>
1062 Description: erases some or all stored notes for a user. Use '-'
1063 to erase all notes.
1064 Returns: -1 if no such user, -2 if notefile failure, 0 if
1065 no such note, or number of erased notes.
1066 Module: notes
1067
1068 listnotes <user> <numberlist>
1069 Description: lists existing notes according to the numberlist (ex:
1070 "2-4;8;16-")
1071 Returns: -1 if no such user, -2 if notefile failure, 0 if no
1072 such note, list of existing notes.
1073 Module: notes
1074
1075 storenote <from> <to> <msg> <idx>
1076 Description: stores a note for later reading, notifies idx of any results
1077 (use idx -1 for no notify).
1078 Returns: 0 on success; non-0 on failure
1079 Module: notes
1080
1081 *** ASSOC MODULE ***
1082
1083 assoc <chan> [name]
1084 Description: sets the name associated with a botnet channel, if you
1085 specify one
1086 Returns: current name for that channel, if any
1087 Module: assoc
1088
1089 killassoc <chan>
1090 Description: removes the name associated with a botnet channel, if any
1091 exists. Use 'killassoc &' to kill all assocs.
1092 Returns: nothing
1093 Module: assoc
1094
1095 *** COMPRESS MODULE ***
1096
1097 compressfile [-level <level>] <src-file> [target-file]
1098 uncompressfile <src-file> [target-file]
1099 Description: compresses or un-compresses files. The level option specifies
1100 the compression mode to use when compressing. Available modes are from
1101 0 (minimum CPU usage, minimum compression) all the way up to 9 (maximum
1102 CPU usage, maximum compression). If you don't specify the target-file,
1103 the src-file will be overwritten.
1104 Returns: nothing
1105 Module: compress
1106
1107 iscompressed <filename>
1108 Description: determines whether <filename> is gzip compressed. Returns 1
1109 if it is, 0 if it isn't, and 2 if some kind of error prevented the
1110 checks from succeeding.
1111 Returns: nothing
1112 Module: compress
1113
1114 *** FILESYS MODULE ***
1115
1116 setpwd <idx> <dir>
1117 Description: changes the directory of a file system user, in exactly
1118 the same way as a 'cd' command would. The directory can be specified
1119 relative or absolute.
1120 Returns: nothing
1121 Module: filesys
1122
1123 getpwd <idx>
1124 Returns: the current directory of a file system user
1125 Module: filesys
1126
1127 getfiles <dir>
1128 Returns: a list of files in the directory given; the directory is
1129 relative to dcc-path
1130 Module: filesys
1131
1132 getdirs <dir>
1133 Returns: a list of subdirectories in the directory given; the directory
1134 is relative to dcc-path
1135 Module: filesys
1136
1137 dccsend <filename> <ircnick>
1138 Description: attempts to start a dcc file transfer to the given nick;
1139 the filename must be specified either by full pathname or in relation
1140 to the bot's startup directory
1141 Returns:
1142 0 success
1143 1 the dcc table is full (too many connections)
1144 2 can't open a socket for the transfer
1145 3 the file doesn't exist
1146 4 the file was queued for later transfer, which means that person has
1147 too many file transfers going right now
1148 5 copy-to-tmp is enabled and the file already exists in the temp
1149 directory
1150 Module: transfer
1151
1152 filesend <idx> <filename> [ircnick]
1153 Description: like dccsend, except it operates for a current filesystem
1154 user, and the filename is assumed to be a relative path from that
1155 user's current directory
1156 Returns: 0 on failure; 1 on success (either an immediate send or a queued
1157 send)
1158 Module: filesys
1159
1160 fileresend <idx> <filename> [ircnick]
1161 Description: functions like filesend, only that it sends a DCC RESEND
1162 instead of a DCC SEND, which allows people to resume aborted file
1163 transfers if their client supports that protocol. ircII/BitchX/etc.
1164 support it; mIRC does not.
1165 Returns: 0 on failure; 1 on success (either an immediate send or a queued
1166 send)
1167 Module: filesys
1168
1169 setdesc <dir> <file> <desc>
1170 Description: sets the description for a file in a file system directory;
1171 the directory is relative to dcc-path
1172 Returns: nothing
1173 Module: filesys
1174
1175 getdesc <dir> <file>
1176 Returns: the description for a file in the file system, if one
1177 exists
1178 Module: filesys
1179
1180 setowner <dir> <file> <handle>
1181 Description: changes the owner for a file in the file system; the
1182 directory is relative to dcc-path
1183 Returns: nothing
1184 Module: filesys
1185
1186 getowner <dir> <file>
1187 Returns: the owner of a file in the file system
1188 Module: filesys
1189
1190 setlink <dir> <file> <link>
1191 Description: creates or changes a linked file (a file that actually
1192 exists on another bot); the directory is relative to dcc-path
1193 Returns: nothing
1194 Module: filesys
1195
1196 getlink <dir> <file>
1197 Returns: the link for a linked file, if it exists
1198 Module: filesys
1199
1200 getfileq <handle>
1201 Returns: list of files queued by someone; each item in the list will be
1202 a sublist with two elements: nickname the file is being sent to and
1203 the filename
1204 Module: transfer
1205
1206 getfilesendtime <idx>
1207 Returns: the unixtime value from when a file transfer started, or a
1208 negative number:
1209 -1 no matching transfer with the specified idx was found
1210 -2 the idx matches an entry which is not a file transfer
1211 Module: transfer
1212
1213 mkdir <directory> [<required-flags> [channel]]
1214 Description: creates a directory in the file system. Only users with the
1215 required flags may access it.
1216 Returns:
1217 0 success
1218 1 can't create directory
1219 2 directory exists but is not a directory
1220 -3 could not open filedb
1221 Module: filesys
1222
1223 rmdir <directory>
1224 Description: removes a directory from the file system.
1225 Returns: 0 on success; 1 on failure
1226 Module: filesys
1227
1228 mv <file> <destination>
1229 Description: moves a file from its source to the given destination.
1230 The file can also be a mask, such as /incoming/*, provided the
1231 destination is a directory.
1232 Returns: If the command was successful, the number of files moved will
1233 be returned. Otherwise, a negative number will be returned:
1234 -1 invalid source file
1235 -2 invalid destination
1236 -3 destination file exists
1237 -4 no matches found
1238 Module: filesys
1239
1240 cp <file> <destination>
1241 Description: copies a file from its source to the given destination.
1242 The file can also be a mask, such as /incoming/*, provided the
1243 destination is a directory.
1244 Returns: If the command was successful, the number of files copied will
1245 be returned. Otherwise, a negative number will be returned:
1246 -1 invalid source file
1247 -2 invalid destination
1248 -3 destination file exists
1249 -4 no matches found
1250 Module: filesys
1251
1252 getflags <dir>
1253 Returns: the flags required to access a directory
1254 Module: filesys
1255
1256 setflags <dir> [<flags> [channel]]
1257 Description: sets the flags required to access a directory
1258 Returns: 0 on success; -1 or -3 on failure
1259 Module: filesys
1260
1261
1262 *** MISCELLANEOUS COMMANDS ***
1263
1264 bind <type> <flags> <keyword/mask> [proc-name]
1265 Description: You can use the 'bind' command to attach Tcl procedures
1266 to certain events. flags are the flags the user must have to trigger
1267 the event (if applicable). proc-name is the name of the Tcl procedure
1268 to call for this command (see below for the format of the procedure
1269 call). If the proc-name is omitted, no binding is added. Instead, the
1270 current binding is returned (if it's stackable, a list of the current
1271 bindings is returned).
1272 Returns: name of the command that was added, or (if proc-name was
1273 omitted), a list of the current bindings for this command
1274 Module: core
1275
1276 unbind <type> <flags> <keyword/mask> <proc-name>
1277 Description: removes a previously created bind
1278 Returns: name of the command that was removed
1279 Module: core
1280
1281 binds [type/mask]
1282 Returns: a list of Tcl binds, each item in the list is a sublist of
1283 five elements:
1284 {<type> <flags> <name> <hits> <proc>}
1285 Module: core
1286
1287 logfile [<modes> <channel> <filename>]
1288 Description: creates a new logfile, which will log the modes given for
1289 the channel listed. If no logfile is specified, a list of existing
1290 logfiles will be returned. "*" indicates all channels. You can also
1291 change the modes and channel of an existing logfile with this command.
1292 Entering a blank mode and channel ("") makes the bot stop logging there.
1293
1294 Logfile flags:
1295 b - information about bot linking and userfile sharing
1296 c - commands
1297 d - misc debug information
1298 e - Tcl errors
1299 h - raw share traffic
1300 j - joins, parts, quits, and netsplits on the channel
1301 k - kicks, bans, and mode changes on the channel
1302 m - private msgs, notices and ctcps to the bot
1303 o - misc info, errors, etc (IMPORTANT STUFF)
1304 p - public text on the channel
1305 r - raw incoming server traffic
1306 s - server connects, disconnects, and notices
1307 t - raw botnet traffic
1308 v - raw outgoing server traffic
1309 w - wallops (make sure the bot sets +w in init-server)
1310 x - file transfers and file-area commands
1311 Returns: filename of logfile created, or, if no logfile is specified, a
1312 list of logfiles such as: {mco * eggdrop.log} {jp #lame lame.log}
1313 Module: core
1314
1315 | maskhost <nick!user@host> [options]
1316 | Returns: masked hostmask for the string given.
1317 | Examples:
1318 | abc!user@a.b.host becomes *!user@*.b.host
1319 | abc!user@1.2.3.4 becomes *!user@1.2.3.*
1320 | abc!user@0:0:0:0:0:ffff:1.2.3.4 becomes *!user@0:0:0:0:0:ffff:1.2.3.*
1321 | abc!user@3ffe:604:2:b02e:6174:7265:6964:6573 becomes *!user@3ffe:604:2:b02e:6174:7265:6964:*
1322 |
1323 | When using the -ban option:
1324 | abc!~user@1.2.3.4 becomes *!*user@1.2.3.*
1325 | When using the -host option (with strict-ident):
1326 | abc!~user@1.2.3.4 -> *!~user@1.2.3.*
1327 | When using the -host option (without strict-ident):
1328 | abc!~user@1.2.3.4 -> *!?user@1.2.3.*
1329 | Options:
1330 | -ban: Any ident prefix will be replaced with a '*'. This is the default.
1331 | -host: Unless strict-ident is disabled, ident prefixes will not be
1332 | replaced. If strict-ident IS disabled, ident prefixes will be
1333 | replaced with '?'. -host is the default option.
1334 | Module: core
1335
1336 timer <minutes> <tcl-command>
1337 Description: executes the given Tcl command after a certain number of
1338 minutes have passed
1339 Returns: a timerID
1340 Module: core
1341
1342 utimer <seconds> <tcl-command>
1343 Description: executes the given Tcl command after a certain number of
1344 seconds have passed
1345 Returns: a timerID
1346 Module: core
1347
1348 timers
1349 Returns: a list of active minutely timers. Each entry in the list contains
1350 the number of minutes left till activation, the command that will be
1351 executed, and the timerID.
1352 Module: core
1353
1354 utimers
1355 Returns: a list of active secondly timers. Each entry in the list contains
1356 the number of minutes left till activation, the command that will be
1357 executed, and the timerID.
1358 Module: core
1359
1360 killtimer <timerID>
1361 Description: removes a minutely timer from the list
1362 Returns: nothing
1363 Module: core
1364
1365 killutimer <timerID>
1366 Description: removes a secondly timer from the list
1367 Returns: nothing
1368 Module: core
1369
1370 unixtime
1371 Returns: a long integer which represents the number of seconds that have
1372 passed since 00:00 Jan 1, 1970 (GMT).
1373 Module: core
1374
1375 duration <seconds>
1376 Returns: the number of seconds converted into years, weeks, days, hours,
1377 minutes, and seconds. 804600 seconds is turned into 1 week 2 days
1378 7 hours 30 minutes.
1379 Module: core
1380
1381 strftime <formatstring> [time]
1382 Returns: a formatted string of time using standard strftime format.
1383 If time is specified, the value of the specified time is used.
1384 Otherwise, the current time is used.
1385 Module: core
1386
1387 ctime <unixtime>
1388 Returns: a formatted date/time string based on the current locale
1389 settings from the unixtime string given; for example "Fri Aug 3
1390 11:34:55 1973"
1391 Module: core
1392
1393 myip
1394 Returns: a long number representing the bot's IP address, as it might
1395 appear in (for example) a DCC request
1396 Module: core
1397
1398 rand <limit>
1399 Returns: a random integer between 0 and limit-1
1400 Module: core
1401
1402 control <idx> <command>
1403 Description: removes an idx from the party line and sends all future
1404 input to the Tcl command given. The command will be called with two
1405 parameters: the idx and the input text. The command should return 0
1406 to indicate success and 1 to indicate that it relinquishes control of
1407 the user back to the bot. If the input text is blank (""), it
1408 indicates that the connection has been dropped. Also, if the input
1409 text is blank, never call killdcc on it, as it will fail with "invalid
1410 idx".
1411 Returns: nothing
1412 Module: core
1413
1414 sendnote <from> <to[@bot]> <message>
1415 Description: simulates what happens when one user sends a note to another
1416 Returns:
1417 0 - the send failed
1418 1 - the note was delivered locally or sent to another bot
1419 2 - the note was stored locally
1420 3 - the user's notebox is too full to store a note
1421 4 - a Tcl binding caught the note
1422 5 - the note was stored because the user is away
1423 Module: core
1424
1425 link [via-bot] <bot>
1426 Description: attempts to link to another bot directly. If you specify
1427 a via-bot, it tells the via-bot to attempt the link.
1428 Returns: 1 if the link will be attempted; 0 otherwise
1429 Module: core
1430
1431 unlink <bot>
1432 Description: attempts to unlink a bot from the botnet
1433 Returns: 1 on success; 0 otherwise
1434 Module: core
1435
1436 encrypt <key> <string>
1437 Returns: encrypted string (using the currently loaded encryption module),
1438 encoded into ASCII using base-64
1439 Module: encryption
1440
1441 decrypt <key> <encrypted-base64-string>
1442 Returns: decrypted string (using the currently loaded encryption module)
1443 Module: encryption
1444
1445 encpass <password>
1446 Returns: encrypted string (using the currently loaded encryption module)
1447 Module: encryption
1448
1449 die [reason]
1450 Description: causes the bot to log a fatal error and exit completely.
1451 If no reason is given, "EXIT" is used.
1452 Returns: none
1453 Module: core
1454
1455 unames
1456 Returns: the current operating system the bot is using
1457 Module: core
1458
1459 dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]
1460 Description: This issues an asynchronous dns lookup request. The
1461 command will block if dns module is not loaded; otherwise it will
1462 either return immediately or immediately call the specified proc
1463 (e.g. if the lookup is already cached).
1464
1465 As soon as the request completes, the specified proc will be called
1466 as follows:
1467
1468 <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] ... [argN]]
1469
1470 status is 1 if the lookup was successful and 0 if it wasn't. All
1471 additional parameters (called arg1, arg2 and argN above) get
1472 appended to the proc's other parameters.
1473 Returns: nothing
1474 Module: core
1475
1476 md5 <string>
1477 Returns: the 128 bit MD5 message-digest of the specified string
1478 Module: core
1479
1480 callevent <event>
1481 Description: triggers the evnt bind manually for a certain event.
1482 For example: callevent rehash.
1483 Returns: nothing
1484 Module: core
1485
1486 traffic
1487 Returns: a list of sublists containing information about the bot's
1488 traffic usage in bytes. Each sublist contains five elements: type,
1489 in-traffic today, in-traffic total, out-traffic today, out-traffic
1490 total (in that order).
1491 Module: core
1492
1493 modules
1494 Returns: a list of sublists containing information about the bot's
1495 currently loaded modules. Each sublist contains three elements: module,
1496 version, and dependencies. Each dependency is also a sublist containing
1497 the module name and version.
1498 Module: core
1499
1500 loadmodule <module>
1501 Description: attempts to load the specified module.
1502 Returns: "Already loaded." if the module is already loaded, "" if
1503 successful, or the reason the module couldn't be loaded.
1504 Module: core
1505
1506 unloadmodule <module>
1507 Description: attempts to unload the specified module.
1508 Returns: "No such module" if the module is not loaded, "" otherwise.
1509 Module: core
1510
1511 loadhelp <helpfile-name>
1512 Description: attempts to load the specified help file from the help/
1513 directory.
1514 Returns: nothing
1515 Module: core
1516
1517 unloadhelp <helpfile-name>
1518 Description: attempts to unload the specified help file.
1519 Returns: nothing
1520 Module: core
1521
1522 reloadhelp
1523 Description: reloads the bot's help files.
1524 Returns: nothing
1525 Module: core
1526
1527 restart
1528 Description: rehashes the bot, kills all timers, reloads all modules,
1529 and reconnects the bot to the next server in its list.
1530 Returns: nothing
1531 Module: core
1532
1533 rehash
1534 Description: rehashes the bot
1535 Returns: nothing
1536 Module: core
1537
1538 stripcodes <strip-flags> <string>
1539 Description: strips specified control characters from the string given.
1540 strip-flags can be any combination of the following:
1541 b - remove all boldface codes
1542 c - remove all color codes
1543 r - remove all reverse video codes
1544 u - remove all underline codes
1545 a - remove all ANSI codes
1546 g - remove all ctrl-g (bell) codes
1547 Returns: the stripped string.
1548 Module: core
1549
1550
1551 *** GLOBAL VARIABLES ***
1552
1553 NOTE: All config file variables are also global.
1554
1555 botnick
1556 Value: the current nickname the bot is using (for example: "Valis",
1557 "Valis0", etc.)
1558 Module: server
1559
1560 botname
1561 Value: the current nick!user@host that the server sees (for example:
1562 "Valis!valis@crappy.com")
1563 Module: server
1564
1565 server
1566 Value: the current server's real name (what server calls itself)
1567 and port bot is connected to (for example: "irc.math.ufl.edu:6667")
1568 Note that this does not nececerilly match the servers internet address.
1569 Module: server
1570
1571 serveraddress
1572 Value: the current server's internet address (hostname or IP) and port bot
1573 is connected to. This will correspond to the entry in server list (for
1574 example: "eu.undernet.org:6667"). Note that this does not necessarily
1575 match the name server calls itself.
1576 Module: server
1577
1578 version
1579 Value: current bot version "1.1.2+pl1 1010201 pl1";
1580 first item is the text version, second item is a numerical version,
1581 and any following items are the names of patches that have been added
1582 Module: core
1583
1584 numversion
1585 Value: the current numeric bot version (for example: "1010201").
1586 Numerical version is in the format of "MNNRRPP", where:
1587 M major release number
1588 NN minor release number
1589 RR sub-release number
1590 PP patch level for that sub-release
1591 Module: core
1592
1593 uptime
1594 Value: the unixtime value for when the bot was started
1595 Module: core
1596
1597 server-online
1598 Value: the unixtime value for when the bot connected to its current
1599 server
1600 Module: server
1601
1602 lastbind
1603 Value: the last command binding which was triggered. This allows you to
1604 identify which command triggered a Tcl proc.
1605 Module: core
1606
1607 isjuped
1608 Value: 1 if bot's nick is juped(437); 0 otherwise
1609 Module: server
1610
1611 handlen
1612 Value: the value of the HANDLEN define in src/eggdrop.h
1613 Module: core
1614
1615 config
1616 Value: the filename of the config file Eggdrop is currently using
1617 Module: core
1618
1619 *** BIND ***
1620
1621 You can use the 'bind' command to attach Tcl procedures to certain events.
1622 For example, you can write a Tcl procedure that gets called every time a
1623 user says "danger" on the channel.
1624
1625 Some bind types are marked as "stackable". That means that you can bind
1626 multiple commands to the same trigger. Normally, for example, a bind such
1627 as 'bind msg - stop msg:stop' (which makes a msg-command "stop" call the
1628 Tcl proc "msg:stop") will overwrite any previous binding you had for the
1629 msg command "stop". With stackable bindings, like 'msgm' for example,
1630 you can bind the same command to multiple procs. When the bind is triggered,
1631 ALL of the Tcl procs that are bound to it will be called.
1632
1633 To remove a bind, use the 'unbind' command. For example, to remove the
1634 bind for the "stop" msg command, use 'unbind msg - stop msg:stop'.
1635
1636 (A) BIND TYPES
1637
1638 The following is a list of bind types and how they work. Below each bind
1639 type is the format of the bind command, the list of arguments sent to
1640 the Tcl proc, and an explanation.
1641
1642 (1) MSG
1643 bind msg <flags> <command> <proc>
1644 procname <nick> <user@host> <handle> <text>
1645
1646 Description: used for /msg commands. The first word of the user's
1647 msg is the command, and everything else becomes the text argument.
1648 Module: server
1649
1650 (2) DCC
1651 bind dcc <flags> <command> <proc>
1652 procname <handle> <idx> <text>
1653
1654 Description: used for partyline commands; the command is the first
1655 word and everything else becomes the text argument. The idx is
1656 valid until the user disconnects. After that, it may be reused,
1657 so be careful about storing an idx for long periods of time.
1658 Module: core
1659
1660 (3) FIL
1661 bind fil <flags> <command> <proc>
1662 procname <handle> <idx> <text>
1663
1664 Description: the same as DCC, except this is triggered if the user
1665 is in the file area instead of the party line
1666 Module: filesys
1667
1668 (4) PUB
1669 bind pub <flags> <command> <proc>
1670 procname <nick> <user@host> <handle> <channel> <text>
1671
1672 Description: used for commands given on a channel. The first word
1673 becomes the command and everything else is the text argument.
1674 Module: irc
1675
1676 (5) MSGM (stackable)
1677 bind msgm <flags> <mask> <proc>
1678 procname <nick> <user@host> <handle> <text>
1679
1680 Description: matches the entire line of text from a /msg with the
1681 mask. This is useful for binding Tcl procs to words or phrases
1682 | spoken anywhere within a line of text. If the proc returns 1,
1683 | Eggdrop will not log the message that triggered this bind.
1684 | MSGM binds are processed before MSG binds. If the exclusive-binds
1685 | setting is enabled, MSG binds will not be trigged by text that
1686 | a MSGM bind has already handled.
1687 Module: server
1688
1689 (6) PUBM (stackable)
1690 bind pubm <flags> <mask> <proc>
1691 procname <nick> <user@host> <handle> <channel> <text>
1692
1693 Description: just like MSGM, except it's triggered by things said
1694 on a channel instead of things /msg'd to the bot. The mask is
1695 matched against the channel name followed by the text and can
1696 | contain wildcards. If the proc returns 1, Eggdrop will not log
1697 | the message that triggered this bind. PUBM binds are processed
1698 | before PUB binds. If the exclusive-binds setting is enabled,
1699 | PUB binds will not be trigged by text that a PUBM bind has
1700 | already handled.
1701 Module: irc
1702
1703 (7) NOTC (stackable)
1704 bind notc <flags> <mask> <proc>
1705 procname <nick> <user@host> <handle> <text> <dest>
1706
1707 Description: dest will be a nickname (the bot's nickname,
1708 obviously) or a channel name. mask is matched against the entire
1709 notice and can contain wildcards. It is considered a breach of
1710 protocol to respond to a /notice on IRC, so this is intended for
1711 internal use (logging, etc.) only. Note that server notices do
1712 | not trigger the NOTC bind. If the proc returns 1, Eggdrop will
1713 | not log the message that triggered this bind.
1714
1715 New Tcl procs should be declared as
1716 proc notcproc {nick uhost hand text {dest ""}} {
1717 global botnick; if {$dest == ""} {set dest $botnick}
1718 ...
1719 }
1720 for compatibility.
1721 Module: server
1722
1723 (8) JOIN (stackable)
1724 bind join <flags> <mask> <proc>
1725 procname <nick> <user@host> <handle> <channel>
1726
1727 Description: triggered by someone joining the channel. The mask in
1728 the bind is matched against "#channel nick!user@host" and can
1729 contain wildcards.
1730 Module: irc
1731
1732 (9) PART (stackable)
1733 bind part <flags> <mask> <proc>
1734 procname <nick> <user@host> <handle> <channel> <msg>
1735
1736 Description: triggered by someone leaving the channel. The mask is
1737 matched against "#channel nick!user@host" and can contain
1738 wildcards. If no part message is specified, msg will be set
1739 to "".
1740
1741 New Tcl procs should be declared as
1742 proc partproc {nick uhost hand chan {msg ""}} { ... }
1743 for compatibility.
1744 Module: irc
1745
1746 (10) SIGN (stackable)
1747 bind sign <flags> <mask> <proc>
1748 procname <nick> <user@host> <handle> <channel> <reason>
1749
1750 Description: triggered by a signoff, or possibly by someone who got
1751 netsplit and never returned. The signoff message is the last
1752 argument to the proc. Wildcards can be used in the mask, which is
1753 matched against '#channel nick!user@host'.
1754 Module: irc
1755
1756 (11) TOPC (stackable)
1757 bind topc <flags> <mask> <proc>
1758 procname <nick> <user@host> <handle> <channel> <topic>
1759