NOTICE: This list is accurate for the v2.0 series of eggdrop!
SCRIPTS WHICH WERE WRITTEN FOR EARLIER VERSIONS WILL PROBABLY NOT WORK WITHOUT MODIFICATION. ALTHOUGH SOME CAN BE MADE TO WORK USING THE COMPAT.TCL DISTRIBUTED WITH EGGDROP.
Core Eggdrop CommandsEggdrop Module Information (TCL commands, general info., etc..)Output Commands User Record Manipulation Commands Channel Commands DCC Commands Miscellaneous Commands Global Variables Command Extension Return Values Match Characters Assoc Module Blowfish Module Botnet Module Botservice Module Channels Module File System Module IRC Module Notes Module Scriptsock Module Server Module Timers Module
These are commands provided in the core part of eggdrop, for module specific commands, select the appropriate link above for the module you want information on.
putcmdlog <text>
putxferlog <text>
putloglev <level(s)> <channel> <text>
dumpfile <nick> <filename>
countusers
validuser <handle>
finduser <nick!user@host>
userlist [flags]
passwdok <handle> <pass>
getuser <handle> <entry-type> [extra info]
setuser <handle> <entry-type> [extra info]
chattr <handle> [changes [channel]]
matchattr <handle> <flags> [channel]
adduser <handle> <hostmask>
deluser <handle>
delhost <handle> <hostmask>
newignore <hostmask> <creator> <comment> [lifetime]
killignore <hostmask>
ignorelist
isignore <hostmask>
save
reload
backup
getting-users
channel add <name> <option-list>
channel set <name> <options...>
channel info <name>
channel remove <name>
savechannels
loadchannels
channels
validchan <channel>
isdynamic <channel>
putdcc <idx> <text>
dccbroadcast <message>
dccputchan <channel> <message>
restart
rehash
dccsimul <idx> <text...>
hand2idx <handle>
idx2hand <idx>
valididx <idx>
getchan <idx>
setchan <idx> <channel>
console <idx> [channel] [console-modes]
echo <idx> [status]
killdcc <idx>
dccused
dcclist
getdccidle <idx>
getdccaway <idx>
setdccaway <idx> <message>
listen <port> [mask]
dccdumpfile <idx> <filename>
bind <type> <attr(s)> <command-name> [proc-name]
unbind <type> <attr(s)> <command-name> <proc-name>
logfile [<modes> <channel> <filename>]
maskhost <nick!user@host>
unixtime
time
strftime <formatstring> [time]
date
ctime <unixtime>
myip
rand <limit>
die [reason]
unames
version
numversion
uptime
lastbind
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".
There are more bindings which are enabled from the loading of specific
modules, see the specific module information pages to see which
module provides which bindings.
DCC
BOT
CHON (stackable)
CHOF (stackable)
CHAT (stackable)
LINK (stackable)
DISC (stackable)
FILT (stackable)
ACT (stackable)
BCST (stackable)
CHJN (stackable)
CHPT (stackable)
TIME (stackable)
AWAY (stackable)
LOAD (stackable)
UNLD (stackable)
NKCH (stackable)
OUTPUT COMMANDS
sends text to the log for any channel, marked as 'command' (c)
returns: nothing
sends text to the log for any channel, marked as 'file-area' (x)
returns: nothing
sends text to the log, tagged with all of the valid levels given (use
"*" to indicate all log levels)
returns: nothing
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 won't work within the file.
USER RECORD MANIPULATION COMMANDS
returns: number of users in the bot's database
returns: "1" if a user by that name exists; '0' otherwise
finds the user record which most closely matches the given user@host
returns: the handle found, or "*" if none
returns: a list of the handles of users on the bot
you can use the new flag matching system here,
usage: [global]{&/|}[chan]{&/|}[bot]
matches the flags relevantly, (chan matches vs anywhere), & specifies
an and match, | specifies or, only the first of these is relevant,
the default is or.
checks the password given against the user's password -- if the user has
not set a password, will always return "1"; check against the password
"" (a blank string) to find out if a user has no password set
returns: "1" if password matches for that user; "0" if not
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
COMMENT - returns the master-visible only comment for the user
EMAIL - returns the users email address
URL - returns the users url address
XTRA - returns xtra info, use the form:
getuser <handle> XTRA <key>
to receive data set for a certain key
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)
chnick <old-handle> <new-handle>
HOSTS - for setting hosts, no extra info = clear, otherwise
*1* hostmask is added
LASTON - sets global laston time, will also set laston time for
any channel the user has a chanrec for (if it matches)
to prevent setting a channel time from ALSO setting the
global time use LASTON time #channel *
XTRA - in the form:
setuser <handle> XTRA <key> <data>
sets upto 500 bytes of data per key (use no data to clear)
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
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 channel-specific flags for that
channel are returned -- returns "*" if that user does not exist
returns: "1" if the specified user has the matching flags.
(using the new matching system)
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
attempts to erase a user record with that handle
returns: "1" if successful, "0" if no such user exists
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
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
removes an entry from the ignore list
returns: "1" if successful, "0" otherwise
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)
returns: "1" if the ignore is in the list, "0" otherwise
writes the userfile to disk
returns: nothing
loads the userfile from disk (replacing whatever's in memory)
returns: nothing
makes a simple backup of the userfile that's on disk
returns: nothing
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
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
sets options for the channel specified; the full list of possible
options is given in the "eggdrop.conf.dist" sample config file
returns: nothing
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
destroys a channel record for the bot and makes the bot no longer
monitor that channel
returns: nothing
saves the channel settings to the channel-file if one is defined.
returns: nothing
reloads the channel settings from the channel-file if one is defined.
returns: nothing
returns: list of the channels the bot is monitoring (or trying to)
checks if the bot is monitoring that channel
returns: 1 if the channel exists, 0 if not
returns: 1 if the channel is an existing dynamic channel, 0 if not
DCC COMMANDS
sends text to the dcc user indicated
returns: nothing
sends your message to everyone on the party line on the bot net, in the
form "*** <message>" for local users, and "*** [Bot] <message>" for
users on other bots
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
restarts the bot
returns: nothing
rehashes the bot
returns: nothing
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
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
returns: handle of the user with that idx
returns: "1" if the idx currently exists; "0" if not
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
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
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
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)
kills a party-line or file area connection, rather abruptly
returns: nothing
returns: number of dcc connections currently in use
returns: list of active dcc connections that are in the chat area, the
file area, or a script; each item in the list will be a sublist with
four elements: idx, nickname, hostname, and type; type will be "chat",
"files", "bot", "file_receiving", "file_sending", "file_send_pending",
or "script" (or "socket" for connections that haven't been put under
'control' yet) or any new dcc type that gets added.
returns: number of seconds the dcc chat/file system/script user has
been idle
returns: away message for a dcc chat user (or "" if the user is not
set away)
sets a party line user's away message and marks them away; if set to
"", the user is marked un-away
returns: nothing
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 <port> off
stop listening at a port
returns: nothing
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
adds a new keyword command to the bot; valid types are listed below; the
<attr(s)> are the flags that a user must have to trigger this command;
the <command-name> for each type is listed below; <proc-name> 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 phearful since you may never need to check
attr's inside functions again...imagine:
bind pub -o&+o command command_proc
returns: name of the command that was added, or (if proc-name was omitted),
a list of the current bindings for this command
removes a previously-made binding
returns: name of the command that was removed
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}"
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")
returns: a long integer which is the current time according to unix
returns: the current time in 24-hour format (ie "14:15")
returns: a formatted string of time using standard strftime
format, uses the value of time, or now if no time specified
returns: the current date in standard format (ie "21 Dec 1994")
returns: a string of the date/time represented by the unix time given
(i.e. "Fri Aug 3 11:34:55 1973")
returns: a long number representing the bot's IP address, as it might
appear in (for example) a DCC request
returns: a random integer between 0 and limit-1
causes the bot to log a fatal error and exit completely; if no reason
is given, "EXIT" is used
returns: the current operating system the bot is using.
GLOBAL VARIABLES:
(All config-file variables are global too, but these variables
are set by the bot.)
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
current numeric bot version (ie: "1010201");
Numerical version is "MMNNRRPP" where:
MM 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
unixtime value for when the bot was started
The last command binding which triggered. This allows you to
identify which command triggered a tcl routine.
COMMAND EXTENSION
bind dcc <flags> <command> <proc>
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, so be careful about storing an idx for long periods of time
proc-name <handle> <idx> <args>
bind bot <flags> <command> <proc>
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
proc-name <from-bot> <command> <args>
bind chon <flags> <mask> <proc>
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
proc-name <handle> <idx>
bind chof <flags> <mask> <proc>
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
proc-name <handle> <idx>
bind chat <flags> <mask> <proc>
when someone says something on the botnet, it invokes this binding;
flags is ignored; nick could be a user on this bot (i.e. "DronePup")
or on another bot (i.e. "Eden@Wilde"); the mask is checked against the
text
proc-name <nick> <channel#> <text>
bind link <flags> <mask> <proc>
triggered when a bot links into the botnet; botname is the name of
the bot that just linked in; via is the bot it linked through; the
mask is checked against the bot that linked; flags is ignored
proc-name <botname> <via>
bind disc <flags> <mask> <proc>
triggered when a bot disconnects from the botnet for whatever reason;
just like the link bind, flags are ignored; mask is checked against the
nickname of the bot that left
proc-name <botname>
bind filt <flags> <mask> <proc>
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
proc-name <idx> <text>
bind act <flags> <mask> <proc>
when someone does an action on the botnet, it invokes this binding;
flags is ignored; the mask is checked against the text of the
action (this is very similar to the CHAT binding)
proc-name <nick> <channel#> <action>
bind chat <flags> <mask> <proc>
when a bot says something on the botnet, it invokes this binding;
flags is ignored; the mask is checked against the text
proc-name <bot> <channel#> <text>
bind chat <flags> <mask> <proc>
when someone joins a botnet channel, it invokes this binding;
flags is ignored; the mask is checked against the text
proc-name <bot> <nick> <channel#> <flag><sock> <from>
bind chat <flags> <mask> <proc>
when someone parts a botnet channel, it invokes this binding;
flags is ignored; the mask is checked against the channel
proc-name <bot> <nick> <sock> <chan>
bind time - <mask> <proc>
allows you to schedule procedure calls at certain times,
mask matches 5 space seperated integers of the form:
"min hour day month year"
proc-name <min> <hour> <day> <month> <year>
bind away - <mask> <proc>
triggers when a user goes away or comes back on the botnet
(msg == "" when returning)
proc-name <bot> <idx> <msg>
bind load - <mask> <proc>
triggers when a module is loaded.
proc-name <module>
bind unld - <mask> <proc>
triggers when a module is unloaded.
proc-name <module>
bind nkch - <mask> <proc>
triggered whenever a local users nick is changed (in the userfile)
proc-name <oldnick> <newnick>