| Current Path : /home/mudbot/eggdrop-keep/doc/html/ |
| Current File : //home/mudbot/eggdrop-keep/doc/html/tcl-commands.html |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!-- $Id: tcl-commands.html,v 1.74 2011/09/19 14:38:50 thommey Exp $ -->
<html>
<head>
<title>Eggdrop Documentation: Eggdrop Tcl Commands</title>
</head>
<body>
<div align="center">
<p><strong>Eggdrop Tcl Commands</strong></p>
</div>
<hr>
<p>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.</p>
<p>This list is accurate for Eggdrop v1.6.20. 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, v1.0, v1.1 or v1.2 will probably not work without modification.
Commands which have been changed in this version of Eggdrop (or are
just new commands) are marked with an asterisk (*).</p>
<blockquote>
<ol>
<li><a href="#output">Output commands</a></li>
<li><a href="#urmc">User record manipulation commands</a></li>
<li><a href="#chancmds">Channel commands</a></li>
<li><a href="#dcccmds">DCC commands</a></li>
<li><a href="#notes">Notes module</a></li>
<li><a href="#assoc">Assoc module</a></li>
<li><a href="#compress">Compress module</a></li>
<li><a href="#filesys">Filesys module</a></li>
<li><a href="#misc">Miscellaneous commands</a></li>
<li><a href="#globvars">Global variables</a></li>
<li>
<a href="#bind">Bind</a>
<ol type="a">
<li><a href="#binda">Bind types</a></li>
<li><a href="#bindb">Return values</a></li>
</ol>
</li>
<li><a href="#control">Control procedures</a></li>
<li><a href="#tcp">TCP connections</a></li>
<li><a href="#matchchars">Match characters</a></li>
</ol>
</blockquote>
<hr>
<p><a name="output"></a>1. <strong>Output commands</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_putserv"></a>putserv <text> [options]</strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the server, like
'.dump' (intended for direct server commands); output is
queued so that the bot won't flood itself off the server.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>-next</strong>: push messages to the front of the
queue<br>
<strong>-normal</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_puthelp"></a>puthelp <text> [options]</strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the server, like
'putserv', but it uses a different queue intended for
sending messages to channels or people.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>-next</strong>: push messages to the front of the
queue<br>
<strong>-normal</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_putquick"></a>putquick <text> [options]</strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the server, like
'putserv', but it uses a different (and faster) queue.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>-next</strong>: push messages to the front of the
queue<br>
<strong>-normal</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_putnow"></a>putnow <text> [-oneline]</strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the server
immediately, bypassing all queues.
Use with caution, as the bot may easily flood itself off
the server.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>-oneline</strong>: send text up to the first \r or \n,
discarding the rest</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_putkick"></a>putkick <channel> <nick,nick,...>
[reason]</strong></dt>
<dd>
<p><strong>Description:</strong> sends kicks to the server and
tries to put as many nicks into one kick command as possible.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_putlog"></a>putlog <text></strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the bot's
logfile, marked as 'misc' (o)</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_putcmdlog"></a>putcmdlog <text></strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the bot's
logfile, marked as 'command' (c)</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_putxferlog"></a>putxferlog <text></strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the bot's
logfile, marked as 'file-area' (x)</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_putloglev"></a>putloglev <level(s)> <channel>
<text></strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the bot's
logfile, tagged with all of the valid levels given. Use
"*" to indicate all log levels.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dumpfile"></a>dumpfile <nick> <filename></strong></dt>
<dd>
<p><strong>Description:</strong> dumps 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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_queuesize"></a>queuesize [queue]</strong></dt>
<dd>
<p><strong>Returns:</strong> the number of messages in all queues.
If a queue is specified, only the size of this queue is returned.
Valid queues are: mode, server, help.</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_clearqueue"></a>clearqueue <queue></strong></dt>
<dd>
<p><strong>Description:</strong> removes all messages from a
queue. Valid arguments are: mode, server, help, or all.</p>
<p><strong>Returns:</strong> the number of deleted lines from
the specified queue.</p>
<p><strong>Module:</strong> server</p>
</dd>
</dl>
</blockquote>
<p><a name="urmc"></a>2. <strong>User record manipulation
commands</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_countusers"></a>countusers</strong></dt>
<dd>
<p><strong>Returns:</strong> number of users in the bot's
database</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_validuser"></a>validuser <handle></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if a user by that name exists;
0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_finduser"></a>finduser <nick!user@host></strong></dt>
<dd>
<p><strong>Description:</strong> finds the user record which most
closely matches the given nick!user@host</p>
<p><strong>Returns:</strong> the handle found, or "*"
if none</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_userlist"></a>userlist [flags]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of users on the bot. You
can use the flag matching system here
([global]{&/|}[chan]{&/|}[bot]). '&' specifies
"and"; '|' specifies "or".</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_passwdok"></a>passwdok <handle> <pass></strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> 1 if the password matches for that
user; 0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_getuser"></a>getuser <handle> <entry-type>
[extra info]</strong></dt>
<dd>
<p><strong>Description:</strong> an interface to the new generic
userfile support. Valid entry types are:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>BOTFL</strong></p>
</td>
<td>
<p>returns the current bot-specific flags for the user
(bot-only)</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>BOTADDR</strong></p>
</td>
<td>
<p>returns a list containing the bot's address, telnet
port, and relay port (bot-only)</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>HOSTS</strong></p>
</td>
<td>
<p>returns a list of hosts for the user</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>LASTON</strong></p>
</td>
<td>
<p>returns a list containing the unixtime last seen and
the last seen place. LASTON #channel returns the time
last seen time for the channel or 0 if no info exists.</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>INFO</strong></p>
</td>
<td>
<p>returns the user's global info line</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>XTRA</strong></p>
</td>
<td>
<p>returns the user's XTRA info</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>COMMENT</strong></p>
</td>
<td>
<p>returns the master-visible only comment for the user</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>EMAIL</strong></p>
</td>
<td>
<p>returns the user's e-mail address</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>URL</strong></p>
</td>
<td>
<p>returns the user's url</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>HANDLE</strong></p>
</td>
<td>
<p>returns the user's handle as it is saved in the
userfile</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>PASS</strong></p>
</td>
<td>
<p>returns the user's encrypted password</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> info specific to each entry-type</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_setuser"></a>setuser <handle> <entry-type>
[extra info]</strong></dt>
<dd>
<p><strong>Description:</strong> this is the counterpart of
getuser. It lets you set the various values. Other then the ones
listed below, the entry-types are the same as getuser's.</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>HOSTS</strong></p>
</td>
<td>
<p>if used with no third arg, all hosts for the user will
be cleared. Otherwise, *1* hostmask is added :P</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>LASTON</strong></p>
</td>
<td>
<p>This setting has 3 forms. "setuser <handle>
LASTON <unixtime> <place>" sets global
LASTON time, "setuser <handle> LASTON
<unixtime>" sets global LASTON time (leaving the
place field empty), and "setuser <handle> LASTON
<unixtime> <channel>" sets a users LASTON
time for a channel (if it is a valid channel).</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>PASS</strong></p>
</td>
<td>
<p>sets a users password (no third arg will clear it)</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_chhandle"></a>chhandle <old-handle>
<new-handle></strong></dt>
<dd>
<p><strong>Description:</strong> changes a user's handle</p>
<p><strong>Returns:</strong> 1 on success; 0 if the new handle is
invalid or already used, or if the user can't be found</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_chattr"></a>chattr <handle> [changes [channel]]</strong></dt>
<dd>
<p><strong>Description:</strong> changes the attributes for a user
record, if you include any. Changes are of the form '+f',
'-o', '+dk', '-o+d', etc. If changes are
specified in the format of <changes> <channel>, the
channel-specific flags for that channel are altered. You can now
use the +o|-o #channel format here too.</p>
<p><strong>Returns:</strong> new flags for the user (if you made
no changes, the current flags are returned). If a channel was
specified, the global AND the channel-specific flags for that
channel are returned in the format of globalflags|channelflags.
"*" is returned if the specified user does not exist.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_botattr"></a>botattr <handle> [changes [channel]]</strong></dt>
<dd>
<p><strong>Description:</strong> similar to chattr except this
modifies bot flags rather than normal user attributes.</p>
<p><strong>Returns:</strong> new flags for the bot (if you made
no changes, the current flags are returned). If a channel was
specified, the global AND the channel-specific flags for that
channel are returned in the format of globalflags|channelflags.
"*" is returned if the specified bot does not exist.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_matchattr"></a>matchattr <handle> <flags>
[channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified user has the
specified flags; 0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_adduser"></a>adduser <handle> [hostmask]</strong></dt>
<dd>
<p><strong>Description:</strong> creates a new user entry with the
handle and hostmask given (with no password and the default
flags)</p>
<p><strong>Returns:</strong> 1 if successful; 0 if the handle
already exists</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_addbot"></a>addbot <handle> <address></strong></dt>
<dd>
<p><strong>Description:</strong> adds a new bot to the userlist
with the handle and bot address given (with no password and no
flags)</p>
<p><strong>Returns:</strong> 1 if successful; 0 if the bot
already exists</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_deluser"></a>deluser <handle></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to erase the user record
for a handle</p>
<p><strong>Returns:</strong> 1 if successful, 0 if no such user
exists</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_delhost"></a>delhost <handle> <hostmask></strong></dt>
<dd>
<p><strong>Description:</strong> deletes a hostmask from a
user's host list</p>
<p><strong>Returns:</strong> 1 on success; 0 if the hostmask (or
user) doesn't exist</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_addchanrec"></a>addchanrec <handle> <channel></strong></dt>
<dd>
<p><strong>Description:</strong> adds a channel record for a
user</p>
<p><strong>Returns:</strong> 1 on success; 0 if the user or channel
does not exist</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_delchanrec"></a>delchanrec <handle> <channel></strong></dt>
<dd>
<p><strong>Description:</strong> removes a channel record for a
user. This includes all associated channel flags.</p>
<p><strong>Returns:</strong> 1 on success; 0 if the user or channel
does not exist</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_haschanrec"></a>haschanrec <handle> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the given handle has a chanrec
for the specified channel; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_getchaninfo"></a>getchaninfo <handle> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> info line for a specific channel
(behaves just like 'getinfo')</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_setchaninfo"></a>setchaninfo <handle> <channel>
<info></strong></dt>
<dd>
<p><strong>Description:</strong> sets the info line on a specific
channel for a user. If info is "none", it will be
removed.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newchanban"></a>newchanban <channel> <ban> <creator>
<comment> [lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a ban to the 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.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the ban to be always active
on a channel, even with dynamicbans on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newban"></a>newban <ban> <creator> <comment>
[lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a ban to the global ban list
(which takes effect on all channels); creator is given credit for
the ban in the ban list. lifetime is specified in minutes. If
lifetime is not specified, global-ban-time (usually 60) is used.
Setting the lifetime to 0 makes it a permanent ban.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the ban to be always active
on a channel, even with dynamicbans on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newchanexempt"></a>newchanexempt <channel> <exempt>
<creator> <comment> [lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a exempt to the 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. 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 been removed.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the exempt to be always active
on a channel, even with dynamicexempts on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newexempt"></a>newexempt <exempt> <creator> <comment>
[lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a exempt to the global
exempt list (which takes effect on all channels); 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. The exempt will not be removed until the
corresponding ban has been removed.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the exempt to be always active
on a channel, even with dynamicexempts on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newchaninvite"></a>newchaninvite <channel> <invite>
<creator> <comment> [lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a invite to the 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. The invite will not be removed
until the channel has gone -i.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the invite to be always active
on a channel, even with dynamicinvites on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newinvite"></a>newinvite <invite> <creator> <comment>
[lifetime] [options]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a invite to the global invite
list (which takes effect on all channels); 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.
The invite will not be removed until the channel has gone -i.</p>
<p><strong>Options:</strong></p>
<blockquote>
<p><strong>sticky</strong>: forces the invite to be always active
on a channel, even with dynamicinvites on<br>
<strong>none</strong>: no effect</p>
</blockquote>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_stick"></a>stick <banmask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes a ban sticky, or, if a
channel is specified, then it is set sticky on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_unstick"></a>unstick <banmask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes a ban no longer sticky,
or, if a channel is specified, then it is unstuck on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_stickexempt"></a>stickexempt <exemptmask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes an exempt sticky, or, if
a channel is specified, then it is set sticky on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_unstickexempt"></a>unstickexempt <exemptmask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes an exempt no longer sticky,
or, if a channel is specified, then it is unstuck on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_stickinvite"></a>stickinvite <invitemask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes an invite sticky, or, if
a channel is specified, then it is set sticky on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_unstickinvite"></a>unstickinvite <invitemask> [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> makes an invite no longer sticky,
or, if a channel is specified, then it is unstuck on that channel
only.</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killchanban"></a>killchanban <channel> <ban></strong></dt>
<dd>
<p><strong>Description:</strong> removes a ban from the ban list
for a channel</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killban"></a>killban <ban></strong></dt>
<dd>
<p><strong>Description:</strong> removes a ban from the global
ban list</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killchanexempt"></a>killchanexempt <channel>
<exempt></strong></dt>
<dd>
<p><strong>Description:</strong> removes an exempt from the exempt
list for a channel</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killexempt"></a>killexempt <exempt></strong></dt>
<dd>
<p><strong>Description:</strong> removes an exempt from the global
exempt list</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killchaninvite"></a>killchaninvite <channel> <invite></strong></dt>
<dd>
<p><strong>Description:</strong> removes an invite from the invite
list for a channel</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_killinvite"></a>killinvite <invite></strong></dt>
<dd>
<p><strong>Description:</strong> removes an invite from the global
invite list</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_ischanjuped"></a>ischanjuped <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the channel is juped, and the
bot is unable to join; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isban"></a>isban <ban> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified ban is in the
global ban list; 0 otherwise. If a channel is specified, that
channel's ban list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_ispermban"></a>ispermban <ban> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified 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 as
well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isexempt"></a>isexempt <exempt> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified exempt is in the
global exempt list; 0 otherwise. If a channel is specified, that
channel's exempt list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_ispermexempt"></a>ispermexempt <exempt> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified 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
as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isinvite"></a>isinvite <invite> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified invite is in
the global invite list; 0 otherwise. If a channel is specified,
that channel's invite list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isperminvite"></a>isperminvite <invite> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified 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 as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isbansticky"></a>isbansticky <ban> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified ban is marked as
sticky in the global ban list; 0 otherwise. If a channel is
specified, that channel's ban list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isexemptsticky"></a>isexemptsticky <exempt> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified exempt is marked
as sticky in the global exempt list; 0 otherwise. If a channel is
specified, that channel's exempt list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_isinvitesticky"></a>isinvitesticky <invite> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified invite is marked
as sticky in the global invite list; 0 otherwise. If a channel
is specified, that channel's invite list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_matchban"></a>matchban <nick!user@host> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified nick!user@host
matches a ban in the global ban list; 0 otherwise. If a channel
is specified, that channel's ban list is checked as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_matchexempt"></a>matchexempt <nick!user@host>
[channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified nick!user@host
matches an exempt in the global exempt list; 0 otherwise. If a
channel is specified, that channel's exempt list is checked
as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_matchinvite"></a>matchinvite <nick!user@host> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified nick!user@host
matches an invite in the global invite list; 0 otherwise. If a
channel is specified, that channel's invite list is checked
as well.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_banlist"></a>banlist [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of global bans, or, if a
channel is specified, a list of channel-specific bans. Each entry
is a sublist containing: hostmask, comment, expiration timestamp,
time added, last time active, and creator. The three timestamps
are in unixtime format.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_exemptlist"></a>exemptlist [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of global exempts, or, if a
channel is specified, a list of channel-specific exempts. Each
entry is a sublist containing: hostmask, comment, expiration
timestamp, time added, last time active, and creator. The three
timestamps are in unixtime format.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_invitelist"></a>invitelist [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of global invites, or, if a
channel is specified, a list of channel-specific invites. Each
entry is a sublist containing: hostmask, comment, expiration
timestamp, time added, last time active, and creator. The three
timestamps are in unixtime format.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_newignore"></a>newignore <hostmask> <creator>
<comment> [lifetime]</strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_killignore"></a>killignore <hostmask></strong></dt>
<dd>
<p><strong>Description:</strong> removes an entry from the ignore
list</p>
<p><strong>Returns:</strong> 1 if successful; 0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_ignorelist"></a>ignorelist</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of ignores. Each entry is a
sublist containing: hostmask, comment, expiration timestamp, time
added, and creator. The timestamps are in unixtime format.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_isignore"></a>isignore <hostmask></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the ignore is in the list;
0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_save"></a>save</strong></dt>
<dd>
<p><strong>Description:</strong> writes the user and channel files
to disk</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_reload"></a>reload</strong></dt>
<dd>
<p><strong>Description:</strong> loads the userfile from disk,
replacing whatever is in memory</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_backup"></a>backup</strong></dt>
<dd>
<p><strong>Description:</strong> makes a simple backup of the
userfile that's on disk. If the channels module is loaded,
this also makes a simple backup of the channel file.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_getting-users"></a>getting-users</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot is currently downloading
a userfile from a sharebot (and hence, user records are about to
drastically change); 0 if not</p>
<p><strong>Module:</strong> core</p>
</dd>
</dl>
</blockquote>
<p><a name="chancmds"></a><a name="cmd_channel"></a>3. <strong>Channel commands</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_channel_add"></a>channel add <name> [option-list]</strong></dt>
<dd>
<p><strong>Description:</strong> adds a channel record for the
bot to monitor. The full list of possible options are given in
doc/settings/mod.channels. Note that the channel options must be
in a list (enclosed in {}).</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channel_set"></a>channel set <name> <options...></strong></dt>
<dd>
<p><strong>Description:</strong> sets options for the channel
specified. The full list of possible options are given in
doc/settings/mod.channels.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channel_info"></a>channel info <name></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of info about the specified
channel's settings.</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channel_get"></a>channel get <name> <setting></strong></dt>
<dd>
<p><strong>Returns:</strong> The value of the setting you specify.
For flags, a value of 0 means it is disabled (-), and non-zero means
enabled (+).</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channel_remove"></a>channel remove <name></strong></dt>
<dd>
<p><strong>Description:</strong> removes a channel record from
the bot and makes the bot no longer monitor the channel</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_savechannels"></a>savechannels</strong></dt>
<dd>
<p><strong>Description:</strong> saves the channel settings to
the channel-file if one is defined.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_loadchannels"></a>loadchannels</strong></dt>
<dd>
<p><strong>Description:</strong> reloads the channel settings from
the channel-file if one is defined.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channels"></a>channels</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of the channels the bot has
a channel record for</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_channame2dname"></a>channame2dname <channel-name></strong></dt>
<dt><strong><a name="cmd_chandname2name"></a>chandname2name <channel-dname></strong></dt>
<dd>
<p><strong>Description:</strong> these two functions are important
to correctly support !channels. The bot differentiates between
channel description names (chan dnames) and real channel names
(chan names). The chan dnames are what you would normally call
the channel, such as "!channel". The chan names are
what the IRC server uses to identify the channel. They consist
of the chan dname prefixed with an ID; such as
"!ABCDEchannel".</p>
<p>For bot functions like isop, isvoice, etc. you need to know
the chan dnames. If you communicate with the server, you usually
get the chan name, though. That's what you need the
channame2dname function for.</p>
<p>If you only have the chan dname and want to directly send raw
server commands, use the chandname2name command.</p>
<p>For non-!channels, chan dname and chan name are the same.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_isbotnick"></a>isbotnick <nick></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the nick matches the botnick;
0 otherwise</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_botisop"></a>botisop [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot has ops on the specified
channel (or any channel if no channel is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_botishalfop"></a>botishalfop [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot has halfops on the
specified channel (or any channel if no channel is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_botisvoice"></a>botisvoice [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot has a voice on the
specified channel (or any channel if no channel is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_botonchan"></a>botonchan [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot is on the specified
channel (or any channel if no channel is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_isop"></a>isop <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone by the specified
nickname is on the channel (or any channel if no channel name is
specified) and has ops; 0 otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_ishalfop"></a>ishalfop <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone by the specified
nickname is on the channel (or any channel if no channel name is
specified) and has halfops; 0 otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_wasop"></a>wasop <nickname> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone that just got
opped/deopped in the chan had op before the modechange; 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_washalfop"></a>washalfop <nickname> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone that just got
halfopped/dehalopped in the chan had halfop before the modechange; 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_isvoice"></a>isvoice <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone by that nickname is on
the channel (or any channel if no channel is specified) and has
voice (+v); 0 otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_onchan"></a>onchan <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if someone by that nickname is on
the specified channel (or any channel if none is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_nick2hand"></a>nick2hand <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> the handle of a nickname on a channel.
If a channel is not specified, the bot will check all of its
channels. If the nick is not found, "" is returned. If
the nick is found but does not have a handle, "*" is
returned.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_hand2nick"></a>hand2nick <handle> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> nickname of the first person on the
specified channel (if one is specified) whose nick!user@host
matches the given handle; "" is returned if no match
is found. If no channel is specified, all channels are checked.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_handonchan"></a>handonchan <handle> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the the nick!user@host for
someone on the channel (or any channel if no channel name is
specified) matches for the handle given; 0 otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_ischanban"></a>ischanban <ban> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified ban is on the
given channel's ban list (not the bot's banlist for the
channel)</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_ischanexempt"></a>ischanexempt <exempt> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified exempt is on the
given channel's exempt list (not the bot's exemptlist for
the channel)</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_ischaninvite"></a>ischaninvite <invite> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the specified invite is on the
given channel's invite list (not the bot's invitelist for
the channel)</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_chanbans"></a>chanbans <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of the current bans on the
channel. Each element is a sublist of the form {<ban>
<bywho> <age>}. age is seconds from the bot's
point of view</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_chanexempts"></a>chanexempts <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of the current exempts on the
channel. Each element is a sublist of the form {<exempts>
<bywho> <age>}. age is seconds from the bot's
point of view</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_chaninvites"></a>chaninvites <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of the current invites on the
channel. Each element is a sublist of the form {<invites>
<bywho> <age>}. age is seconds from the bot's
point of view</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetbans"></a>resetbans <channel></strong></dt>
<dd>
<p><strong>Description:</strong> 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</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetexempts"></a>resetexempts [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> removes all exempt on the channel
that aren't in the bot's exempt list and refreshes any
exempts that should be on the channel but aren't</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetinvites"></a>resetinvites [channel]</strong></dt>
<dd>
<p><strong>Description:</strong> removes all invites on the channel
that aren't in the bot's invite list and refreshes any
invites that should be on the channel but aren't</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetchanidle"></a>resetchanidle [nick]
<channel></strong></dt>
<dd>
<p><strong>Description:</strong> resets the channel idle time for
the given nick or for all nicks on the channel if no nick is
specified.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetchanjoin"></a>resetchanjoin [nick]
<channel></strong></dt>
<dd>
<p><strong>Description:</strong> resets the channel join time for
the given nick or for all nicks on the channel if no nick is
specified.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_resetchan"></a>resetchan <channel>
[flags]</strong></dt>
<dd>
<p><strong>Description:</strong> rereads in the channel info from
the server. If flags are specified, only the required information
will be reset, according to the given flags. Available flags are:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>b</strong></p>
</td>
<td>
<p>reset channel bans</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>e</strong></p>
</td>
<td>
<p>reset channel exempts</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>I</strong></p>
</td>
<td>
<p>reset channel invites</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>m</strong></p>
</td>
<td>
<p>reset channel modes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>t</strong></p>
</td>
<td>
<p>refresh channel topic</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>w</strong></p>
</td>
<td>
<p>refresh memberlist</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> nothing </p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_getchanhost"></a>getchanhost <nickname> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> user@host of the specified nickname
(the nickname is not included in the returned host). If a channel
is not specified, bot will check all of its channels. If the
nickname is not on the channel(s), "" is returned.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_getchanjoin"></a>getchanjoin <nickname> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> timestamp (unixtime format) of when
the specified nickname joined the channel if available, 0
otherwise. Note that after a channel reset this information will be
lost, even if previously available.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_onchansplit"></a>onchansplit <nick> [channel]</strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if that nick is split from the
channel (or any channel if no channel is specified); 0
otherwise</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_chanlist"></a>chanlist <channel>
[flags[&chanflags]]</strong></dt>
<dd>
<p><strong>Description:</strong> flags are any global flags; the
'&' denotes to look for channel specific flags.
Examples:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>n</strong></p>
</td>
<td>
<p>Global Owner</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>&n</strong></p>
</td>
<td>
<p>Channel Owner</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>o&m</strong></p>
</td>
<td>
<p>Global Op, Channel Master</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> 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. Please note
that if you're executing chanlist after a part or sign bind,
the gone user will still be listed, so you can check for wasop,
isop, etc.</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_getchanidle"></a>getchanidle <nickname> <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> number of minutes that person has
been idle; 0 if the specified user isn't on the channel</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_getchanmode"></a>getchanmode <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> string of the type "+ntik
key" for the channel specified</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_jump"></a>jump [server [port [password]]]</strong></dt>
<dd>
<p><strong>Description:</strong> jumps to the server specified,
or (if none is specified) the next server in the bot's
serverlist</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="cmd_pushmode"></a>pushmode <channel> <mode> [arg]</strong></dt>
<dd>
<p><strong>Description:</strong> sends out a channel mode change
(ex: pushmode #lame +o goober) through the bot's queuing
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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_flushmode"></a>flushmode <channel></strong></dt>
<dd>
<p><strong>Description:</strong> forces all previously pushed
channel mode changes to be sent to the server, instead of when
the script is finished (just for the channel specified)</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_topic"></a>topic <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> string containing the current topic
of the specified channel</p>
<p><strong>Module:</strong> irc</p>
</dd>
<dt><strong><a name="cmd_validchan"></a>validchan <channel></strong></dt>
<dd>
<p><strong>Description:</strong> checks if the bot has a channel
record for the specified channel. Note that this does not
necessarily mean that the bot is ON the channel.</p>
<p><strong>Returns:</strong> 1 if the channel exists, 0 if not</p>
<p><strong>Module:</strong> nothing</p>
</dd>
<dt><strong><a name="cmd_isdynamic"></a>isdynamic <channel></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the channel is a dynamic
channel; 0 otherwise</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_setudef"></a>setudef <flag/int/str> <name></strong></dt>
<dd>
<p><strong>Description:</strong> initializes a user defined channel
flag, string, 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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_renudef"></a>renudef <flag/int/str> <oldname>
<newname></strong></dt>
<dd>
<p><strong>Description:</strong> renames a user defined channel
flag, string, or integer setting.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
<dt><strong><a name="cmd_deludef"></a>deludef <flag/int/str> <name></strong></dt>
<dd>
<p><strong>Description:</strong> deletes a user defined channel
flag, string, or integer setting.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> channels</p>
</dd>
</dl>
</blockquote>
<p><a name="dcccmds"></a>4. <strong>Dcc commands</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_putdcc"></a>putdcc <idx> <text> [-raw]</strong></dt>
<dd>
<p><strong>Description:</strong> sends text to the idx specified.
If -raw is specified, the text will be sent as is, without forced
new lines or limits to line length.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dccbroadcast"></a>dccbroadcast <message></strong></dt>
<dd>
<p><strong>Description:</strong> sends a message to everyone on
the party line across the botnet, in the form of "***
<message>" for local users and "*** (Bot)
<message>" for users on other bots</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dccputchan"></a>dccputchan <channel> <message></strong></dt>
<dd>
<p><strong>Description:</strong> sends your message to everyone
on a certain channel on the botnet, in a form exactly like
dccbroadcast does. Valid channels are 0 through 99999.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_boot"></a>boot <user@bot> [reason]</strong></dt>
<dd>
<p><strong>Description:</strong> boots a user from the partyline</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dccsimul"></a>dccsimul <idx> <text></strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_hand2idx"></a>hand2idx <handle></strong></dt>
<dd>
<p><strong>Returns:</strong> the idx (a number greater than or
equal to zero) for the user given if the user 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 is
returned if no idx is found. If the user is on multiple times,
the oldest idx is returned.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_idx2hand"></a>idx2hand <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> handle of the user with the given
idx</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_valididx"></a>valididx <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the idx currently exists; 0
otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_getchan"></a>getchan <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> 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</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_setchan"></a>setchan <idx> <channel></strong></dt>
<dd>
<p><strong>Description:</strong> sets a party line user's
channel. The party line user is not notified that she is now on
a new channel. A channel name can be used (provided it exists).</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_console"></a>console <idx> [channel]
[console-modes]</strong></dt>
<dd>
<p><strong>Description:</strong> 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 a valid channel).</p>
<p><strong>Returns:</strong> a list containing the user's (new)
channel view and (new) console modes, or nothing if that user
isn't currently on the partyline</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_echo"></a>echo <idx> [status]</strong></dt>
<dd>
<p><strong>Description:</strong> turns a user's echo on or
off; the status has to be a 1 or 0</p>
<p><strong>Returns:</strong> new value of echo for that user (or
the current value, if status was omitted)</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_strip"></a>strip <idx> [+/-strip-flags]</strong></dt>
<dd>
<p><strong>Description:</strong> modifies the strip-flags for a
user. The supported strip-flags are:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>b</strong></p>
</td>
<td>
<p>remove all boldface codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>c</strong></p>
</td>
<td>
<p>remove all color codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>r</strong></p>
</td>
<td>
<p>remove all reverse video codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>u</strong></p>
</td>
<td>
<p>remove all underline codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>a</strong></p>
</td>
<td>
<p>remove all ANSI codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>g</strong></p>
</td>
<td>
<p>remove all ctrl-g (bell) codes</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> new strip-flags for the specified user
(or the current flags, if strip-flags was omitted)</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_putbot"></a>putbot <bot-nick> <message></strong></dt>
<dd>
<p><strong>Description:</strong> sends a message across the
botnet to another bot. If no script intercepts the message on
the other end, the message is ignored.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_putallbots"></a>putallbots <message></strong></dt>
<dd>
<p><strong>Description:</strong> sends a message across the botnet
to all bots. If no script intercepts the message on the other end,
the message is ignored.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_killdcc"></a>killdcc <idx></strong></dt>
<dd>
<p><strong>Description:</strong> kills a partyline or file area
connection</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_bots"></a>bots</strong></dt>
<dd>
<p><strong>Returns:</strong> list of the bots currently connected
to the botnet</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_botlist"></a>botlist</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of bots currently on the
botnet. Each item in the list is a sublist with four elements:
bot, uplink, version, sharing status:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>bot</strong></p>
</td>
<td>
<p>the bot's botnetnick</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>uplink</strong></p>
</td>
<td>
<p>the bot the bot is connected to</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>version</strong></p>
</td>
<td>
<p>its current numeric version</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>sharing</strong></p>
</td>
<td>
<p>a "+" if the bot is a sharebot; "-"
otherwise</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_islinked"></a>islinked <bot></strong></dt>
<dd>
<p><strong>Returns:</strong> 1 if the bot is currently linked; 0
otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dccused"></a>dccused</strong></dt>
<dd>
<p><strong>Returns:</strong> number of dcc connections currently
in use</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dcclist"></a>dcclist [type]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of active connections, each
item in the list is a sublist containing six elements: {<idx>
<handle> <hostname> <type> {<other>}
<timestamp>}</p>
<p>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.
The timestamp is in unixtime format.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_whom"></a>whom <chan></strong></dt>
<dd>
<p><strong>Returns:</strong> list of people on the botnet who are
on that channel. 0 is the default party line. Each item in the
list is 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 * for channel, every user on the
botnet is returned with an extra argument indicating the channel
the user is on.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_getdccidle"></a>getdccidle <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> number of seconds the dcc chat/file
system/script user has been idle</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_getdccaway"></a>getdccaway <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> away message for a dcc chat user
(or "" if the user is not set away)</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_setdccaway"></a>setdccaway <idx> <message></strong></dt>
<dd>
<p><strong>Description:</strong> sets a party line user's away
message and marks them away. If set to "", the user is
marked as no longer away.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_connect"></a>connect <host> <port></strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> idx of the new connection</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_listen"></a>listen <port> <type> [options]
[flag]</strong></dt>
<dd>
<p><strong>Description:</strong> opens a listening port to accept
incoming telnets; type must be one of "bots",
"all", "users", "script", or
"off":</p>
<blockquote>
<dl>
<dt><strong>listen <port> bots [mask]</strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> port number</p>
</dd>
<dt><strong>listen <port> users [mask]</strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> port number</p>
</dd>
<dt><strong>listen <port> all [mask]</strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> port number</p>
</dd>
<dt><strong>listen <port> script <proc>
[flag]</strong></dt>
<dd>
<p><strong>Description:</strong> 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.</p>
<p><strong>Returns:</strong> port number</p>
</dd>
<dt><strong>listen <port> off</strong></dt>
<dd>
<p><strong>Description:</strong> stop listening on a port</p>
<p><strong>Returns:</strong> nothing</p>
</dd>
</dl>
</blockquote>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dccdumpfile"></a>dccdumpfile <idx> <filename></strong></dt>
<dd>
<p><strong>Description:</strong> dumps out a file from the text
directory to a dcc chat user. The flag matching that's used
everywhere else works here, too.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
</dl>
</blockquote>
<p><a name="notes"></a>5. <strong>Notes module</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_notes"></a>notes <user> [numberlist]</strong></dt>
<dd>
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
failure. If a numberlist is not specified, the number of notes
stored for the user is returned. Otherwise, a list of sublists
containing information about notes stored for the user is
returned. Each sublist is in the format of: {<from>
<timestamp> <note text>}.</p>
<p><strong>Module:</strong> notes</p>
</dd>
<dt><strong><a name="cmd_erasenotes"></a>erasenotes <user> <numberlist></strong></dt>
<dd>
<p><strong>Description:</strong> erases some or all stored notes
for a user. Use '-' to erase all notes.</p>
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
failure, 0 if no such note, or number of erased notes.</p>
<p><strong>Module:</strong> notes</p>
</dd>
<dt><strong><a name="cmd_listnotes"></a>listnotes <user> <numberlist></strong></dt>
<dd>
<p><strong>Description:</strong> lists existing notes according
to the numberlist (ex: "2-4;8;16-")</p>
<p><strong>Returns:</strong> -1 if no such user, -2 if notefile
failure, 0 if no such note, list of existing notes.</p>
<p><strong>Module:</strong> notes</p>
</dd>
<dt><strong><a name="cmd_storenote"></a>storenote <from> <to> <msg>
<idx></strong></dt>
<dd>
<p><strong>Description:</strong> stores a note for later reading,
notifies idx of any results (use idx -1 for no notify).</p>
<p><strong>Returns:</strong> 0 on success; non-0 on failure</p>
<p><strong>Module:</strong> notes</p>
</dd>
</dl>
</blockquote>
<p><a name="assoc"></a>6. <strong>Assoc module</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_assoc"></a>assoc <chan> [name]</strong></dt>
<dd>
<p><strong>Description:</strong> sets the name associated with a
botnet channel, if you specify one</p>
<p><strong>Returns:</strong> current name for that channel, if
any</p>
<p><strong>Module:</strong> assoc</p>
</dd>
<dt><strong><a name="cmd_killassoc"></a>killassoc <chan></strong></dt>
<dd>
<p><strong>Description:</strong> removes the name associated
with a botnet channel, if any exists. Use 'killassoc &'
to kill all assocs.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> assoc</p>
</dd>
</dl>
</blockquote>
<p><a name="compress"></a>7. <strong>Compress module</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_compressfile"></a>compressfile [-level <level>] <src-file>
[target-file]<br>
<a name="cmd_uncompressfile"></a>uncompressfile <src-file> [target-file]</strong></dt>
<dd>
<p><strong>Description:</strong> compresses or un-compresses
files. The level option specifies the compression mode to use
when compressing. Available modes are from 0 (minimum CPU usage,
minimum compression) all the way up to 9 (maximum CPU usage,
maximum compression). If you don't specify the target-file,
the src-file will be overwritten.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> compress</p>
</dd>
<dt><strong><a name="cmd_iscompressed"></a>iscompressed <filename></strong></dt>
<dd>
<p><strong>Description:</strong> determines whether
<filename> is gzip compressed. Returns 1 if it is, 0 if it
isn't, and 2 if some kind of error prevented the checks from
succeeding.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> compress</p>
</dd>
</dl>
</blockquote>
<p><a name="filesys"></a>8. <strong>Filesys module</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_setpwd"></a>setpwd <idx> <dir></strong></dt>
<dd>
<p><strong>Description:</strong> changes the directory of a file
system user, in exactly the same way as a 'cd' command
would. The directory can be specified relative or absolute.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getpwd"></a>getpwd <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> the current directory of a file
system user</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getfiles"></a>getfiles <dir></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of files in the directory
given; the directory is relative to dcc-path</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getdirs"></a>getdirs <dir></strong></dt>
<dd>
<p><strong>Returns:</strong> a list of subdirectories in the
directory given; the directory is relative to dcc-path</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_dccsend"></a>dccsend <filename> <ircnick></strong></dt>
<dd>
<p><strong>Description:</strong> 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</p>
<p><strong>Returns:</strong></p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>0</strong></p>
</td>
<td>
<p>success</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>1</strong></p>
</td>
<td>
<p>the dcc table is full (too many connections)</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>2</strong></p>
</td>
<td>
<p>can't open a socket for the transfer</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>3</strong></p>
</td>
<td>
<p>the file doesn't exist</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>4</strong></p>
</td>
<td>
<p>the file was queued for later transfer, which means that
person has too many file transfers going right now</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>5</strong></p>
</td>
<td>
<p>copy-to-tmp is enabled and the file already exists in the
temp directory</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> transfer</p>
</dd>
<dt><strong><a name="cmd_filesend"></a>filesend <idx> <filename>
[ircnick]</strong></dt>
<dd>
<p><strong>Description:</strong> 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</p>
<p><strong>Returns:</strong> 0 on failure; 1 on success (either an
immediate send or a queued send)</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_fileresend"></a>fileresend <idx> <filename>
[ircnick]</strong></dt>
<dd>
<p><strong>Description:</strong> functions like filesend, only that
it sends 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.</p>
<p><strong>Returns:</strong> 0 on failure; 1 on success (either
an immediate send or a queued send)</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_setdesc"></a>setdesc <dir> <file> <desc></strong></dt>
<dd>
<p><strong>Description:</strong> sets the description for a file
in a file system directory; the directory is relative to
dcc-path</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getdesc"></a>getdesc <dir> <file></strong></dt>
<dd>
<p><strong>Returns:</strong> the description for a file in the
file system, if one exists</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_setowner"></a>setowner <dir> <file>
<handle></strong></dt>
<dd>
<p><strong>Description:</strong> changes the owner for a file in
the file system; the directory is relative to dcc-path</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getowner"></a>getowner <dir> <file></strong></dt>
<dd>
<p><strong>Returns:</strong> the owner of a file in the file
system</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_setlink"></a>setlink <dir> <file> <link></strong></dt>
<dd>
<p><strong>Description:</strong> creates or changes a linked file
(a file that actually exists on another bot); the directory is
relative to dcc-path</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getlink"></a>getlink <dir> <file></strong></dt>
<dd>
<p><strong>Returns:</strong> the link for a linked file, if it
exists</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getfileq"></a>getfileq <handle></strong></dt>
<dd>
<p><strong>Returns:</strong> 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</p>
<p><strong>Module:</strong> transfer</p>
</dd>
<dt><strong><a name="cmd_getfilesendtime"></a>getfilesendtime <idx></strong></dt>
<dd>
<p><strong>Returns:</strong> the unixtime value for when a file
transfer started, or a negative number:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>-1</strong></p>
</td>
<td>
<p>no matching transfer with the specified idx was found</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-2</strong></p>
</td>
<td>
<p>the idx matches an entry which is not a file transfer</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> transfer</p>
</dd>
<dt><strong><a name="cmd_mkdir"></a>mkdir <directory> [<required-flags>
[channel]]</strong></dt>
<dd>
<p><strong>Description:</strong> creates a directory in the file
system. Only users with the required flags may access it.</p>
<p><strong>Returns:</strong></p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>0</strong></p>
</td>
<td>
<p>success</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>1</strong></p>
</td>
<td>
<p>can't create directory</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>2</strong></p>
</td>
<td>
<p>directory exists but is not a directory</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-3</strong></p>
</td>
<td>
<p>could not open filedb</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_rmdir"></a>rmdir <directory></strong></dt>
<dd>
<p><strong>Description:</strong> removes a directory from the
file system.</p>
<p><strong>Returns:</strong> 0 on success; 1 on failure</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_mv"></a>mv <file> <destination></strong></dt>
<dd>
<p><strong>Description:</strong> moves a file from its source to
the given destination. The file can also be a mask, such as
/incoming/*, provided the destination is a directory.</p>
<p><strong>Returns:</strong> If the command was successful, the
number of files moved will be returned. Otherwise, a negative
number will be returned:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>-1</strong></p>
</td>
<td>
<p>invalid source file</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-2</strong></p>
</td>
<td>
<p>invalid destination</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-3</strong></p>
</td>
<td>
<p>destination file exists</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-4</strong></p>
</td>
<td>
<p>no matches found</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_cp"></a>cp <file> <destination></strong></dt>
<dd>
<p><strong>Description:</strong> copies a file from its source
to the given destination. The file can also be a mask, such as
/incoming/*, provided the destination is a directory.</p>
<p><strong>Returns:</strong> If the command was successful, the
number of files copied will be returned. Otherwise, a negative
number will be returned:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>-1</strong></p>
</td>
<td>
<p>invalid source file</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-2</strong></p>
</td>
<td>
<p>invalid destination</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-3</strong></p>
</td>
<td>
<p>destination file exists</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>-4</strong></p>
</td>
<td>
<p>no matches found</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_getflags"></a>getflags <dir></strong></dt>
<dd>
<p><strong>Returns:</strong> the flags required to access a
directory</p>
<p><strong>Module:</strong> filesys</p>
</dd>
<dt><strong><a name="cmd_setflags"></a>setflags <dir> [<flags>
[channel]]</strong></dt>
<dd>
<p><strong>Description:</strong> sets the flags required to
access a directory</p>
<p><strong>Returns:</strong> 0 on success; -1 or -3 on failure</p>
<p><strong>Module:</strong> filesys</p>
</dd>
</dl>
</blockquote>
<p><a name="misc"></a>9. <strong>Miscellaneous commands</strong></p>
<blockquote>
<dl>
<dt><strong><a name="cmd_bind"></a>bind <type> <flags> <keyword/mask>
[proc-name]</strong></dt>
<dd>
<p><strong>Description:</strong> You can use the 'bind'
command to attach Tcl procedures to certain events. flags are the
flags the user must have to trigger the event (if applicable).
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).</p>
<p><strong>Returns:</strong> name of the command that was added,
or (if proc-name was omitted), a list of the current bindings for
this command</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unbind"></a>unbind <type> <flags> <keyword/mask>
<proc-name></strong></dt>
<dd>
<p><strong>Description:</strong> removes a previously created
bind</p>
<p><strong>Returns:</strong> name of the command that was
removed</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_binds"></a>binds [type/mask]</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of Tcl binds, each item in the
list is a sublist of five elements: {<type> <flags>
<name> <hits> <proc>}</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_logfile"></a>logfile [<modes> <channel>
<filename>]</strong></dt>
<dd>
<p><strong>Description:</strong> creates a new logfile, which will
log the modes given for the channel listed. If no logfile is
specified, a list of existing logfiles will be returned.
"*" indicates 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.</p>
<p><strong>Returns:</strong> filename of logfile created, or, if
no logfile is specified, a list of logfiles such as: {mco *
eggdrop.log} {jp #lame lame.log}</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_maskhost"></a>maskhost <nick!user@host>
[masktype]</strong></dt>
<dd>
<p><strong>Description:</strong> masks the given irc hostmask, so
that it can match a wider set of nick/user/host combinations. The
masktypes supported are compatible with mIRC's standard types.</p>
<p> Available types are: <br>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>0</strong></p>
</td>
<td>
<p>*!user@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>1</strong></p>
</td>
<td>
<p>*!*user@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>2</strong></p>
</td>
<td>
<p>*!*@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>3</strong></p>
</td>
<td>
<p>*!*user@*.host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>4</strong></p>
</td>
<td>
<p>*!*@*.host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>5</strong></p>
</td>
<td>
<p>nick!user@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>6</strong></p>
</td>
<td>
<p>nick!*user@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>7</strong></p>
</td>
<td>
<p>nick!*@host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>8</strong></p>
</td>
<td>
<p>nick!*user@*.host</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>9</strong></p>
</td>
<td>
<p>nick!*@*.host</p>
</td>
</tr>
</table>
</blockquote>
</p>
<p>You can also specify types from 10 to 19 which correspond to types
0 to 9, but instead of using a * wildcard to replace portions of the
host, only numbers in hostnames are replaced with the '?' wildcard.
Same is valid for types 20-29, but instead of '?', the '*' wildcard
will be used.</p>
<p><strong>Returns:</strong> masked hostmask for the string
given according to the masktype. </p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_timer"></a>timer <minutes> <tcl-command></strong></dt>
<dd>
<p><strong>Description:</strong> executes the given Tcl command
after a certain number of minutes have passed</p>
<p><strong>Returns:</strong> a timerID</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_utimer"></a>utimer <seconds> <tcl-command></strong></dt>
<dd>
<p><strong>Description:</strong> executes the given Tcl command
after a certain number of seconds have passed</p>
<p><strong>Returns:</strong> a timerID</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_timers"></a>timers</strong></dt>
<dd>
<p><strong>Returns:</strong> a 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.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_utimers"></a>utimers</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of active secondly timers.
Each entry in the list contains the number of minutes left till
activation, the command that will be executed, and the timerID.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_killtimer"></a>killtimer <timerID></strong></dt>
<dd>
<p><strong>Description:</strong> removes a minutely timer from
the list</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_killutimer"></a>killutimer <timerID></strong></dt>
<dd>
<p><strong>Description:</strong> removes a secondly timer from
the list</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unixtime"></a>unixtime</strong></dt>
<dd>
<p><strong>Returns:</strong> a long integer which represents the
number of seconds that have passed since 00:00 Jan 1, 1970 (GMT).</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_duration"></a>duration <seconds></strong></dt>
<dd>
<p><strong>Returns:</strong> the number of seconds converted
into years, weeks, days, hours, minutes, and seconds. 804600
seconds is turned into 1 week 2 days 7 hours 30 minutes.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_strftime"></a>strftime <formatstring> [time]</strong></dt>
<dd>
<p><strong>Returns:</strong> a formatted string of time using
standard strftime format. If time is specified, the value of the
specified time is used. Otherwise, the current time is used.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_ctime"></a>ctime <unixtime></strong></dt>
<dd>
<p><strong>Returns:</strong> a formatted date/time string based
on the current locale settings from the unixtime string given; for
example "Fri Aug 3 11:34:55 1973"</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_myip"></a>myip</strong></dt>
<dd>
<p><strong>Returns:</strong> a long number representing the
bot's IP address, as it might appear in (for example) a DCC
request</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_rand"></a>rand <limit></strong></dt>
<dd>
<p><strong>Returns:</strong> a random integer between 0 and
limit-1</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_control"></a>control <idx> <command></strong></dt>
<dd>
<p><strong>Description:</strong> removes an idx from the party line
and sends all future input to the Tcl command given. The command
will be called with two parameters: the idx 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. If the
input text is blank (""), it indicates that the
connection has been dropped. Also, if the input text is blank,
never call killdcc on it, as it will fail with "invalid
idx".</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_sendnote"></a>sendnote <from> <to[@bot]>
<message></strong></dt>
<dd>
<p><strong>Description:</strong> simulates what happens when one
user sends a note to another</p>
<p><strong>Returns:</strong></p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>0</strong></p>
</td>
<td>
<p>the send failed</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>1</strong></p>
</td>
<td>
<p>the note was delivered locally or sent to another
bot</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>2</strong></p>
</td>
<td>
<p>the note was stored locally</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>3</strong></p>
</td>
<td>
<p>the user's notebox is too full to store a note</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>4</strong></p>
</td>
<td>
<p>a Tcl binding caught the note</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>5</strong></p>
</td>
<td>
<p>the note was stored because the user is away</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_link"></a>link [via-bot] <bot></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to link to another bot
directly. If you specify a via-bot, it tells the via-bot to
attempt the link.</p>
<p><strong>Returns:</strong> 1 if the link will be attempted; 0
otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unlink"></a>unlink <bot></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to unlink a bot from
the botnet</p>
<p><strong>Returns:</strong> 1 on success; 0 otherwise</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_encrypt"></a>encrypt <key> <string></strong></dt>
<dd>
<p><strong>Returns:</strong> encrypted string (using the currently
loaded encryption module), encoded into ASCII using base-64</p>
<p><strong>Module:</strong> encryption</p>
</dd>
<dt><strong><a name="cmd_decrypt"></a>decrypt <key>
<encrypted-base64-string></strong></dt>
<dd>
<p><strong>Returns:</strong> decrypted string (using the
currently loaded encryption module)</p>
<p><strong>Module:</strong> encryption</p>
</dd>
<dt><strong><a name="cmd_encpass"></a>encpass <password></strong></dt>
<dd>
<p><strong>Returns:</strong> encrypted string (using the currently
loaded encryption module)</p>
<p><strong>Module:</strong> encryption</p>
</dd>
<dt><strong><a name="cmd_die"></a>die [reason]</strong></dt>
<dd>
<p><strong>Description:</strong> causes the bot to log a fatal
error and exit completely. If no reason is given,
"EXIT" is used.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unames"></a>unames</strong></dt>
<dd>
<p><strong>Returns:</strong> the current operating system the
bot is using</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_dnslookup"></a>dnslookup <ip-address/hostname> <proc>
[[arg1] [arg2] ... [argN]]</strong></dt>
<dd>
<p><strong>Description:</strong> This 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 specified proc (e.g. if the lookup is already cached).</p>
<p>As soon as the request completes, the specified proc will be
called as follows: <proc> <ipaddress> <hostname>
<status> [[arg1] [arg2] ... [argN]]</p>
<p>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.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_md5"></a>md5 <string></strong></dt>
<dd>
<p><strong>Returns:</strong> the 128 bit MD5 message-digest of
the specified string</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_callevent"></a>callevent <event></strong></dt>
<dd>
<p><strong>Description:</strong> triggers the evnt bind manually
for a certain event. For example: callevent rehash.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_traffic"></a>traffic</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of sublists containing
information about the bot's traffic usage in bytes. Each
sublist contains five elements: type, in-traffic today,
in-traffic total, out-traffic today, out-traffic total (in that
order).</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_modules"></a>modules</strong></dt>
<dd>
<p><strong>Returns:</strong> a list of sublists containing
information about the bot's currently loaded modules. Each
sublist contains three elements: module, version, and
dependencies. Each dependency is also a sublist containing the
module name and version.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_loadmodule"></a>loadmodule <module></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to load the specified
module.</p>
<p><strong>Returns:</strong> "Already loaded." if the
module is already loaded, "" if successful, or the
reason the module couldn't be loaded.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unloadmodule"></a>unloadmodule <module></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to unload the specified
module.</p>
<p><strong>Returns:</strong> "No such module" if the
module is not loaded, "" otherwise.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_loadhelp"></a>loadhelp <helpfile-name></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to load the specified
help file from the help/ directory.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_unloadhelp"></a>unloadhelp <helpfile-name></strong></dt>
<dd>
<p><strong>Description:</strong> attempts to unload the specified
help file.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_reloadhelp"></a>reloadhelp</strong></dt>
<dd>
<p><strong>Description:</strong> reloads the bot's help
files.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_restart"></a>restart</strong></dt>
<dd>
<p><strong>Description:</strong> rehashes the bot, kills all
timers, reloads all modules, and reconnects the bot to the next
server in its list.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_rehash"></a>rehash</strong></dt>
<dd>
<p><strong>Description:</strong> rehashes the bot</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_stripcodes"></a>stripcodes <strip-flags> <string></strong></dt>
<dd>
<p><strong>Description:</strong> strips specified control characters
from the string given. strip-flags can be any combination of the
following:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>b</strong></p>
</td>
<td>
<p>remove all boldface codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>c</strong></p>
</td>
<td>
<p>remove all color codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>r</strong></p>
</td>
<td>
<p>remove all reverse video codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>u</strong></p>
</td>
<td>
<p>remove all underline codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>a</strong></p>
</td>
<td>
<p>remove all ANSI codes</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>g</strong></p>
</td>
<td>
<p>remove all ctrl-g (bell) codes</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Returns:</strong> the stripped string</p>
</dd>
<dt><strong><a name="cmd_matchaddr"></a>matchaddr <hostmask>
<address></strong></dt>
<dd>
<p><strong>Description:</strong> checks if the address matches the
hostmask given. The address should be in the form nick!user@host.</p>
<p><strong>Returns:</strong> 1 if the address matches the
hostmask, 0 otherwise.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_matchcidr"></a>matchcidr <block>
<address> <prefix></strong></dt>
<dd>
<p><strong>Description:</strong> performs a cidr match on the
specified ip addresses. IPv6 is supported, if enabled at compile
time.</p>
<p><strong>Returns:</strong> 1 if the address matches the
block prefix, 0 otherwise.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="cmd_matchstr"></a>matchstr <pattern>
<string></strong></dt>
<dd>
<p><strong>Description:</strong> checks if pattern matches string.
Only two wildcards are supported: '*' and '?'. Matching is
case-insensitive. This command is intended as a simplified
alternative to Tcl's string match.</p>
<p><strong>Returns:</strong> 1 if the pattern matches the string,
0 if it doesn't.</p>
<p><strong>Module:</strong> core</p>
</dd>
</dl>
</blockquote>
<p><a name="globvars"></a>10. <strong>Global variables</strong></p>
<blockquote>
<p><strong>NOTE:</strong> All config file variables are also global.</p>
<dl>
<dt><strong><a name="globvar_botnick"></a>botnick</strong></dt>
<dd>
<p><strong>Value:</strong> the current nickname the bot is using
(for example: "Valis", "Valis0", etc.)</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_botname"></a>botname</strong></dt>
<dd>
<p><strong>Value:</strong> the current nick!user@host that the
server sees (for example: "Valis!valis@crappy.com")</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_server"></a>server</strong></dt>
<dd>
<p><strong>Value:</strong> the current server's real name (what
server calls itself) and port bot is connected to (for example:
"irc.math.ufl.edu:6667") Note that this does not nececerilly match
the servers internet address.</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_serveraddress"></a>serveraddress</strong></dt>
<dd>
<p><strong>Value:</strong> the current server's internet address
(hostname or IP) and port bot is connected to. This will correspond
to the entry in server list (for example: "eu.undernet.org:6667").
Note that this does not necessarily match the name server calls
itself.</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_version"></a>version</strong></dt>
<dd>
<p><strong>Value:</strong> current bot version "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</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="globvar_numversion"></a>numversion</strong></dt>
<dd>
<p><strong>Value:</strong> the current numeric bot version (for
example: "1010201"). Numerical version is in the format
of "MNNRRPP", where:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>M</strong></p>
</td>
<td>
<p>major release number</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>NN</strong></p>
</td>
<td>
<p>minor release number</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>RR</strong></p>
</td>
<td>
<p>sub-release number</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>PP</strong></p>
</td>
<td>
<p>patch level for that sub-release</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="globvar_uptime" id="globvar_uptime"></a>uptime</strong></dt>
<dd>
<p><strong>Value:</strong> the unixtime value for when the bot
was started</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="globvar_server-online"></a>server-online</strong></dt>
<dd>
<p><strong>Value:</strong> the unixtime value for when the bot
connected to its current server</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_lastbind"></a>lastbind</strong></dt>
<dd>
<p><strong>Value:</strong> the last command binding which was
triggered. This allows you to identify which command triggered
a Tcl proc.</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="globvar_isjuped"></a>isjuped</strong></dt>
<dd>
<p><strong>Value:</strong> 1 if bot's nick is juped(437);
0 otherwise</p>
<p><strong>Module:</strong> server</p>
</dd>
<dt><strong><a name="globvar_handlen"></a>handlen</strong></dt>
<dd>
<p><strong>Value:</strong> the value of the HANDLEN define in
src/eggdrop.h</p>
<p><strong>Module:</strong> core</p>
</dd>
<dt><strong><a name="globvar_config"></a>config</strong></dt>
<dd>
<p><strong>Value:</strong> the filename of the config file Eggdrop
is currently using</p>
<p><strong>Module:</strong> core</p>
</dd>
</dl>
</blockquote>
<p><a name="bind"></a>11. <strong>Bind</strong></p>
<blockquote>
<p>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.</p>
<p>Some bind types are marked as "stackable". That means
that you can bind multiple commands to the same trigger. Normally, for
example, a bind such as '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
then msg command "stop". With stackable bindings, like
'msgm' for example, you can bind the same command to multiple
procs. When the bind is triggered, ALL of the Tcl procs that are
bound to it will be called.</p>
<p>To remove a bind, use the 'unbind' command. For example,
to remove the bind for the "stop" msg command, use
'unbind msg - stop msg:stop'.</p>
<ol type="A">
<li>
<p><a name="binda"></a><strong>Bind types</strong></p>
<ol>
<li>
<p><a name="binda_msg"></a><strong>MSG</strong></p>
<p><strong>bind msg <flags> <command>
<proc><br>
procname <nick> <user@host> <handle>
<text></strong></p>
<p><strong>Description:</strong> used for /msg commands. The
first word of the user's msg is the command, and
everything else becomes the text argument.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_dcc"></a><strong>DCC</strong></p>
<p><strong>bind dcc <flags> <command>
<proc><br>
procname <handle> <idx> <text></strong></p>
<p><strong>Description:</strong> used for partyline commands;
the command is the first word and everything else becomes
the text argument. 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.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_fil"></a><strong>FIL</strong></p>
<p><strong>bind fil <flags> <command>
<proc><br>
procname <handle> <idx> <text></strong></p>
<p><strong>Description:</strong> the same as DCC, except this
is triggered if the user is in the file area instead of the
party line</p>
<p><strong>Module:</strong> filesys</p>
</li>
<li>
<p><a name="binda_pub"></a><strong>PUB</strong></p>
<p><strong>bind pub <flags> <command>
<proc><br>
procname <nick> <user@host> <handle>
<channel> <text></strong></p>
<p><strong>Description:</strong> used for commands given on
a channel. The first word becomes the command and everything
else is the text argument.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_msgm"></a><strong>MSGM (stackable)</strong></p>
<p><strong>bind msgm <flags> <mask>
<proc><br>
procname <nick> <user@host> <handle>
<text></strong></p>
<p><strong>Description:</strong> matches the entire line of
text from a /msg with the mask. This is useful for binding
Tcl procs to words or phrases spoken anywhere within a line
of text. If the proc returns 1, Eggdrop will not log the
message that triggered this bind. MSGM binds are processed
before MSG binds. If the exclusive-binds setting is enabled,
MSG binds will not be triggered by text that a MSGM bind has
already handled.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_pubm"></a><strong>PUBM (stackable)</strong></p>
<p><strong>bind pubm <flags> <mask>
<proc><br>
procname <nick> <user@host> <handle>
<channel> <text></strong></p>
<p><strong>Description:</strong> 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 and can contain
wildcards. If the proc returns 1, Eggdrop will not log
the message that triggered this bind. PUBM binds are
processed before PUB binds. If the exclusive-binds setting
is enabled, PUB binds will not be triggered by text that a
PUBM bind has already handled.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_notc"></a><strong>NOTC (stackable)</strong></p>
<p><strong>bind notc <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<text> <dest></strong></p>
<p><strong>Description:</strong> dest will be a nickname (the
bot's nickname, obviously) or a channel name. mask is
matched against the entire notice and can contain wildcards.
It is considered a breach of protocol to respond to a /notice
on IRC, so this is intended for internal use (logging, etc.)
only. Note that server notices do not trigger the NOTC bind.
If the proc returns 1, Eggdrop will not log the message that
triggered this bind.</p>
<p>New Tcl procs should be declared as</p>
<pre>
proc notcproc {nick uhost hand text {dest ""}} {
global botnick; if {$dest == ""} {set dest $botnick}
...
}
</pre>
<p>for compatibility.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_join"></a><strong>JOIN (stackable)</strong></p>
<p><strong>bind join <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel></strong></p>
<p><strong>Description:</strong> triggered by someone joining
the channel. The mask in the bind is matched against
"#channel nick!user@host" and can contain
wildcards.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_part"></a><strong>PART (stackable)</strong></p>
<p><strong>bind part <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel> <msg></strong></p>
<p><strong>Description:</strong> triggered by someone leaving
the channel. The mask is matched against "#channel
nick!user@host" and can contain wildcards. If no part
message is specified, msg will be set to "".</p>
<p>New Tcl procs should be declared as</p>
<pre>
proc partproc {nick uhost hand chan {msg ""}} { ... }
</pre>
<p>for compatibility.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_sign"></a><strong>SIGN (stackable)</strong></p>
<p><strong>bind sign <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel> <reason></strong></p>
<p><strong>Description:</strong> 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 the mask, which is matched against '#channel
nick!user@host'.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_topc"></a><strong>TOPC (stackable)</strong></p>
<p><strong>bind topc <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel> <topic></strong></p>
<p><strong>Description:</strong> triggered by a topic change.
mask can contain wildcards and is matched against '#channel
<new topic>'.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_kick"></a><strong>KICK (stackable)</strong></p>
<p><strong>bind kick <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel> <target> <reason></strong></p>
<p><strong>Description:</strong> triggered when someone is
kicked off the channel. The mask is matched against
'#channel target reason' where the target is the nickname of
the person who got kicked (can contain 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.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_nick"></a><strong>NICK (stackable)</strong></p>
<p><strong>bind nick <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel> <newnick></strong></p>
<p><strong>Description:</strong> triggered when someone changes
nicknames. The mask is matched against '#channel newnick'
and can contain wildcards. Channel is "*" if the user isn't
on a channel (usually the bot not yet in a channel).</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_mode"></a><strong>MODE (stackable)</strong></p>
<p><strong>bind mode <flags> <mask> <proc><br>
proc-name <nick> <user@host> <handle>
<channel> <mode-change> <target></strong></p>
<p><strong>Description:</strong> mode changes are broken down
into their component parts before being sent here, so the
<mode-change> will always be a single mode, such as
"+m" or "-o". target will show the argument
of the mode change (for o/v/b/e/I) or "" if the set
mode does not take an argument. The bot's automatic
response to a mode change will happen AFTER all matching Tcl
procs are called. The mask will be matched against
'#channel +/-modes' and can contain wildcards.</p>
<p>If it is a server mode, nick will be "", user@host
is the server name, and handle is *.</p>
<p>Note that "target" was added in 1.3.17 and that
this will break Tcl scripts that were written for pre-1.3.17
Eggdrop that use the mode binding. Also, due to a typo, mode
binds were broken completely in 1.3.17 but were fixed in
1.3.18. Mode bindings are not triggered at all in 1.3.17.</p>
<p>One easy example (from guppy) of how to support the
"target" parameter in 1.3.18 and later and still
remain compatible with older Eggdrop versions is:</p>
<p>Old script looks as follows:</p>
<pre>
bind mode - * mode_proc
proc mode_proc {nick uhost hand chan mode} { ... }
</pre>
<p>To make it work with 1.3.18+ and stay compatible with older
bots, do:</p>
<pre>
bind mode - * mode_proc_fix
proc mode_proc_fix {nick uhost hand chan mode {target ""}} {
if {$target != ""} {append mode " $target"}
mode_proc $nick $uhost $hand $chan $mode
}
proc mode_proc {nick uhost hand chan mode} { ... }
</pre>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_ctcp"></a><strong>CTCP (stackable)</strong></p>
<p><strong>bind ctcp <flags> <keyword>
<proc><br>
proc-name <nick> <user@host> <handle>
<dest> <keyword> <text></strong></p>
<p><strong>Description:</strong> dest will be a nickname (the
bot's nickname, obviously) or channel name. keyword is
the ctcp command (which can contain wildcards), and text may
be empty. If the proc returns 0, the bot will attempt its
own processing of the ctcp command.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_ctcr"></a><strong>CTCR (stackable)</strong></p>
<p><strong>bind ctcr <flags> <keyword>
<proc><br>
proc-name <nick> <user@host> <handle>
<dest> <keyword> <text></strong></p>
<p><strong>Description:</strong> just like ctcp, but this is
triggered for a ctcp-reply (ctcp embedded in a notice instead
of a privmsg)</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_raw"></a><strong>RAW (stackable)</strong></p>
<p><strong>bind raw <flags> <keyword-mask>
<proc><br>
procname <from> <keyword> <text></strong></p>
<p><strong>Description:</strong> previous versions of Eggdrop
required a special compile option to enable this binding, but
it's now standard. The keyword is either a numeric, like
"368", or a keyword, such as "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 unexpected behavior in some
cases).</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_bot"></a><strong>BOT</strong></p>
<p><strong>bind bot <flags> <command>
<proc><br>
proc-name <from-bot> <command>
<text></strong></p>
<p><strong>Description:</strong> triggered by a message coming
from another bot in the botnet. The first word is the command
and the rest becomes the text argument; flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_chon"></a><strong>CHON (stackable)</strong></p>
<p><strong>bind chon <flags> <mask> <proc><br>
proc-name <handle> <idx></strong></p>
<p><strong>Description:</strong> 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 is matched against the handle and supports wildcards.
This is NOT triggered when someone returns from the file area,
etc.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_chof"></a><strong>CHOF (stackable)</strong></p>
<p><strong>bind chof <flags> <mask> <proc><br>
proc-name <handle> <idx></strong></p>
<p><strong>Description:</strong> triggered when someone leaves
the party line to disconnect from the bot. mask is matched
against the handle and can contain wildcards. Note that the
connection may have already been dropped by the user, so
don't send output to the idx.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_sent"></a><strong>SENT (stackable)</strong></p>
<p><strong>bind sent <flags> <mask> <proc><br>
proc-name <handle> <nick>
<path/to/file></strong></p>
<p><strong>Description:</strong> 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 and supports wildcards. 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').</p>
<p><strong>Module:</strong> transfer</p>
</li>
<li>
<p><a name="binda_rcvd"></a><strong>RCVD (stackable)</strong></p>
<p><strong>bind rcvd <flags> <mask> <proc><br>
proc-name <handle> <nick>
<path/to/file></strong></p>
<p><strong>Description:</strong> triggered after a user
uploads a file successfully. mask is matched against the
user's handle. nick is the IRC nickname 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).</p>
<p><strong>Module:</strong> transfer</p>
</li>
<li>
<p><a name="binda_chat"></a><strong>CHAT (stackable)</strong></p>
<p><strong>bind chat <flags> <mask> <proc><br>
proc-name <handle> <channel#>
<text></strong></p>
<p><strong>Description:</strong> when a user says something on
the botnet, it invokes this binding. Flags are ignored; handle
could be a user on this bot ("DronePup") or on
another bot ("Eden@Wilde") and therefore you can't
rely on a local user record. The mask is checked against the
entire line of text and supports wildcards.</p>
<p><strong>NOTE:</strong> If a BOT says something on the botnet,
the BCST bind is invoked instead.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_link"></a><strong>LINK (stackable)</strong></p>
<p><strong>bind link <flags> <mask> <proc><br>
proc-name <botname> <via></strong></p>
<p><strong>Description:</strong> 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 botnetnick of the bot that linked and
supports wildcards. flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_disc"></a><strong>DISC (stackable)</strong></p>
<p><strong>bind disc <flags> <mask> <proc><br>
proc-name <botname></strong></p>
<p><strong>Description:</strong> triggered when a bot
disconnects from the botnet for whatever reason. Just like
the link bind, flags are ignored; mask is matched against
the botnetnick of the bot that unlinked. Wildcards are
supported in mask.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_splt"></a><strong>SPLT (stackable)</strong></p>
<p><strong>bind splt <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel></strong></p>
<p><strong>Description:</strong> 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 on
some networks); mask may contain wildcards and is matched
against '#channel nick!user@host'. Anyone who is SPLT
will trigger a REJN or SIGN within the next wait-split
(defined in the config file) minutes.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_rejn"></a><strong>REJN (stackable)</strong></p>
<p><strong>bind rejn <flags> <mask> <proc><br>
procname <nick> <user@host> <handle>
<channel></strong></p>
<p><strong>Description:</strong> someone who was split has
rejoined. mask can contain wildcards, and is matched against
'#channel nick!user@host'.</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_filt"></a><strong>FILT (stackable)</strong></p>
<p><strong>bind filt <flags> <mask> <proc><br>
procname <idx> <text></strong></p>
<p><strong>Description:</strong> party line and file system
users have their text sent through filt before being
processed. If the proc returns a blank string, the text is
considered parsed. Otherwise, the bot will use the text
returned from the proc and continue parsing that.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_need"></a><strong>NEED (stackable)</strong></p>
<p><strong>bind need <flags> <mask> <proc><br>
procname <channel> <type></strong></p>
<p><strong>Description:</strong> this bind is triggered on
certain events, like when the bot needs operator status or
the key for a channel. The types are: op, unban, invite,
limit, and key; the mask is matched against '#channel
type' and can contain wildcards. flags are ignored.</p>
<p>Example:</p>
<p>bind need - "% op" needop < handles only need
op<br>
bind need - "*" needall < handles all needs</p>
<p><strong>Module:</strong> irc</p>
</li>
<li>
<p><a name="binda_flud"></a><strong>FLUD (stackable)</strong></p>
<p><strong>bind flud <flags> <type> <proc><br>
procname <nick> <user@host> <handle>
<type> <channel></strong></p>
<p><strong>Description:</strong> 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 types are: pub, msg, join, or ctcp (and can
be masked to "*" for the bind); flags are ignored.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_note"></a><strong>NOTE (stackable)</strong></p>
<p><strong>bind note <flags> <mask> <proc><br>
procname <from> <to> <text></strong></p>
<p><strong>Description:</strong> 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
processed. The mask is matched against the receiving handle
and supports wildcards. If the proc returns 1, Eggdrop will
not process the note any further. Flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_act"></a><strong>ACT (stackable)</strong></p>
<p><strong>bind act <flags> <mask> <proc><br>
proc-name <handle> <channel#>
<action></strong></p>
<p><strong>Description:</strong> when someone does an action
on the botnet, it invokes this binding. flags are ignored;
the mask is matched against the text of the action and can
support wildcards.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_wall"></a><strong>WALL (stackable)</strong></p>
<p><strong>bind wall <flags> <mask> <proc><br>
proc-name <handle> <msg></strong></p>
<p><strong>Description:</strong> when the bot receives a
wallops, it invokes this binding. flags are ignored; the mask
is matched against the text of the wallops msg. Note that RFC
shows the server name as a source of the message, whereas many
IRCds send the nick!user@host of the actual sender, thus,
Eggdrop will not parse it at all, but simply pass it to bind
in its original form. If the proc returns 1, Eggdrop will not
log the message that triggered this bind.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_bcst"></a><strong>BCST (stackable)</strong></p>
<p><strong>bind bcst <flags> <mask> <proc><br>
proc-name <botname> <channel#>
<text></strong></p>
<p><strong>Description:</strong> when a bot broadcasts something
on the botnet (see 'dccbroadcast' above), it invokes
this binding. flags are ignored; the mask is matched against
the message text and can contain wildcards. 'channel'
argument will always be '-1' since broadcasts are not
directed to any partyline channel.</p>
<p>It is also invoked when a BOT (not a person, as with the CHAT
bind) 'says' something on a channel. In this case, the
'channel' argument will be a valid channel, and not
'-1'.
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_chjn"></a><strong>CHJN (stackable)</strong></p>
<p><strong>bind chjn <flags> <mask> <proc><br>
proc-name <botname> <handle> <channel#>
<flag> <idx> <user@host></strong></p>
<p><strong>Description:</strong> when someone joins a botnet
channel, it invokes this binding. The mask is matched against
the channel and can contain wildcards. flag is one of: *
(owner), + (master), @ (op), or % (botnet master).
Flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_chpt"></a><strong>CHPT (stackable)</strong></p>
<p><strong>bind chpt <flags> <mask> <proc><br>
proc-name <botname> <handle> <idx>
<channel#></strong></p>
<p><strong>Description:</strong> when someone parts a botnet
channel, it invokes this binding. The mask is matched against
the channel and can contain wildcards. Flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_time"></a><strong>TIME (stackable)</strong></p>
<p><strong>bind time <flags> <mask> <proc><br>
proc-name <minute> <hour> <day> <month>
<year></strong></p>
<p><strong>Description:</strong> allows you to schedule
procedure calls at certain times. mask matches 5 space
separated integers of the form: "minute hour day month
year". minute, hour, day, month have a zero padding so
they are exactly two characters long; year is four characters.
Flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_away"></a><strong>AWAY (stackable)</strong></p>
<p><strong>bind away <flags> <mask> <proc><br>
proc-name <botname> <idx> <text></strong></p>
<p><strong>Description:</strong> triggers when a user goes
away or comes back on the botnet. text is the reason than has
been specified (text is "" when returning). mask is
matched against the botnet-nick of the bot the user is
connected to and supports wildcards. flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_load"></a><strong>LOAD (stackable)</strong></p>
<p><strong>bind load <flags> <mask> <proc><br>
proc-name <module></strong></p>
<p><strong>Description:</strong> triggers when a module is
loaded. mask is matched against the name of the loaded module
and supports wildcards; flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_unld"></a><strong>UNLD (stackable)</strong></p>
<p><strong>bind unld <flags> <mask> <proc><br>
proc-name <module></strong></p>
<p><strong>Description:</strong> triggers when a module is
unloaded. mask is matched against the name of the unloaded
module and supports wildcards; flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_nkch"></a><strong>NKCH (stackable)</strong></p>
<p><strong>bind nkch <flags> <mask> <proc><br>
proc-name <oldhandle> <newhandle></strong></p>
<p><strong>Description:</strong> triggered whenever a local
user's handle is changed (in the userfile). mask is
matched against the user's old handle and can contain
wildcards; flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_evnt"></a><strong>EVNT (stackable)</strong></p>
<p><strong>bind evnt <flags> <type> <proc><br>
proc-name <type></strong></p>
<p><strong>Description:</strong> Description: triggered whenever
one of these events happen; flags are ignored; valid events
are:</p>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>sighup</strong></p>
</td>
<td>
<p>called on a kill -HUP <pid></p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>sigterm</strong></p>
</td>
<td>
<p>called on a kill -TERM <pid></p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>sigill</strong></p>
</td>
<td>
<p>called on a kill -ILL <pid></p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>sigquit</strong></p>
</td>
<td>
<p>called on a kill -QUIT <pid></p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>save</strong></p>
</td>
<td>
<p>called when the userfile is saved</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>rehash</strong></p>
</td>
<td>
<p>called just after a rehash</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>prerehash</strong></p>
</td>
<td>
<p>called just before a rehash</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>prerestart</strong></p>
</td>
<td>
<p>called just before a restart</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>logfile</strong></p>
</td>
<td>
<p>called when the logs are switched daily</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>loaded</strong></p>
</td>
<td>
<p>called when the bot is done loading</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>userfile-loaded</strong></p>
</td>
<td>
<p>called after userfile has been loaded</p>
</td>
</tr>
</table>
</blockquote>
<blockquote>
<table>
<tr valign="top">
<td>
<p><strong>connect-server</strong></p>
</td>
<td>
<p>called just before we connect to an IRC server</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>init-server</strong></p>
</td>
<td>
<p>called when we actually get on our IRC server</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>disconnect-server</strong></p>
</td>
<td>
<p>called when we disconnect from our IRC server</p>
</td>
</tr>
</table>
</blockquote>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_lost"></a><strong>LOST (stackable)</strong></p>
<p><strong>bind lost <flags> <mask> <proc><br>
proc-name <handle> <nick> <path>
<bytes-transferred> <length-of-file></strong></p>
<p><strong>Description:</strong> triggered when a DCC SEND
transfer gets lost, such as when the connection is
terminated before all data was successfully sent/received.
This is typically caused by a user abort.</p>
<p><strong>Module:</strong> transfer</p>
</li>
<li>
<p><a name="binda_tout"></a><strong>TOUT (stackable)</strong></p>
<p><strong>bind tout <flags> <mask> <proc><br>
proc-name <handle> <nick> <path>
<bytes-transferred> <length-of-file></strong></p>
<p><strong>Description:</strong> triggered when a DCC SEND
transfer times out. This may either happen because the dcc
connection was not accepted or because the data transfer
stalled for some reason.</p>
<p><strong>Module:</strong> transfer</p>
</li>
<li>
<p><a name="binda_out"></a><strong>OUT (stackable)</strong></p>
<p><strong>bind out <flags> <mask> <proc><br>
proc-name <queue> <text> <queued|sent>
</strong></p>
<p><strong>Description:</strong> triggered whenever output is sent
to the server. Normally the event will occur twice for each line
sent: once before entering a server queue and once after the
message is actually sent. This allows for more flexible logging of
server output and introduces the ability to cancel messages.
Mask is matched against "queue status", where status is either
'queued' or 'sent'. Queues are: mode, server, help, noqueue.
noqueue is only used by the putnow tcl command.</p>
<p><strong>Module:</strong> server</p>
</li>
<li>
<p><a name="binda_cron"></a><strong>CRON (stackable)</strong></p>
<p><strong>bind cron <flags> <mask> <proc><br>
proc-name <minute> <hour> <day> <month>
<weekday></strong></p>
<p><strong>Description:</strong> similar to bind TIME, but the
mask is evaluated as a cron expression, e.g.
"16/2 */2 5-15 7,8,9 4". It can contain up to five
fields: minute, hour, day, month, weekday; delimited by
whitespace. Week days are represented as 0-6, except Sunday
which can be either 0 or 7. Symbolic names are not supported. The
bind will be triggered if the mask matches all of the fields,
except that if both day and weekday are not '*', only one of them
is required to match. If any number of fields are omitted at the
end, the match will proceed as if they were '*'. All cron
operators are supported. Please refer to the crontab manual for
their meanings. Flags are ignored.</p>
<p><strong>Module:</strong> core</p>
</li>
<li>
<p><a name="binda_log"></a><strong>LOG (stackable)</strong></p>
<p><strong>bind log <flags> <mask> <proc><br>
proc-name <level> <channel> <message></strong>
</p>
<p><strong>Description:</strong> triggered whenever a message
is sent to a log. The mask is matched against "channel
text". The level argument to the proc will contain the
level(s) the message is sent to, or '*' if the message is sent
to all log levels at once. If the message wasn't sent to a
specific channel, channel will be set to '*'.</p>
<p><strong>Module:</strong> core</p>
</li>
</ol>
</li>
<li>
<p><a name="bindb"></a><strong>Return Values</strong></p>
<p>Several bindings pay attention to the value you return from
the proc (using 'return <value>'). Usually, they
expect a 0 or 1, and returning an empty return is interpreted
as a 0. Be aware if you omit the return statement, the result
of the last Tcl command executed will be returned by the proc.
This will not likely produce the results you intended (this is
a "feature" of Tcl).</p>
<p>Here's a list of the bindings that use the return value
from procs they trigger:</p>
<ol>
<li>
<p><a name="bindb_msg"></a><strong>MSG</strong></p>
<p>Return 1 to make Eggdrop log the command as:</p>
<blockquote>
<p>(nick!user@host) !handle! command</p>
</blockquote>
</li>
<li>
<p><a name="bindb_dcc"></a><strong>DCC</strong></p>
<p>Return 1 to make Eggdrop log the command as:</p>
<blockquote>
<p>#handle# command</p>
</blockquote>
</li>
<li>
<p><a name="bindb_fil"></a><strong>FIL</strong></p>
<p>Return 1 to make Eggdrop log the command as:</p>
<blockquote>
<p>#handle# files: command</p>
</blockquote>
</li>
<li>
<p><a name="bindb_pub"></a><strong>PUB</strong></p>
<p>Return 1 to make Eggdrop log the command as:</p>
<blockquote>
<p><<nick>> !handle! command</p>
</blockquote>
</li>
<li>
<p><a name="bindb_ctcp"></a><strong>CTCP</strong></p>
<p>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).</p>
</li>
<li>
<p><a name="bindb_filt"></a><strong>FILT</strong></p>
<p>Return "" to indicate the text has been processed, and the
bot should just ignore it. Otherwise, it will treat the text
like any other.</p>
</li>
<li>
<p><a name="bindb_flud"></a><strong>FLUD</strong></p>
<p>Return 1 to ask the bot not to take action on the flood.
Otherwise it will do its normal punishment.</p>
</li>
<li>
<p><a name="bindb_raw"></a><strong>RAW</strong></p>
<p>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.</p>
</li>
<li>
<p><a name="bindb_chon"></a><strong>CHON</strong></p>
<p>Return 1 to ask the bot not to process the partyline join
event.</p>
</li>
<li>
<p><a name="bindb_chof"></a><strong>CHOF</strong></p>
<p>Return 1 to ask the bot not to process the partyline part
event.</p>
</li>
<li>
<p><a name="bindb_wall"></a><strong>WALL</strong></p>
<p>Return 1 to make Eggdrop not log the message that
triggered this bind.</p>
</li>
<li>
<p><a name="bindb_note"></a><strong>NOTE</strong></p>
<p>Return 1 to make Eggdrop not process the note any
further. This includes stacked note bindings that would
be processed after this one, as well as the built-in
eggdrop note handling routines.</p>
</li>
<li>
<p><a name="bindb_msgm"></a><strong>MSGM</strong></p>
<p>Return 1 to make Eggdrop not log the message that
triggered this bind.</p>
</li>
<li>
<p><a name="bindb_pubm"></a><strong>PUBM</strong></p>
<p>Return 1 to make Eggdrop not log the message that
triggered this bind.</p>
</li>
<li>
<p><a name="bindb_notc"></a><strong>NOTC</strong></p>
<p>Return 1 to make Eggdrop not log the message that
triggered this bind.</p>
</li>
<li>
<p><a name="bindb_out"></a><strong>OUT</strong></p>
<p>Return 1 to make Eggdrop drop the message instead of
sending it. Only meaningful for messages with status
"queued".</p>
</li>
</ol>
</li>
</ol>
</blockquote>
<p><a name="control"></a>12. <strong>Control procedures</strong></p>
<blockquote>
<p>Using the 'control' command, you can put a DCC connection
(or outgoing TCP connection) in control of a script. All text received
from the connection is sent to the proc you specify. All outgoing text
should be sent with 'putdcc'.</p>
<p>The control procedure is called with these parameters:</p>
<blockquote>
<p>procname <idx> <input-text></p>
</blockquote>
<p>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.</p>
<p>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. Don't call killdcc on the idx when text is blank, it
will always fail with "invalid idx".</p>
<p>If you want to hand control of your connection back to Eggdrop,
your proc should return 1. Otherwise, return 0 to retain
control.</p>
</blockquote>
<p><a name="tcp"></a>13. <strong>TCP connections</strong></p>
<blockquote>
<p>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 on.</p>
<p>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.</p>
<p>To initiate an outgoing connection, use:</p>
<blockquote>
<p>set idx [connect <hostname> <port>]</p>
</blockquote>
<p>$idx now contains a new DCC entry for the outgoing connection.</p>
<p>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:</p>
<ul>
<li>
<p>assume the connection succeeded immediately</p>
</li>
<li>
<p>if the connection failed, an EOF will arrive for that idx</p>
</li>
</ul>
<p>The only time a 'connect' will return an error is if you
give it a hostname that can't be resolved (this is considered a
"DNS error"). Otherwise, it will appear to have succeeded.
If the connection failed, you will immediately get an EOF.</p>
<p>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. The 'killdcc' command will fail with "invalid
idx" if you attempt to use it on a closed socket.</p>
<p>To create a listen port, use:</p>
<blockquote>
<p>listen <port> script <proc></p>
</blockquote>
<p>Procs should be declared as:</p>
<blockquote>
<p>procname <newidx></p>
</blockquote>
<p>For example:</p>
<pre>
listen 6687 script listen:grab
proc listen:grab {newidx} {
control $newidx listen:control
}
</pre>
<p>When a new connection arrives in port 6687, Eggdrop will create a
new idx for the connection. That idx is sent to 'listen:grab'.
The proc immediately puts this idx under control. Once
'listen:grab' has been called, the idx behaves exactly like
an outgoing connection would.</p>
<p>The best way to learn how to use these commands is to find a
script that uses them and follow it carefully. However, hopefully
this has given you a good start.</p>
</blockquote>
<p><a name="matchchars"></a>14. <strong>Match characters</strong></p>
<blockquote>
<p>Many of the bindings allow match characters in the arguments. Here
are the four special characters:</p>
<table>
<tr valign="top">
<td>
<p><strong>?</strong></p>
</td>
<td>
<p>matches any single character</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>*</strong></p>
</td>
<td>
<p>matches 0 or more characters of any type</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>%</strong></p>
</td>
<td>
<p>matches 0 or more non-space characters (can be used to match
a single word)</p>
</td>
</tr>
<tr valign="top">
<td>
<p><strong>~</strong></p>
</td>
<td>
<p>matches 1 or more space characters (can be used for whitespace
between words)</p>
</td>
</tr>
</table>
</blockquote>
<hr>
<p><em>Copyright © 1997 Robey Pointer<br>
Copyright © 1999 - 2011 Eggheads Development Team
<a href="http://www.eggheads.org/"> Eggheads Development Team</a></em></p>
</body>
</html>