This is an exhaustive list of all the Tcl commands added to eggdrop. All of the normal Tcl built-in commands are still there, of course. But you can also use these to manipulate features of the bot. They are listed according to category. NOTICE: This list is accurate for the v1.5 series of eggdrop! Scripts written for v1.3/v1.4 series of eggdrop should probably work with a few minor modifications depending on the script. SCRIPTS WHICH WERE WRITTEN FOR v0.9 OR v1.0 OR v1.1 WILL PROBABLY NOT WORK WITHOUT MODIFICATION. Commands which have been changed in the v1.5 series (or are just new commands) are marked with vertical bars on the left. ***### CORE EGGDROP COMMANDS ###*** these are commands provided in the core part of eggdrop, for module specific commands, see later. *** OUTPUT COMMANDS *** putserv sends text to the server, like 'dump' (intended for direct server commands); output is queued so that you won't flood yourself off the server returns: nothing puthelp sends text to the server like 'putserv', but uses a different queue (intended for sending messages to channels or people) returns: nothing putquick sends text to the server, like 'dump' (intended for direct server commands); output is queued so that you won't flood yourself off the server, using the MODE queue (should be alot faster) returns: nothing putkick [reason] sends kicks to the server and tries to put as many nicks into one kick command as possible. returns: nothing putlog sends text to the log for any channel, marked as 'misc' (o) returns: nothing putcmdlog sends text to the log for any channel, marked as 'command' (c) returns: nothing putxferlog sends text to the log for any channel, marked as 'file-area' (x) returns: nothing putloglev sends text to the log, tagged with all of the valid levels given (use "*" to indicate all log levels) returns: nothing dumpfile dumps out a file from the help/text directory to a user on IRC via msg (one line per msg); the user has no flags, so the flag bindings wont work within the file. queuesize [queue] returns: the number of msgs in all queues. If a queue is specified, only the size of this queue is returned. valid queues are: mode, server, help, or all. clearqueue returns: number of deleted lines from the specified queue *** USER RECORD MANIPULATION COMMANDS *** countusers returns: number of users in the bot's database validuser returns: "1" if a user by that name exists; '0' otherwise finduser finds the user record which most closely matches the given user@host returns: the handle found, or "*" if none userlist [flags] returns: a list of the handles of users on the bot you can use the new flag matching system here, usage: [global]{&/|}[chan]{&/|}[bot] matchs the flags relvantly, (chan matches vs anywhere), & specifies and when match, | specifies or, only the first of these is relevant the default is or. passwdok checks the password given against the user's password check against the password "" (a blank string) or "-" to find out if a user has no password set. returns: "1" if password matches for that user; "0" if not getuser [extra info] this is a generic interface to the new generic userfile support, it return info specific to each entry-type, valid entry types are: BOTFL - returns the current bot-specific flags for the user (if it's a bot :) BOTADDR - (another bot-only thing :) returns a list containing the bots address, the bots telnet port, and it's relay port. HOSTS - returns a list of the host for the user LASTON - returns a list containing the unixtime last seen, and the last seen place. OR LASTON #channel returns the time last seen on the channel or 0 if no info INFO - returns the user's global info line XTRA - returns the old xtra info COMMENT - returns the master-visible only comment for the user EMAIL - returns the users email address URL - returns the users url address HANDLE - returns the users handle as it is saved in the userfile setuser [extra info] this is the counterpart of getuser, it lets you set the various values extra ones not supported about : PASS - use this to set a users password (no 3rd arg will clear it) HOSTS - for setting hosts, no extra info = clear, otherwise *1* hostmask is added :P LASTON - 2 forms: setuser laston sets global laston time setuser laston sets global laston time, leaving the place field empty setuser laston will set a users laston time in a channel record (if it already exists) chnick changes a user's handle returns: "1" on success; "0" if the handle is already used, the handle is invalid, or the user can't be found chattr [changes [channel]] changes the attributes for a user record, if you include any -- changes are of the form "+f", "-o", "+dk", "-o+d", etc; if a channel is specified, the channel-specific flags for that channel are altered you can now use the +o|-o #channel format here too. returns: new flags for the user (if you made no changes, returns current flags); if a channel was specified, the global AND the channel-specific flags for that channel are returned in the format of the new flagging system (globalflags|channelflags) -- returns "*" if that user does not exist botattr [changes [channel]] similar to chattr except for bot attributes rather than normal user attributes, this includes the channel-specific +s share flag matchattr [channel] returns: "1" if the specified user has the matching flags. (using the new matching system) adduser creates a new user entry with the handle and hostmask given (with no pass- word, and the default flags) returns: "1" if successful, "0" if it already existed addbot
creates a new bot entry with the handle and bot linking address given (with no password and no flags) returns: "1" if successful, "0" if it already existed deluser attempts to erase a user record with that handle returns: "1" if successful, "0" if no such user exists delhost deletes a hostmask from a user's hostmask list returns: "1" on success, "0" if that hostmask wasn't in the list or the user does not exist addchanrec add a channel record for the user returns: "1" on success, "0" if the user does not exist or if there isn't such a channel delchanrec removes a channel record for the user; this includes all associated channel flags returns: "1" on success, "0" if the user does not exist or if there isn't such a channel getchaninfo returns: info line for a specific channel (behaves just like 'getinfo') setchaninfo sets the info line on a specific channel for a user if info is "none" it will be removed. returns: nothing newchanban [lifetime] [options] adds a ban to the enforced ban list of a channel; creator is given credit for the ban in the ban list; lifetime is specified in minutes; if lifetime is not specified, ban-time (usually 60) is used; setting the lifetime to 0 makes it a permanent ban; valid options are: sticky forces the ban to be always active on a channel, even with dynamic bans on none (no effect) returns: nothing newban [lifetime] [options] adds a ban to the global ban list (which takes effect on all channels); other arguments work exactly like newchanban returns: nothing newchanexempt [lifetime] [options] adds a exempt to the enforced exempt list of a channel; creator is given credit for the exempt in the exempt list; lifetime is specified in minutes; if lifetime is not specified, exempt-time (usually 60) is used; setting the lifetime to 0 makes it a permanent exempt; valid options are: sticky forces the exempt to be always active on a channel, even with dynamicexempts on none (no effect) returns: nothing N.B. The exempt will not be removed until the corresponding ban has been removed. For timed bans once the time period has expired the exempt will not be removed until the corresponding ban has either expired or removed newexempt [lifetime] [options] adds a exempt to the global exempt list (which takes effect on all channels); other arguments work exactly like newchanexempt returns: nothing newchaninvite [lifetime] [options] adds a invite to the enforced invite list of a channel; creator is given credit for the invite in the invite list; lifetime is specified in minutes; if lifetime is not specified, invite-time (usually 60) is used; setting the lifetime to 0 makes it a permanent invite; valid options are: sticky forces the invite to be always active on a channel, even with dynamicinvites on none (no effect) returns: nothing N.B. The invite will not be removed until the channel has gone -i. newinvite [lifetime] [options] adds a invite to the global invite list (which takes effect on all channels); other arguments work exactly like newchaninvite returns: nothing stick [channel] makes a ban sticky, or if a channel is specified, then it is set sticky on that channel. returns: "1" is successful, "0" otherwise unstick [channel] makes a ban no longer sticky, or if a channel is specified, then it is unstuck on that channel. returns: "1" is successful, "0" otherwise | stickexempt [channel] | makes an exempt sticky, or if a channel is specified, then it is set | sticky on that channel. returns: "1" is successful, "0" otherwise | unstickexempt [channel] | makes an exempt no longer sticky, or if a channel is specified, then it | is unstuck on that channel. returns: "1" is successful, "0" otherwise | stickinvite [channel] | makes an invite sticky, or if a channel is specified, then it is set | sticky on that channel. returns: "1" is successful, "0" otherwise | unstickinvite [channel] | makes an invite no longer sticky, or if a channel is specified, then it | is unstuck on that channel. returns: "1" is successful, "0" otherwise killchanban removes a ban from the enforced ban list for a channel returns: "1" if successful, "0" otherwise killban removes a ban from the global ban list returns: "1" if successful, "0" otherwise killchanexempt removes a exempt from the enforced exempt list for a channel returns: "1" if successful, "0" otherwise killexempt removes a exempt from the global exempt list returns: "1" if successful, "0" otherwise killchaninvite removes a invite from the enforced invite list for a channel returns: "1" if successful, "0" otherwise killinvite removes a invite from the global invite list returns: "1" if successful, "0" otherwise ischanjuped [channel] returns: "1" if the channel is juped and bot is unable to join, "0" otherwise isban [channel] returns: "1" if that ban is in the global ban list, "0" otherwise; if a channel is specified, that channel's ban list is checked too ispermban [channel] returns: "1" if that ban is in the global ban list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's ban list is checked too isexempt [channel] returns: "1" if that exempt is in the global exempt list, "0" otherwise; if a channel is specified, that channel's exempt list is checked too ispermexempt [channel] returns: "1" if that exempt is in the global exempt list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's exempt list is checked too isinvite [channel] returns: "1" if that invite is in the global invite list, "0" otherwise; if a channel is specified, that channel's invite list is checked too isperminvite [channel] returns: "1" if that invite is in the global invite list AND is marked as permanent, "0" otherwise; if a channel is specified, that channel's invite list is checked too isbansticky [channel] returns: "1" if that ban is a sticky ban in the global ban list, "0" otherwise; if a channel is specified, that channel's ban list is checked too isexemptsticky [channel] returns: "1" if that exempt is a sticky exempt in the global exempt list, "0" otherwise; if a channel is specified, that channel's exempt list is checked too isinvitesticky [channel] returns: "1" if that invite is a sticky invite in the global invite list, "0" otherwise; if a channel is specified, that channel's invite list is checked too matchban [channel] returns: "1" if that user address matches a ban in the global ban list, "0" otherwise; if a channel is specified, that channel's ban list is checked too matchexempt [channel] returns: "1" if that user address matches a exempt in the global exempt list, "0" otherwise; if a channel is specified, that channel's exempt list is checked too matchinvite [channel] returns: "1" if that user address matches a invite in the global invite list, "0" otherwise; if a channel is specified, that channel's invite list is checked too banlist [channel] returns: list of global bans, or (if a channel is specified) list of channel-specific bans; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format) exemptlist [channel] returns: list of global exempts, or (if a channel is specified) list of channel-specific exempts; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format) invitelist [channel] returns: list of global invites, or (if a channel is specified) list of channel-specific invites; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, last time active, and creator (the three timestamps are in unixtime format) newignore [lifetime] adds an entry to the ignore list; creator is given credit for the ignore; lifetime is how many minutes until the ignore expires and is removed; if lifetime is not specified, ignore-time (usually 60) is used; setting the lifetime to 0 makes it a permanent ignore returns: nothing killignore removes an entry from the ignore list returns: "1" if successful, "0" otherwise ignorelist returns: list of ignores; each entry is itself a list, containing: hostmask, comment, expiration timestamp, time added, and creator (the three timestamps are in unixtime format) isignore returns: "1" if the ignore is in the list, "0" otherwise save writes the userfile to disk returns: nothing reload loads the userfile from disk (replacing whatever's in memory) returns: nothing backup makes a simple backup of the userfile that's on disk returns: nothing getting-users returns: "1" if the bot is currently downloading a userfile from a sharebot (and hence, user records are about to drastically change), "0" if not *** CHANNEL COMMANDS *** channel add adds a channel record for the bot to monitor; the full list of possible options is given in the "eggdrop.conf.dist" sample config file; note that the channel options must be in a list (enclosed in {}) returns: nothing channel set sets options for the channel specified; the full list of possible options is given in the "eggdrop.conf" sample config file returns: nothing channel info returns: list of info about that channel record: enforced mode, idle kick limit, need-op script, need-invite script, and then various +/- options as seen in the config file channel remove destroys a channel record for the bot and makes the bot no longer monitor that channel returns: nothing savechannels saves the channel settings to the channel-file if one is defined. returns: nothing loadchannels reloads the channel settings from the channel-file if one is defined. returns: nothing channels returns: list of the channels the bot is monitoring (or trying to) isbotnick returns: "1" if the nick matches the botnick; "0" otherwise botisop returns: "1" if the bot is an op on that channel; "0" otherwise botisvoice returns: "1" if the bot is has a voice on that channel; "0" otherwise botonchan returns: "1" if the bot is on that channel; "0" otherwise isop returns: "1" if someone by that nickname is on the channel and has chop; "0" otherwise | wasop | returns: "1" if someone that just got opped/deopped in the chan had op | before the modechange; "0" otherwise isvoice returns: "1" if someone by that nickname is on the channel and has voice (+v); "0" otherwise onchan returns: "1" if someone by that nickname is on the bot's channel; "0" otherwise nick2hand [channel] returns: handle of on if is not specified, bot will check all of its channels if not found, returns "" if found but unknown, returns "*" handonchan returns: "1" if the the user@host for someone on the channel matches for the handle given; "0" otherwise hand2nick [channel] returns: nickname of the first person on the whose user@host matches that handle, if there is one; "" otherwise if is not specified, bot will check all of its channels ischanban returns: "1" if that is a ban on the bot's channel ischanexempt returns: "1" if that is an exemption (+e mode) on the bot's channel. this is only useful on networks that support +e ischaninvite returns: "1" if that is an invitation (+I mode) on the bot's channel. this is only useful on networks that support +I chanbans returns: a list of the current bans on the channel, each element is of the form {ban bywho age} age is seconds from the bots POV chanexempts returns: a list of the current exemptions (+e mode) on the channel, each element is of the form {exemption bywho age} age is seconds from the bots POV. this is only useful on networks that support +e chaninvites returns: a list of the current invitations (+I modes) on the channel, each element is of the form {invitation bywho age} age is seconds from the bots POV. this is only useful on networks that support +I resetbans removes all bans on the channel that aren't in the bot's ban list, and refreshes any bans that should be on the channel but aren't returns: nothing resetexempts removes all exemptions on the channel. this is an IRCNET feature. resetinvites removes all invitations on the channel. this is an IRCNET feature. resetchan rereads in the channel info from the server returns: nothing getchanhost [channel] returns: user@host of if is not specified, bot will check all of its channels if is not on the channel(s), returns "" getchanjoin returns: timestamp of when that person joined the channel onchansplit returns: "1" if that nick is split from the channel; "0" otherwise chanlist [flags[&chanflags]] flags are any flags that are global flags, the '&' denotes to look for channel specific flags. Examples: n (Botowner) &n (Channel owner) o&m (Global op, Channel master) now you can use even more complex matching of flags, including +&- flags and & or | (and or or) matching returns: list of nicknames currently on the bot's channel that have all of the flags specified; if no flags are given, all of the nicknames are returned getchanidle returns: number of minutes that person has been idle; "0" if the speci- fied user isn't even on the channel getchanmode returns: string of the type "+ntik key" for the channel specified jump [server [port [password]]] jumps to the server specified, or (if none is specified) the next server in the list returns: nothing pushmode [arg] sends out a channel mode change (ex: pushmode #lame +o goober) through the bot's queueing system; all the mode changes will be sent out at once (combined into one line as much as possible) after the script finishes, or when 'flushmode' is called flushmode forces all previously pushed channel mode changes to go out right now, instead of when the script is done (just for the channel specified) topic returns: string of the current topic on the specified channel validchan checks if the bot is monitoring that channel returns: 1 if the channel exists, 0 if not isdynamic returns: 1 if the channel is an existing dynamic channel, 0 if not setudef initializes a user defined channel flag or integer setting. You can use it like any other flag/setting. IMPORTANT: Don't forget to reinitialize your flags/settings after a restart, or it'll be lost. renudef renames a user defined channel flag or integer setting. deludef deletes a user defined channel flag or integer setting. *** DCC COMMANDS *** putdcc sends text to the dcc user indicated returns: nothing dccbroadcast sends your message to everyone on the party line on the bot net, in the form "*** " for local users, and "*** [Bot] " for users on other bots dccputchan sends your message to everyone on a certain channel on the bot net, in a form exactly like dccbroadcast does -- valid channels are 0 thru 99999 returns: nothing boot [reason] boot's a user from the partyline returns: nothing restart rehash's the bot and kills all timers note that as this will also unload and reload all the modules, your bot will also jump servers. returns: nothing rehash rehash's the bot returns: nothing dccsimul simulates text typed in by the dcc user specified -- note that in v0.9, this only simulated commands; now a command must be preceded by a '.' to be simulated returns: nothing hand2idx returns: the idx (a number greater than or equal to zero) for the user given, if she is on the party line in chat mode (even if she is currently on a channel or in chat off), the file area, or in the control of a script; "-1" otherwise -- if the user is on multiple times, the oldest idx is returned idx2hand returns: handle of the user with that idx valididx returns: "1" if the idx currently exists; "0" if not getchan returns: the current party line channel for a user on the party line -- "0" indicates he's on the group party line, "-1" means he has chat off, and a value from 1 to 99999 is a private channel setchan sets a party line user's channel rather suddenly (the party line user is not notified that she is now on a new channel); a channel name can be used (provided it exists) returns: nothing console [channel] [console-modes] changes a dcc user's console mode, either to an absolute mode (like "mpj") or just adding/removing flags (like "+pj" or "-moc" or "+mp-c"); the user's console channel view can be changed also (as long as the new channel is defined in the bot) returns: a list containing the user's (new) channel view, and (new) console mode, or nothing if that user isn't currently in dcc chat echo [status] turns a user's echo on or off; the status has to be a 1 or 0 returns: new value of echo for that user (or the current value, if status was omitted) putbot sends a message across the bot-net to another bot; if no script intercepts the message on the other end, the message just vanishes returns: nothing putallbots broadcasts a message across the bot-net to all currently connected bots returns: nothing killdcc kills a party-line or file area connection, rather abruptly returns: nothing bots returns: list of the bots currently connected to the botnet botlist returns: a list of bots currently on the botnet; each item in the list will be a sublist with four elements: bot, uplink, version, sharing status. bot : the bot's nickname uptlink: who the bot is connected through version: its current numeric version sharing: a "+" if the bot is sharing, "-" otherwise/ islinked returns: "1" if the bot is currently linked, "0" otherwise dccused returns: number of dcc connections currently in use dcclist ?type? returns: a list of active connections, each item in the list will be a sublist of six elements: { {} } the types are: chat, bot, files, file_receiving, file_sending, file_send_pending, script, socket (these are connections that have not yet been put under 'control'), telnet, and server. whom returns: list of people on the botnet who are on that channel (0 is the default party line); each item in the list will be a sublist with six elements: nickname, bot, hostname, access flag ('-', '@', '+', or '*'), minutes idle, and away message (blank if the user is not away) if you specify a channel of * every user on the botnet is returned with an extra argument indicating the channel the user is on getdccidle returns: number of seconds the dcc chat/file system/script user has been idle getdccaway returns: away message for a dcc chat user (or "" if the user is not set away) setdccaway sets a party line user's away message and marks them away; if set to "", the user is marked un-away returns: nothing connect makes an outgoing connection attempt and creates a dcc entry for it; a 'control' command should be used immediately after a successful 'connect' so no input is lost returns: idx of the new connection listen [options] [flag] opens a listening port to accept incoming telnets; type must be one of "bots", "all", "users", "script", or "off": listen bots [mask] accepts connections from bots only; the optional mask is used to identify permitted bot names; if the mask begins with '@' it is interpreted to be a mask of permitted hosts to accept connections from returns: port # listen users [mask] accepts connections from users only (no bots); the optional mask is used to identify permitted nicknames; if the mask begins with '@' it is interpreted to be a mask of permitted hosts to accept connections from returns: port # listen all [mask] accepts connections from anyone; the optional mask is used to identify permitted nicknames/botnames; if the mask begins with '@' it is interpreted to be a mask of permitted hosts to accept connections from returns: port # listen script [flag] accepts connections which are immediately routed to a proc; the proc is called with one parameter: the idx of the new connection flag may currently only be 'pub', which makes the bot allow anyone to connect. returns: port # listen off stop listening at a port returns: nothing dccdumpfile dumps out a file from the text directory to a dcc chat user; the flag matching that's used everywhere else works here too *** MISCELLANEOUS COMMANDS *** bind [proc-name] adds a new keyword command to the bot; valid types are listed below; the are the flags that a user must have to trigger this command; the for each type is listed below; is the name of the Tcl procedure to call for this command (see below for the format of the procedure call); if the proc-name is omitted, no binding is added -- instead, the current binding is returned (if it's stackable, a list of the current bindings is returned) yes, you can use the new flag binding method here too, and this is where it becomes truely phearfull since you may never need to check attr's inside functions again...imagine: bind pub -o&+o command command_proc to only allow channel-spec ops to use it! no problem! works fine! returns: name of the command that was added, or (if proc-name was omitted), a list of the current bindings for this command unbind removes a previously-made binding returns: name of the command that was removed logfile [ ] creates a new logfile, which will log the modes given for the channel listed -- or, if no logfile is specified, just returns a list of logfiles; "*" can be used to mean all channels; you can also change the modes and channel of an existing logfile with this command -- entering a blank mode and channel makes the bot stop logging there returns: filename of logfile created, or (if no logfile is specified) a list of logfiles like: "{mco * eggdrop.log} {jp #lame lame.log}" maskhost returns: hostmask for the string given ("n!u@1.2.3.4" -> "*!u@1.2.3.*", "n!u@lame.com" -> "*!u@lame.com", "n!u@a.b.edu" -> "*!u@*.b.edu") timer executes the tcl command after a certain number of minutes have passed returns: a timerID utimer executes the tcl command after a certain number of seconds have passed returns: a timerID timers returns: list of active minutely timers; each entry in the list contains the number of minutes left till activation, the command that will be executed, and the timerID utimers returns: list of active secondly timers, identical in format to the output from 'timers' killtimer removes a minutely timer from the list returns: nothing killutimer removes a secondly timer from the list returns: nothing unixtime returns: a long integer which is the current time according to unix duration returns: the number of seconds converted into years, weeks, days, hours, minutes, and seconds (ie: 804600secs is turned into 1wk 2days 7hrs 30mins). strftime [time] returns: a formatted string of time using standard strftime format, uses the value of time, or now if no time specified ctime returns: a string of the date/time represented by the unix time given (ie "Fri Aug 3 11:34:55 1973") myip returns: a long number representing the bot's IP address, as it might appear in (for example) a DCC request rand returns: a random integer between 0 and limit-1 control removes a user from the party line and sends all future input from them to the Tcl command given; the command will be called with two parameters: the idx of the user, and the input text; the command should return "0" to indicate success and "1" to indicate that it relinquishes control of the user back to the bot; the idx must be for a user in the party line area or the file area; if the input text is blank (""), it indicates that the dcc user has dropped connection. Also, if the input text is blank, never call killdcc on it, it will fail with 'invalid idx'. returns: nothing sendnote simulates what happens when one user sends a note to another (this can also do cross-bot notes) returns: "1" if the note was delivered locally or sent to another bot, "2" if the note was stored locally, "3" if the user's notebox is too full to store a note, "4" if a Tcl binding caught the note, "5" if the note was stored because the user is away, or "0" if the send failed link [via-bot] attempts to link to another bot directly (or, if you give a via-bot, it tells the via-bot to try returns: "1" if it looks okay and it will try; "0" if not unlink attempts to remove a bot from the botnet returns: "1" if it will try or has passed the request on; "0" if not encrypt returns: encrypted string (using blowfish), encoded into ascii using base-64 so it can be sent over the botnet decrypt returns: decrypted string (using blowfish) encpass returns: encrypted string (using blowfish) die [reason] causes the bot to log a fatal error and exit completely; if no reason is given, "EXIT" is used unames returns: The current operating system the bot is using. | dnslookup [[arg1] [arg2] ... [argn]] | Issues an asynchronous dns lookup request. The command will block if | dns module is not loaded, otherwise it will either return immediately | or immediately call the proc (e.g. if the lookup is already cached). | As soon as the request completes, will be called as follows: | ipaddress hostname status [[arg1] [arg2] ... [argn]] | status is 1 if the lookup was successful and 0 if it wasn't. All | additional parameters (called arg1, arg2 and argn above) get appended | to the proc's other parameters. GLOBAL VARIABLES: (All config-file variables are global, too. But these variables are set by the bot.) botnick current nickname the bot is using, ie 'Valis' or 'Valis0', etc botname current nick!user@host that the server sees, ie 'Valis!valis@crappy.com' server current server the bot is using, ie 'irc.math.ufl.edu:6667' version current bot version (ie: "1.1.2+pl1 1010201 pl1"); first item is the text version, second item is a numerical version, and any following items are the names of patches that have been added numversion current numeric bot version (ie: "1010201"); Numerical version is "MNNRRPP" where: M is the Major release number NN is the Minor release number RR is the sub-release number PP is the patch level for that sub-release uptime unixtime value for when the bot was started server-online unixtime value for when the bot connected to its current server lastbind The last command binding which triggered. This allows you to identify which command triggered a tcl routine. | md5 | returns: the 128 bits MD5 "message-digest" of the specified string. COMMAND EXTENSION: You can use the 'bind' command to attach Tcl procedures to certain events. For example, you can write a Tcl procedure that gets called every time a user says "danger" on the channel. The following is a list of the types of bindings, and how they work. Under each binding type is the format of the bind command, the list of arguments sent to the Tcl proc, and an explanation. Some bindings are marked as "stackable". That means that you can bind multiple commands to the same trigger. Normally, for example, a binding of "bind msg - stop msg_stop" (which makes a msg-command "stop" call the Tcl proc "msg_stop") will overwrite any previous binding you had for the msg-command "stop". With stackable bindings, like 'msgm' for example, you can bind to the same command or mask again and again. When the binding is triggered, ALL the Tcl procs that are bound to it will be called, one after another. To remove a binding, use "unbind". For example, to remove that binding for the msg-command "stop", use "unbind msg - stop msg_stop". (1) MSG bind msg procname used for /msg commands; the first word of the user's msg is the command, and everything else becomes the argument string (2) DCC bind dcc procname used for commands from a dcc chat on the party line; as in MSG, the command is the first word and everything else is the argument string; the idx is valid until the user disconnects; after that it may be reused, to be careful about storing an idx for long periods of time (3) FIL bind fil procname the same as DCC, except this is triggered if the user is in the file area instead of the party line (THIS IS ONLY AVALIABLE WHEN THE filesys.so MODULE IS LOADED) (4) PUB bind pub procname used for commands given on a channel; just like MSG, the first word becomes the command and everything else is the argument string (5) MSGM (stackable) bind msgm procname matches the entire line of text from a /msg with the mask; this is more useful for binding Tcl procs to words or phrases spoken anywhere within a line of text (6) PUBM (stackable) bind pubm procname just like MSGM, except it's triggered by things said on a channel instead of things /msg'd to the bot; the mask is matched against the channel name followed by the text, ie, "#nowhere hello there!", and can contain wildcards (7) NOTC (stackable) bind notc | procname | destination will be a nickname (the bot's nickname, obviously) or | a channel name; matches the entire line of text from a /notice with the mask; it is considered a breach of protocol to respond to a /notice on IRC, so this is intended for internal use (ie, logging, etc) only (8) JOIN (stackable) bind join procname triggered by someone joining the channel; the in the bind is matched against "#channel nick!user@host" and can contain wildcards (9) PART (stackable) bind part | procname triggered by someone leaving the channel; as in JOIN, the is matched against "#channel nick!user@host" and can contain wildcards. if no part message is specified msg will be set to "". (10) SIGN (stackable) bind sign procname triggered by a signoff, or possibly by someone who got netsplit and never returned; the signoff message is the last argument to the proc; wildcards can be used in , which contains the channel name (11) TOPC (stackable) bind topc procname triggered by a topic change; can use wildcards in , which is matched against the channel name and new topic (12) KICK (stackable) bind kick procname triggered when someone is kicked off the channel; the is matched against "#channel target" where the target is the nickname of the person who got kicked off (can use wildcards); the proc is called with the nick, user@host, and handle of the kicker, plus the channel, the nickname of the person who was kicked, and the reason; is unused here (13) NICK (stackable) bind nick procname triggered when someone changes nicknames; wildcards are allowed; the mask is matched against "#channel newnick" (14) MODE (stackable) bind mode proc-name mode changes are broken down into their component parts before being sent here, so the will always be a single mode, like "+m" or "-o" and victim will show the value of the mode change (for o/v/b) otherwise ""; flags are ignored; the bot's automatic response to a mode change will happen AFTER all matching Tcl procs are called; the will have the channel prefixed (ie, "#turtle +m") if it is a server mode will be "", is the server address and handle is * note that "victim" was added in 1.3.23 and that this will break tcl scripts that were written for pre-1.3.23 versions and use this binding. An easy fix (by guppy) is as follows (example): Old script looks as follows: bind mode - * mode_proc proc mode_proc {nick uhost hand chan mc} { ... } To make it work with 1.3.23+ and stay compatible with older bots, do: bind mode - * mode_proc_fix proc mode_proc_fix {nick uhost hand chan mc {victim ""}} { if {$victim != ""} { append mc " $victim" } mode_proc $nick $uhost $hand $chan $mc } proc mode_proc {nick uhost hand chan mc} { ... } (15) CTCP bind ctcp proc-name destination will be a nickname (the bot's nickname, obviously) or a channel name; keyword is the ctcp command and arg may be empty; if the proc returns 0, the bot will attempt its own processing of the ctcp command (16) CTCR bind ctcr proc-name just like ctcp, but this is triggered for a ctcp-reply (ie, ctcp embedded in a notice instead of a privmsg) (17) RAW (stackable) bind raw procname previous versions of eggdrop required a special compile option to enable this binding, but it's now standard; the mask is checked against the keyword (either a numeric like "368" or a keyword like "PRIVMSG"); from will be the server name or the source user (depending on the keyword); flags are ignored; the order of the arguments is identical to the order that the IRC server sends to the bot -- the pre-processing only splits it apart enough to determine the keyword; if the proc returns 1, eggdrop will not process the line any further (THIS COULD CAUSE YOUR BOT TO BEHAVE ODDLY IN SOME CASES) (18) BOT bind bot proc-name triggered by a message coming from another bot in the botnet; works similar to a DCC binding; the first word is the command and the rest becomes the argument string; flags are ignored (19) CHON (stackable) bind chon proc-name when someone first enters the "party-line" area of the bot via dcc chat or telnet, this is triggered before they are connected to a chat channel (so yes, you can change the channel in a 'chon' proc); mask matches against handle; this is NOT triggered when someone returns from the file area, etc (20) CHOF (stackable) bind chof proc-name triggered when someone leaves the party line to disconnect from the bot; mask matches against the handle; note that the connection may have already been dropped by the user, so don't send output to that idx (21) SENT (stackable) bind sent proc-name after a user has successfully downloaded a file from the bot, this binding is triggered; mask is matched against the handle of the user that initiated the transfer; nick is the actual recipient (on IRC) of the file; the path is relative to the dcc directory (unless the file transfer was started by a script call to 'dccsend', in which case the path is the exact path given in the call to 'dccsend') (THIS IS ONLY AVALIABLE WHEN THE transfer.so MODULE IS LOADED) (22) RCVD (stackable) bind rcvd proc-name triggered after a user uploads a file successfully; mask is matched against the user's handle; nick is the nickname on IRC that the file transfer originated from; the path is where the file ended up, relative to the dcc directory (usually this is your incoming dir) (THIS IS ONLY AVALIABLE WHEN THE transfer.so MODULE IS LOADED) (23) CHAT (stackable) bind chat proc-name when someone says something on the botnet, it invokes this binding; flags are ignored; handle could be a user on this bot (ie "DronePup") or on another bot (ie "Eden@Wilde") and therefore you can't rely on a local user record; the mask is checked against the text (24) LINK (stackable) bind link proc-name triggered when a bot links into the botnet; botname is the botnetnick of the bot that just linked in; via is the bot it linked through; the mask is checked against the bot that linked; flags are ignored (25) DISC (stackable) bind disc proc-name triggered when a bot disconnects from the botnet for whatever reason; just like the link bind, flags are ignored; mask is checked against the botnetnick of the bot that left (26) SPLT (stackable) bind splt procname triggered when someone gets netsplit on the channel; be aware that this may be a false alarm (it's easy to fake a netsplit signoff message); may contain wildcards, and is matched against the channel and nick!user@host just like join; anyone who is SPLT will trigger a REJN or SIGN within the next 15 minutes (27) REJN (stackable) bind rejn procname someone who was split has rejoined; can contain wildcards, and contains channel and nick!user@host just like join (28) FILT (stackable) bind filt procname DCC party line and file system users have their text sent through filt before being processed; if the proc a blank string, the text is considered parsed; otherwise the bot will use the text returned from the proc and continue parsing that (29) FLUD (stackable) bind flud procname any floods detected through the flood control settings (like 'flood-ctcp') are sent here before processing; if the proc returns 1, no further action is taken on the flood; if the proc returns 0, the bot will do its normal "punishment" for the flood; the flood type is "pub", "msg", "join", or "ctcp" (and can be masked to "*" for the bind); flags are ignored (30) NOTE bind note procname incoming notes (either from the party line, someone on IRC, or someone on another bot on the botnet) are checked against these binds before being process; if a bind exists, the bot will not deliver the note; the handle must be an exact match (no wild- cards), but it is not case sensitive; flags are ignored (31) ACT (stackable) bind act proc-name when someone does an action on the botnet, it invokes this binding; flags are ignored; the mask is checked against the text of the action (this is very similar to the CHAT binding) (32) WALL (stackable) bind wall proc-name when the bot receives a wallops, it invokes this binding; flags are ignored; the mask is checked against the text of the wallops msg (33) BCST (stackable) bind bcst proc-name when a bot says something on the botnet, it invokes this binding; flags are ignored; the mask is checked against the text (34) CHJN (stackable) bind chjn proc-name when someone joins a botnet channel, it invokes this binding; flags are ignored; the mask is checked against the text (35) CHPT (stackable) bind chpt proc-name when someone parts a botnet channel, it invokes this binding; flags are ignored; the mask is checked against the channel (36) TIME (stackable) bind time - proc-name allows you to schedule procedure calls at certain times, mask matches 5 space seperated integers of the form: "min hour day month year" min, hour, day, month have a zero padding so they are exactly two characters long, year is extended to four characters in the same way if needed ;) (37) AWAY (stackable) bind away - proc-name triggers when a user goes away or comes back on the botnet, text is the reason than has been specified (text == "" when returning) (38) LOAD (stackable) bind load - proc-name triggers when a module is loaded. (38) UNLD (stackable) bind unld - proc-name triggers when a module is unloaded. (39) NKCH (stackable) bind nkch - proc-name triggered whenever a local users handle is changed (in the userfile) (40) EVNT (stackable) bind evnt - proc-name triggered whenever one of these events happens. valid events are: sighup (called on a kill -HUP ) sigterm (called on a kill -TERM ) sigill (called on a kill -ILL ) sigquit (called on a kill -QUIT ) save (called when the userfile is saved) rehash (called just after a rehash) prerehash (called just before a rehash) logfile (called when the logs are switched daily) (A) RETURN VALUES Several bindings pay attention to the value you return from the proc (using "return $value"). Usually they expect a 0 or 1, and failing to return any value is interpreted as a 0. Here's a list of the bindings that use the return value from procs they trigger: MSG Return 1 to make the command get logged like so: (nick!user@host) !handle! command DCC Return 1 to make the command get logged like so: #handle# command FIL Return 1 to make the command get logged like so: #handle# files: command PUB Return 1 to make the command get logged like so: <> !handle! command CTCP Return 1 to ask the bot not to process the CTCP command on its own. Otherwise it would send its own response to the CTCP (possibly an error message if it doesn't know how to deal with it). FILT Return 1 to indicate the text has been processed, and the bot should just ignore it. Otherwise it will treat the text like any other. FLUD Return 1 to ask the bot not to take action on the flood. Otherwise it will do its normal punishment. RAW Return 1 to ask the bot not to process the server text. This can affect the bot's performance (by causing it to miss things that it would normally act on) -- you have been warned. CHON Return 1 to ask the bot not to process the partyline join event CHOF Return 1 to ask the bot not to process the partyline part event WALL Return 1 to make the command get logged liked so: !nick! msg (B) CONTROL PROCEDURES Using the 'control' command you can put a DCC connection (or outgoing TCP connection) in control of a script. All text that comes in on the connection is sent to the proc you specify. All outgoing text should be sent with 'putdcc'. The control procedure is called with these parameters: procname This allows you to use the same proc for several connections. The idx will stay the same until the connection is dropped -- after that, it will probably get reused for a later connection. To indicate that the connection has closed, your control procedure will be called with blank text (the input-text will be ""). This is the only time it will ever be called with "" as the text, and it is the last time your proc will be called for that connection. Dont call killdcc on the idx when text is blank, it will always fail with 'invalid idx'. If you want to hand control of your connection back to eggdrop, your proc should return 1. Otherwise, return 0 to retain control. (C) TCP CONNECTIONS Eggdrop allows you to make two types of TCP ("telnet") connections: outgoing and incoming. For an outgoing connection, you specify the remote host and port to connect to. For an incoming connection, you specify a port to listen at. All of the connections are *event driven*. This means that the bot will trigger your procs when something happens on the connection, and your proc is expected to return as soon as possible. Waiting in a proc for more input is a no-no. To initiate an outgoing connection, use: set idx [connect "hostname.goes.here" 3333] (as an example). $idx now contains a new DCC entry for the outgoing connection. All connections use non-blocking (commonly called "asynchronous", which is a misnomer) I/O. Without going into a big song and dance about asynchronous I/O, what this means to you is: * assume the connection succeeded immediately * if the connection failed, an EOF will arrive for that idx The only time a 'connect' call will return an error is if you gave a hostname and it couldn't find the IP for that hostname (this is considered a "DNS error"). Otherwise it will appear to have succeeded, and if the connection failed, you will immediately get an EOF. Right after doing a 'connect' call, you should set up a 'control' for the new idx (see the section above). From then on, the connection will act just like a normal DCC connection that has been put under the control of a script. If you ever return "1" from the control proc (indicating that you want control to return to eggdrop), the bot will just close the connection and dispose of it. Other commands that work on normal DCC connections, like 'killdcc' and 'putdcc', will work on this idx too. 'killdcc' will fail with 'invalid idx' if you attempt to use it on a closed socket, ie when text is blank. To create a listening port, use: listen 6667 script grabproc which will create a new listening port at 6667, and assign it to the script 'grabproc'. When a new connection arrives, eggdrop will connect it up and create a new idx for the connection. That idx is sent to 'grabproc'. The proc will generally want to immediately put this idx under control: proc grabproc {newidx} { control $newidx my_control } Once your grabproc has been called, the idx behaves exactly like an outgoing connection would. The best way to learn how to use these commands is to find a script that uses them and follow it carefully. Hopefully this has given you a good start though. (D) MATCH CHARACTERS Many of the bindings allow match characters in the arguments. Here are the four special characters: ? matches any single character * matches 0 or more characters of any type % matches 0 or more non-space characters (can be used to match a single word) ~ matches 1 or more space characters (can be used for whitespace between words) ***### NOTES MODULE COMMANDS ###*** these commands are provided by notes.so to allow you to store notes for users to read later notes [numberlist] gets info on notes stored for a user returns: (if no numbers specified) number of notes for user, -1 if no such user, -2 if notefile failure (if a note numberlist specified) a list of notes, -1 if no such user, -2 if notefile failure, 0 if no such note. Each note of the list is also a list: first element from, 2nd element timestamp, 3rd element the note itself. (ex: 'notes mynick "2-4;8;16-"') erasenotes erases some or all stored notes for a user returns: -1 if no such user, -2 if notefile failure, 0 if no such note, or number of erased notes. 'erasenote mynick "-"' erase all notes for mynick. listnotes lists existing notes according to the numberlist (ex: "2-4;8;16-") returns: -1 if no such user, -2 if notefile failure, 0 if no such note, list of existing notes. storenote stores a note for later reading, notify idx of any results (use idx == -1 for no notify). return 0 on success non-0 on failure ***### ASSOC MODULE COMMANDS ###*** assoc [name] sets the name associated with a botnet channel, if you specify one returns: current name for that channel, if any killassoc removes the name associated with a botnet channel, if any exists, use 'killassoc &' to kill all assocs. returns: nothing ***### FILE SYSTEM MODULE COMMANDS ###*** setpwd changes the directory of a file system user, in exactly the same way as a 'cd' command would (ie, the directory can be specified relative or absolute) returns: nothing getpwd returns: the current directory of a file system user getfiles returns: list of files in the directory given; the directory is relative to dcc-path getdirs returns: list of subdirectories in the directory given; the directory is relative to dcc-path dccsend attempts to start a dcc file transfer to the given nick; the filename must be specified either by full pathname or in relation to the bot's startup directory returns: "0" on success, "1" if the dcc table is full (too many con- nections), "2" if it can't open a socket for the transfer, "3" if the file doesn't exist, and "4" if the file was queued for later transfer (which means that person has too many file transfers going right now) filesend [ircnick] like dccsend, except it operates for a current filesystem user, and the filename is assumed to be a relative path from that user's current directory returns: "0" on failure; "1" on success (either an immediate send or a queued send) | fileresend [ircnick] | like filesend, only that it starts a DCC RESEND instead of a DCC SEND, | which allows people to resume aborted file transfers if their client | supports that protocol. ircII/BitchX/etc. support it, mIRC does not. | returns: "0" on failure; "1" on success (either an immediate send | or a queued send) setdesc sets the description for a file in a file system directory; the directory is relative to the dcc-path returns: nothing getdesc returns: the description for a file in the file system, if one exists setowner changes the owner for a file in the file system; the directory is relative to the dcc-path returns: nothing getowner returns: the owner of a file in the file system setlink creates or changes a linked file (a file that actually exists on another bot); the directory is relative to dcc-path returns: nothing getlink returns: the link for a linked file, if it exists getfileq returns: list of files queued by someone; each item in the list will be a sublist with two elements: nickname the file is being sent to, and the filename mkdir [required-flags] creates a directory in the files system, only users with the required flags may access returns: 0 on success 1 on can't create directory 2 on directory exists but is not a directory rmdir removes a directory from the file system. return: 0 on success, 1 on failure mv moves the file from it's source to the given destination, file can also be a mask, eg /incoming/* provided the destination is a directory returns: number of files copied on success or negative numbers to indicat errors: -1 = invalid source file, -2 = invalid desto -3 = you're trying to copy onto itself (duh!) -4 = no matchs found cp exactly the same as mv except it leaves the original file there aswell returns: same as mv getflags returns: the flags required to access this directory setflags [flags] sets the flags required to access the directory returns: 0 on success, -1 on failure