Comandos Tcl para Eggdrop

Comandos tcl para eggdrop

 

Comandos Tcl para Eggdrop

Esta documentación es todo lo que necesita un desarrollador para poder hacer scripts para eggdrop. La coleción de scripts que se va ampliando está aquí
Ésta es una lista exhaustiva de todos los comandos Tcl agregados a Eggdrop. Todos los comandos normales de Tcl también están incluídos en eggdrop, y por supuesto, puedes usarlos para manipular características del bot. Aquí están listados por categoría.
Esta lista es exacta para Eggdrop v1.6.20. Scripts escritos para versiones 1.3/1.4 probablemente funcionarán con pequeñas modificaciones dependiendo del script. Los scripts escritos para versines v0.9,v1.0,v1.1 o v1.2 probablemente no funcionarán sin modificarlos. Los comandos que han sido cambiados en esta versión (o que son nuevos) son marcados con un asterisco (*).
  1. Comandos de salida
  2. Comandos de registro de usuarios
  3. Comandos de canales
  4. Comandos DCC
  5. Módulo Notas
  6. Módulo assoc
  7. Módulo comprimir
  8. Módulo sistema de ficheros
  9. Comandos misceláneos
  10. Variables globales
  11. Bind
    1. Tipos de bind
    2. Valores de retorno
  12. Control de procesos
  13. Conexiones TCP
  14. Caracteres de búsqueda

1. Comandos de salida

putserv <texto> [opciones]
Descripción: envía texto al servidor, como ‘.dump’ (intencionado para comandos directos al servidor); el texto de salida es enviado a una cola de envio por lo que el bot no se va a flodear a sí mismo.
Opciones:
-next: impone el mensaje a la primera posición de la cola de envio
-normal: sin efectos
Devuelve: nada
Módulo: server
puthelp <texto> [opciones]
Descripción: envía texto al servidor, como ‘putserv’, pero éste usa una cola de envio diferente intencionado para enviar mensajes a canales o usuarios.
Opciones:
-next: impone el mensaje a la primera posición de la cola de envio
-normal: sin efectos
Devuelve: nada
Módulo: server
putquick <texto> [opciones]
Descripción: envía texto al servidor, como ‘putserv’, pero usa una cola diferencia (y más rápida).
Opciones:
-next:
-normal: sin efectos
Devuelve: nada
Módulo: server
putkick <canal> <nick,nick,…> [razón]
Descripción: envía kicks al servidor e intenta poner tantos nicks en un solo kick como sea posible.
Devuelve: nada
Módulo: irc
putlog <texto>
Descripción: envía texto a los ficheros logs del bot, marcados como ‘misc’ (o)
Devuelve: nada
Módulo: core
putcmdlog <texto>
Descripción: envía texto a los ficheros logs del bot, marcados como ‘comando’ (c)
Devuelve: nada
Módulo: core
putxferlog <texto>
Descripción: envía texto a los ficheros logs del bot, marcados como ‘file-area’ (x)
Devuelve: nada
Módulo: core
putloglev <level(s)> <canal> <texto>
Descripción: envía texto a los ficheros logs del bot, etiquetados con todos los nivels válidos especificados. Usa “*”  para indicar todos los niveles de log.
Devuelve: nada
Módulo: core
dumpfile <nick> <filename>
Descripción: dumps file from the help/texto 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.
Devuelve: nada
Módulo: core
queuesize [cola]
Devuelve: el número de mensajes de todas las olas. Si se especifica una, devolverá el tamaño de esa cola. Nombres de cola válidos: mode, server, help.
Módulo: server
clearqueue <cola>
Descripción: borra todos los mensajes de una cola. Argumentos válidos: mode, server, help, or all.
Devuelve: el número de líneas eliminadas de la cola especificada.
Módulo: server

2. Comandos de manipulación de registros de usuario

countusers

Devuelve: número de usuarios que hay en la base de datos del bot.
Módulo: core
validuser <handle>
Devuelve: 1 si el usuario existe; 0 en caso contrario.
Módulo: core
finduser <nick!user@host>
Descripción: encuentra el usuario que coincida con la máscara especificada nick!user@host
Devuelve: el nombre de usuario encontrado, o “*” si no existe
Módulo: core
userlist [flags]
Devuelve: una lista de usuarios en el bot. Puedes hacer búsquedas por flag aquí ([global]{&/|}[chan]{&/|}[bot]). ‘&’ specifies “y”; ‘|’ specifies “o”.
Módulo: core
passwdok <handle> <pass>
Descripción: comprueba la contraseña dada con la del usuario especificado. Comprueba contra la contraseña “” (una cadena de texto vacía) o “-” para encontrar un usuario que no tiene su clave configurada.
Devuelve: 1 si la contraseña coincide para ese usuario, 0 en caso contrario.
Módulo: core
getuser <handle> <entry-type> [extra info]
Descripción: una interfaz para el soporte de un fichero de usuarios genérico. Entradas válidas:
BOTFL devuelve los flags actuales en el bot para el usuario (solo para bots)
BOTADDR devuelve una lista de direcciones de bot, puerto telnet y puerto transmisión (solo para bots)
HOSTS devuelve una lista de hosts para el usuario
LASTON devuelve una lista con la fecha en segundos (formato unixtime) de la última vez que se vio y dónde. LASTON #canal devuelve de la última vez que se vio al usuario en el canal o 0 si no existe información al respecto.
INFO devuelve la línea de información global del usuario.
XTRA devuelve información XTRA del usuario.
COMMENT devuelve el comentario para el usuario solo visible para masters.
EMAIL devuelve la dirección email del usuario.
URL devuelve la url del usuario.
HANDLE devuelve el nombre de handle del usuario si está guardado en el fichero de usuarios.
PASS devuelve la contraseña encriptada del usuario.
Devuelve: información específica para cada tipo de entrada.
Módulo: core
setuser <handle> <entry-type> [extra info]
Descripción: 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.
HOSTS if used with no third arg, all hosts for the user will be cleared. Otherwise, *1* hostmask is added 😛
LASTON 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> <canal>” sets a users LASTON time for a channel (if it is a valid channel).
PASS sets a users password (no third arg will clear it)
Devuelve: nada
Módulo: core
chhandle <old-handle> <new-handle>
Descripción: changes a user’s handle
Devuelve: 1 on success; 0 if the new handle is invalid or already used, or if the user can’t be found
Módulo: core
chattr <handle> [changes [channel]]
Descripción: 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.
Devuelve: 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.
Módulo: core
botattr <handle> [changes [channel]]
Descripción: similar to chattr except this modifies bot flags rather than normal user attributes.
Devuelve: 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.
Módulo: core
matchattr <handle> <flags> [channel]
Devuelve: 1 if the specified user has the specified flags; 0 otherwise
Módulo: core
adduser <handle> [hostmask]
Descripción: creates a new user entry with the handle and hostmask given (with no password and the default flags)
Devuelve: 1 if successful; 0 if the handle already exists
Módulo: core
addbot <handle> <address>
Descripción: adds a new bot to the userlist with the handle and bot address given (with no password and no flags)
Devuelve: 1 if successful; 0 if the bot already exists
Módulo: core
deluser <handle>
Descripción: attempts to erase the user record for a handle
Devuelve: 1 if successful, 0 if no such user exists
Módulo: core
delhost <handle> <hostmask>
Descripción: deletes a hostmask from a user’s host list
Devuelve: 1 on success; 0 if the hostmask (or user) doesn’t exist
Módulo: core
addchanrec <handle> <canal>
Descripción: adds a channel record for a user
Devuelve: 1 on success; 0 if the user or channel does not exist
Módulo: channels
delchanrec <handle> <canal>
Descripción: removes a channel record for a user. This includes all associated channel flags.
Devuelve: 1 on success; 0 if the user or channel does not exist
Módulo: channels
haschanrec <handle> <canal>
Devuelve: 1 if the given handle has a chanrec for the specified channel; 0 otherwise
Módulo: channels
getchaninfo <handle> <canal>
Devuelve: info line for a specific channel (behaves just like ‘getinfo’)
Módulo: channels
setchaninfo <handle> <canal> <info>
Descripción: sets the info line on a specific channel for a user. If info is “none”, it will be removed.
Devuelve: nada
Módulo: channels
newchanban <canal> <ban> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the ban to be always active on a channel, even with dynamicbans on
none: no effect
Devuelve: nada
Módulo: channels
newban <ban> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the ban to be always active on a channel, even with dynamicbans on
none: no effect
Devuelve: nada
Módulo: channels
newchanexempt <canal> <exempt> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the exempt to be always active on a channel, even with dynamicexempts on
none: no effect
Devuelve: nada
Módulo: channels
newexempt <exempt> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the exempt to be always active on a channel, even with dynamicexempts on
none: no effect
Devuelve: nada
Módulo: channels
newchaninvite <canal> <invite> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the invite to be always active on a channel, even with dynamicinvites on
none: no effect
Devuelve: nada
Módulo: channels
newinvite <invite> <creator> <comment> [lifetime] [opciones]
Descripción: 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.
Opciones:
sticky: forces the invite to be always active on a channel, even with dynamicinvites on
none: no effect
Devuelve: nada
Módulo: channels
stick <banmask> [channel]
Descripción: makes a ban sticky, or, if a channel is specified, then it is set sticky on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
unstick <banmask> [channel]
Descripción: makes a ban no longer sticky, or, if a channel is specified, then it is unstuck on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
stickexempt <exemptmask> [channel]
Descripción: makes an exempt sticky, or, if a channel is specified, then it is set sticky on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
unstickexempt <exemptmask> [channel]
Descripción: makes an exempt no longer sticky, or, if a channel is specified, then it is unstuck on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
stickinvite <invitemask> [channel]
Descripción: makes an invite sticky, or, if a channel is specified, then it is set sticky on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
unstickinvite <invitemask> [channel]
Descripción: makes an invite no longer sticky, or, if a channel is specified, then it is unstuck on that channel only.
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killchanban <canal> <ban>
Descripción: removes a ban from the ban list for a channel
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killban <ban>
Descripción: removes a ban from the global ban list
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killchanexempt <canal> <exempt>
Descripción: removes an exempt from the exempt list for a channel
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killexempt <exempt>
Descripción: removes an exempt from the global exempt list
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killchaninvite <canal> <invite>
Descripción: removes an invite from the invite list for a channel
Devuelve: 1 on success; 0 otherwise
Módulo: channels
killinvite <invite>
Descripción: removes an invite from the global invite list
Devuelve: 1 on success; 0 otherwise
Módulo: channels
ischanjuped <canal>
Devuelve: 1 if the channel is juped, and the bot is unable to join; 0 otherwise
Módulo: channels
isban <ban> [channel]
Devuelve: 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.
Módulo: channels
ispermban <ban> [channel]
Devuelve: 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.
Módulo: channels
isexempt <exempt> [channel]
Devuelve: 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.
Módulo: channels
ispermexempt <exempt> [channel]
Devuelve: 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.
Módulo: channels
isinvite <invite> [channel]
Devuelve: 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.
Módulo: channels
isperminvite <invite> [channel]
Devuelve: 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.
Módulo: channels
isbansticky <ban> [channel]
Devuelve: 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.
Módulo: channels
isexemptsticky <exempt> [channel]
Devuelve: 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.
Módulo: channels
isinvitesticky <invite> [channel]
Devuelve: 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.
Módulo: channels
matchban <nick!user@host> [channel]
Devuelve: 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.
Módulo: channels
matchexempt <nick!user@host> [channel]
Devuelve: 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.
Módulo: channels
matchinvite <nick!user@host> [channel]
Devuelve: 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.
Módulo: channels
banlist [channel]
Devuelve: 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.
Módulo: channels
exemptlist [channel]
Devuelve: 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.
Módulo: channels
invitelist [channel]
Devuelve: 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.
Módulo: channels
newignore <hostmask> <creator> <comment> [lifetime]
Descripción: 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.
Devuelve: nada
Módulo: core
killignore <hostmask>
Descripción: removes an entry from the ignore list
Devuelve: 1 if successful; 0 otherwise
Módulo: core
ignorelist
Devuelve: a list of ignores. Each entry is a sublist containing: hostmask, comment, expiration timestamp, time added, and creator. The timestamps are in unixtime format.
Módulo: core
isignore <hostmask>
Devuelve: 1 if the ignore is in the list; 0 otherwise
Módulo: core
save
Descripción: writes the user and channel files to disk
Devuelve: nada
Módulo: core
reload
Descripción: loads the userfile from disk, replacing whatever is in memory
Devuelve: nada
Módulo: core
backup
Descripción: 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.
Devuelve: nada
Módulo: core
getting-users
Devuelve: 1 if the bot is currently downloading a userfile from a sharebot (and hence, user records are about to drastically change); 0 if not
Módulo: core

3. Channel commands

channel add <name> [opción-list]
Descripción: adds a channel record for the bot to monitor. The full list of possible opciones are given in doc/settings/mod.channels. Note that the channel opciones must be in a list (enclosed in {}).
Devuelve: nada
Módulo: channels
channel set <name> <opciones…>
Descripción: sets opciones for the channel specified. The full list of possible opciones are given in doc/settings/mod.channels.
Devuelve: nada
Módulo: channels
channel info <name>
Devuelve: a list of info about the specified channel’s settings.
Módulo: channels
channel get <name> <setting>
Devuelve: The value of the setting you specify. For flags, a value of 0 means it is disabled (-), and non-zero means enabled (+).
Módulo: channels
channel remove <name>
Descripción: removes a channel record from the bot and makes the bot no longer monitor the channel
Devuelve: nada
Módulo: channels
savechannels
Descripción: saves the channel settings to the channel-file if one is defined.
Devuelve: nada
Módulo: channels
loadchannels
Descripción: reloads the channel settings from the channel-file if one is defined.
Devuelve: nada
Módulo: channels
channels
Devuelve: a list of the channels the bot has a channel record for
Módulo: channels
channame2dname <channel-name>
chandname2name <channel-dname>
Descripción: 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”.
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.
If you only have the chan dname and want to directly send raw server commands, use the chandname2name command.
For non-!channels, chan dname and chan name are the same.
Módulo: irc
isbotnick <nick>
Devuelve: 1 if the nick matches the botnick; 0 otherwise
Módulo: server
botisop [channel]
Devuelve: 1 if the bot has ops on the specified channel (or any channel if no channel is specified); 0 otherwise
Módulo: irc
botishalfop [channel]
Devuelve: 1 if the bot has halfops on the specified channel (or any channel if no channel is specified); 0 otherwise
Módulo: irc
botisvoice [channel]
Devuelve: 1 if the bot has a voice on the specified channel (or any channel if no channel is specified); 0 otherwise
Módulo: irc
botonchan [channel]
Devuelve: 1 if the bot is on the specified channel (or any channel if no channel is specified); 0 otherwise
Módulo: irc
isop <nickname> [channel]
Devuelve: 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
Módulo: irc
ishalfop <nickname> [channel]
Devuelve: 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
Módulo: irc
wasop <nickname> <canal>
Devuelve: 1 if someone that just got opped/deopped in the chan had op before the modechange; 0 otherwise
Módulo: irc
washalfop <nickname> <canal>
Devuelve: 1 if someone that just got halfopped/dehalopped in the chan had halfop before the modechange; 0 otherwise
Módulo: irc
isvoice <nickname> [channel]
Devuelve: 1 if someone by that nickname is on the channel (or any channel if no channel is specified) and has voice (+v); 0 otherwise
Módulo: irc
onchan <nickname> [channel]
Devuelve: 1 if someone by that nickname is on the specified channel (or any channel if none is specified); 0 otherwise
Módulo: irc
nick2hand <nickname> [channel]
Devuelve: 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.
Módulo: irc
hand2nick <handle> [channel]
Devuelve: 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.
Módulo: irc
handonchan <handle> [channel]
Devuelve: 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
Módulo: irc
ischanban <ban> <canal>
Devuelve: 1 if the specified ban is on the given channel’s ban list (not the bot’s banlist for the channel)
Módulo: irc
ischanexempt <exempt> <canal>
Devuelve: 1 if the specified exempt is on the given channel’s exempt list (not the bot’s exemptlist for the channel)
Módulo: irc
ischaninvite <invite> <canal>
Devuelve: 1 if the specified invite is on the given channel’s invite list (not the bot’s invitelist for the channel)
Módulo: irc
chanbans <canal>
Devuelve: 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
Módulo: irc
chanexempts <canal>
Devuelve: 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
Módulo: irc
chaninvites <canal>
Devuelve: 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
Módulo: irc
resetbans <canal>
Descripción: 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
Devuelve: nada
Módulo: irc
resetexempts [channel]
Descripción: 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
Devuelve: nada
Módulo: irc
resetinvites [channel]
Descripción: 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
Devuelve: nada
Módulo: irc
resetchan <canal>
Descripción:
Devuelve: rereads in the channel info from the server
Módulo: irc
getchanhost <nickname> [channel]
Devuelve: 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.
Módulo: irc
getchanjoin <nickname> <canal>
Devuelve: timestamp (unixtime format) of when the specified nickname joined the channel
Módulo: irc
onchansplit <nick> [channel]
Devuelve: 1 if that nick is split from the channel (or any channel if no channel is specified); 0 otherwise
Módulo: irc
chanlist <canal> [flags[&chanflags]]
Descripción: flags are any global flags; the ‘&’ denotes to look for channel specific flags. Examples:
n Global Owner
&n Channel Owner
o&m Global Op, Channel Master
Devuelve: 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.
Módulo: irc
getchanidle <nickname> <canal>
Devuelve: number of minutes that person has been idle; 0 if the specified user isn’t on the channel
Módulo: irc
getchanmode <canal>
Devuelve: string of the type “+ntik key” for the channel specified
Módulo: irc
jump [server [port [password]]]
Descripción: jumps to the server specified, or (if none is specified) the next server in the bot’s serverlist
Devuelve: nada
Módulo: server
pushmode <canal> <mode> [arg]
Descripción: 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.
Devuelve: nada
Módulo: irc
flushmode <canal>
Descripción: 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)
Devuelve: nada
Módulo: irc
topic <canal>
Devuelve: string containing the current topic of the specified channel
Módulo: irc
validchan <canal>
Descripción: 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.
Devuelve: 1 if the channel exists, 0 if not
Módulo: nada
isdynamic <canal>
Devuelve: 1 if the channel is a dynamic channel; 0 otherwise
Módulo: channels
setudef <flag/int/str> <name>
Descripción: 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.
Devuelve: nada
Módulo: channels
renudef <flag/int/str> <oldname> <newname>
Descripción: renames a user defined channel flag, string, or integer setting.
Devuelve: nada
Módulo: channels
deludef <flag/int/str> <name>
Descripción: deletes a user defined channel flag, string, or integer setting.
Devuelve: nada
Módulo: channels

4. Dcc commands

putdcc <idx> <texto>
Descripción: sends texto to the idx specified
Devuelve: nada
Módulo: core
dccbroadcast <message>
Descripción: 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
Devuelve: nada
Módulo: core
dccputchan <canal> <message>
Descripción: 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.
Devuelve: nada
Módulo: core
boot <user@bot> [razón]
Descripción: boots a user from the partyline
Devuelve: nada
Módulo: core
dccsimul <idx> <texto>
Descripción: simulates texto 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.
Devuelve: nada
Módulo: core
hand2idx <handle>
Devuelve: 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.
Módulo: core
idx2hand <idx>
Devuelve: handle of the user with the given idx
Módulo: core
valididx <idx>
Devuelve: 1 if the idx currently exists; 0 otherwise
Módulo: core
getchan <idx>
Devuelve: 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
Módulo: core
setchan <idx> <canal>
Descripción: 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).
Devuelve: nada
Módulo: core
console <idx> [channel] [console-modes]
Descripción: 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).
Devuelve: a list containing the user’s (new) channel view and (new) console modes, or nada if that user isn’t currently on the partyline
Módulo: core
echo <idx> [status]
Descripción: turns a user’s echo on or off; the status has to be a 1 or 0
Devuelve: new value of echo for that user (or the current value, if status was omitted)
Módulo: core
strip <idx> [+/-strip-flags]
Descripción: modifies the strip-flags for a user. The supported strip-flags are:
b remove all boldface codes
c remove all color codes
r remove all reverse video codes
u remove all underline codes
a remove all ANSI codes
g remove all ctrl-g (bell) codes
Devuelve: new strip-flags for the specified user (or the current flags, if strip-flags was omitted)
Módulo: core
putbot <bot-nick> <message>
Descripción: sends a message across the botnet to another bot. If no script intercepts the message on the other end, the message is ignored.
Devuelve: nada
Módulo: core
putallbots <message>
Descripción: sends a message across the botnet to all bots. If no script intercepts the message on the other end, the message is ignored.
Devuelve: nada
Módulo: core
killdcc <idx>
Descripción: kills a partyline or file area connection
Devuelve: nada
Módulo: core
bots
Devuelve: list of the bots currently connected to the botnet
Módulo: core
botlist
Devuelve: a list of bots currently on the botnet. Each item in the list is a sublist with four elements: bot, uplink, version, sharing status:
bot the bot’s botnetnick
uplink the bot the bot is connected to
version its current numeric version
sharing a “+” if the bot is a sharebot; “-” otherwise
Módulo: core
islinked <bot>
Devuelve: 1 if the bot is currently linked; 0 otherwise
Módulo: core
dccused
Devuelve: number of dcc connections currently in use
Módulo: core
dcclist [type]
Devuelve: a list of active connections, each item in the list is a sublist containing six elements: {<idx> <handle> <hostname> <type> {<other>} <timestamp>}
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.
Módulo: core
whom <chan>
Devuelve: 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.
Módulo: core
getdccidle <idx>
Devuelve: number of seconds the dcc chat/file system/script user has been idle
Módulo: core
getdccaway <idx>
Devuelve: away message for a dcc chat user (or “” if the user is not set away)
Módulo: core
setdccaway <idx> <message>
Descripción: sets a party line user’s away message and marks them away. If set to “”, the user is marked as no longer away.
Devuelve: nada
Módulo: core
connect <host> <port>
Descripción: 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.
Devuelve: idx of the new connection
Módulo: core
listen <port> <type> [opciones] [flag]
Descripción: opens a listening port to accept incoming telnets; type must be one of “bots”, “all”, “users”, “script”, or “off”:
listen <port> bots [mask]
Descripción: accepts connections from bots only; the opciónal 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.
Devuelve: port number
listen <port> users [mask]
Descripción: accepts connections from users only (no bots); the opciónal 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.
Devuelve: port number
listen <port> all [mask]
Descripción: accepts connections from anyone; the opciónal 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.
Devuelve: port number
listen <port> script <proc> [flag]
Descripción: 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.
Devuelve: port number
listen <port> off
Descripción: stop listening on a port
Devuelve: nada
Módulo: core
dccdumpfile <idx> <filename>
Descripción: dumps out a file from the texto directory to a dcc chat user. The flag matching that’s used everywhere else works here, too.
Devuelve: nada
Módulo: core

5. Notes module

notes <user> [numberlist]
Devuelve: -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 texto>}.
Módulo: notes
erasenotes <user> <numberlist>
Descripción: erases some or all stored notes for a user. Use ‘-‘ to erase all notes.
Devuelve: -1 if no such user, -2 if notefile failure, 0 if no such note, or number of erased notes.
Módulo: notes
listnotes <user> <numberlist>
Descripción: lists existing notes according to the numberlist (ex: “2-4;8;16-“)
Devuelve: -1 if no such user, -2 if notefile failure, 0 if no such note, list of existing notes.
Módulo: notes
storenote <from> <to> <msg> <idx>
Descripción: stores a note for later reading, notifies idx of any results (use idx -1 for no notify).
Devuelve: 0 on success; non-0 on failure
Módulo: notes

6. Assoc module

assoc <chan> [name]
Descripción: sets the name associated with a botnet channel, if you specify one
Devuelve: current name for that channel, if any
Módulo: assoc
killassoc <chan>
Descripción: removes the name associated with a botnet channel, if any exists. Use ‘killassoc &’ to kill all assocs.
Devuelve: nada
Módulo: assoc

7. Compress module

compressfile [-level <level>] <src-file> [target-file]
uncompressfile <src-file> [target-file]
Descripción: compresses or un-compresses files. The level opción 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.
Devuelve: nada
Módulo: compress
iscompressed <filename>
Descripción: 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.
Devuelve: nada
Módulo: compress

8. Filesys module

setpwd <idx> <dir>
Descripción: 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.
Devuelve: nada
Módulo: filesys
getpwd <idx>
Devuelve: the current directory of a file system user
Módulo: filesys
getfiles <dir>
Devuelve: a list of files in the directory given; the directory is relative to dcc-path
Módulo: filesys
getdirs <dir>
Devuelve: a list of subdirectories in the directory given; the directory is relative to dcc-path
Módulo: filesys
dccsend <filename> <ircnick>
Descripción: 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
Devuelve:
0 success
1 the dcc table is full (too many connections)
2 can’t open a socket for the transfer
3 the file doesn’t exist
4 the file was colad for later transfer, which means that person has too many file transfers going right now
5 copy-to-tmp is enabled and the file already exists in the temp directory
Módulo: transfer
filesend <idx> <filename> [ircnick]
Descripción: 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
Devuelve: 0 on failure; 1 on success (either an immediate send or a colad send)
Módulo: filesys
fileresend <idx> <filename> [ircnick]
Descripción: 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.
Devuelve: 0 on failure; 1 on success (either an immediate send or a colad send)
Módulo: filesys
setdesc <dir> <file> <desc>
Descripción: sets the description for a file in a file system directory; the directory is relative to dcc-path
Devuelve: nada
Módulo: filesys
getdesc <dir> <file>
Devuelve: the description for a file in the file system, if one exists
Módulo: filesys
setowner <dir> <file> <handle>
Descripción: changes the owner for a file in the file system; the directory is relative to dcc-path
Devuelve: nada
Módulo: filesys
getowner <dir> <file>
Devuelve: the owner of a file in the file system
Módulo: filesys
setlink <dir> <file> <link>
Descripción: creates or changes a linked file (a file that actually exists on another bot); the directory is relative to dcc-path
Devuelve: nada
Módulo: filesys
getlink <dir> <file>
Devuelve: the link for a linked file, if it exists
Módulo: filesys
getfileq <handle>
Devuelve: list of files colad by someone; each item in the list will be a sublist with two elements: nickname the file is being sent to and the filename
Módulo: transfer
getfilesendtime <idx>
Devuelve: the unixtime value for when a file transfer started, or a negative number:
-1 no matching transfer with the specified idx was found
-2 the idx matches an entry which is not a file transfer
Módulo: transfer
mkdir <directory> [<required-flags> [channel]]
Descripción: creates a directory in the file system. Only users with the required flags may access it.
Devuelve:
0 success
1 can’t create directory
2 directory exists but is not a directory
-3 could not open filedb
Módulo: filesys
rmdir <directory>
Descripción: removes a directory from the file system.
Devuelve: 0 on success; 1 on failure
Módulo: filesys
mv <file> <destination>
Descripción: 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.
Devuelve: If the command was successful, the number of files moved will be returned. Otherwise, a negative number will be returned:
-1 invalid source file
-2 invalid destination
-3 destination file exists
-4 no matches found
Módulo: filesys
cp <file> <destination>
Descripción: 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.
Devuelve: If the command was successful, the number of files copied will be returned. Otherwise, a negative number will be returned:
-1 invalid source file
-2 invalid destination
-3 destination file exists
-4 no matches found
Módulo: filesys
getflags <dir>
Devuelve: the flags required to access a directory
Módulo: filesys
setflags <dir> [<flags> [channel]]
Descripción: sets the flags required to access a directory
Devuelve: 0 on success; -1 or -3 on failure
Módulo: filesys

9. Miscellaneous commands

bind <type> <flags> <keyword/mask> [proc-name]
Descripción: 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).
Devuelve: name of the command that was added, or (if proc-name was omitted), a list of the current bindings for this command
Módulo: core
unbind <type> <flags> <keyword/mask> <proc-name>
Descripción: removes a previously created bind
Devuelve: name of the command that was removed
Módulo: core
binds [type/mask]
Devuelve: a list of Tcl binds, each item in the list is a sublist of five elements: {<type> <flags> <name> <hits> <proc>}
Módulo: core
logfile [<modes> <canal> <filename>]
Descripción: 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.
Devuelve: filename of logfile created, or, if no logfile is specified, a list of logfiles such as: {mco * eggdrop.log} {jp #lame lame.log}
Módulo: core
maskhost <nick!user@host>
Devuelve: masked hostmask for the string given (“n!u@1.2.3.4″ -> “*!u@1.2.3.*”, “n!u@lame.com” -> “*!u@lame.com”, “n!u@a.b.edu” -> “*!u@*.b.edu”)
Módulo: core
timer <minutes> <tcl-command>
Descripción: executes the given Tcl command after a certain number of minutes have passed
Devuelve: a timerID
Módulo: core
utimer <seconds> <tcl-command>
Descripción: executes the given Tcl command after a certain number of seconds have passed
Devuelve: a timerID
Módulo: core
timers
Devuelve: 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.
Módulo: core
utimers
Devuelve: 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.
Módulo: core
killtimer <timerID>
Descripción: removes a minutely timer from the list
Devuelve: nada
Módulo: core
killutimer <timerID>
Descripción: removes a secondly timer from the list
Devuelve: nada
Módulo: core
unixtime
Devuelve: a long integer which represents the number of seconds that have passed since 00:00 Jan 1, 1970 (GMT).
Módulo: core
duration <seconds>
Devuelve: 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.
Módulo: core
strftime <formatstring> [time]
Devuelve: 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.
Módulo: core
ctime <unixtime>
Devuelve: 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″
Módulo: core
myip
Devuelve: a long number representing the bot’s IP address, as it might appear in (for example) a DCC request
Módulo: core
rand <limit>
Devuelve: a random integer between 0 and limit-1
Módulo: core
control <idx> <command>
Descripción: 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 texto. 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 texto is blank (“”), it indicates that the connection has been dropped. Also, if the input texto is blank, never call killdcc on it, as it will fail with “invalid idx”.
Devuelve: nada
Módulo: core
sendnote <from> <to[@bot]> <message>
Descripción: simulates what happens when one user sends a note to another
Devuelve:
0 the send failed
1 the note was delivered locally or sent to another bot
2 the note was stored locally
3 the user’s notebox is too full to store a note
4 a Tcl binding caught the note
5 the note was stored because the user is away
Módulo: core
link [via-bot] <bot>
Descripción: attempts to link to another bot directly. If you specify a via-bot, it tells the via-bot to attempt the link.
Devuelve: 1 if the link will be attempted; 0 otherwise
Módulo: core
unlink <bot>
Descripción: attempts to unlink a bot from the botnet
Devuelve: 1 on success; 0 otherwise
Módulo: core
encrypt <key> <string>
Devuelve: encrypted string (using the currently loaded encryption module), encoded into ASCII using base-64
Módulo: encryption
decrypt <key> <encrypted-base64-string>
Devuelve: decrypted string (using the currently loaded encryption module)
Módulo: encryption
encpass <password>
Devuelve: encrypted string (using the currently loaded encryption module)
Módulo: encryption
die [razón]
Descripción: causes the bot to log a fatal error and exit completely. If no razón is given, “EXIT” is used.
Devuelve: nada
Módulo: core
unames
Devuelve: the current operating system the bot is using
Módulo: core
dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] … [argN]]
Descripción: 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).
As soon as the request completes, the specified proc will be called as follows: <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] … [argN]]
status is 1 if the lookup was successful and 0 if it wasn’t. All additional parameters (called arg1, arg2 and argN above) get appended to the proc’s other parameters.
Devuelve: nada
Módulo: core
md5 <string>
Devuelve: the 128 bit MD5 message-digest of the specified string
Módulo: core
callevent <event>
Descripción: triggers the evnt bind manually for a certain event. For example: callevent rehash.
Devuelve: nada
Módulo: core
traffic
Devuelve: 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).
Módulo: core
modules
Devuelve: 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.
Módulo: core
loadmodule <module>
Descripción: attempts to load the specified module.
Devuelve: “Already loaded.” if the module is already loaded, “” if successful, or the razón the module couldn’t be loaded.
Módulo: core
unloadmodule <module>
Descripción: attempts to unload the specified module.
Devuelve: “No such module” if the module is not loaded, “” otherwise.
Módulo: core
loadhelp <helpfile-name>
Descripción: attempts to load the specified help file from the help/ directory.
Devuelve: nada
Módulo: core
unloadhelp <helpfile-name>
Descripción: attempts to unload the specified help file.
Devuelve: nada
Módulo: core
reloadhelp
Descripción: reloads the bot’s help files.
Devuelve: nada
Módulo: core
restart
Descripción: rehashes the bot, kills all timers, reloads all modules, and reconnects the bot to the next server in its list.
Devuelve: nada
Módulo: core
rehash
Descripción: rehashes the bot
Devuelve: nada
Módulo: core
stripcodes <strip-flags> <string>
Descripción: strips specified control characters from the string given. strip-flags can be any combination of the following:
b remove all boldface codes
c remove all color codes
r remove all reverse video codes
u remove all underline codes
a remove all ANSI codes
g remove all ctrl-g (bell) codes
Devuelve: the stripped string
Módulo: core

10. Global variables

NOTE: All config file variables are also global.
botnick
Value: the current nickname the bot is using (for example: “Valis”, “Valis0″, etc.)
Módulo: server
botname
Value: the current nick!user@host that the server sees (for example: “Valis!valis@crappy.com”)
Módulo: server
server
Value: 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.
Módulo: server
serveraddress
Value: 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.
Módulo: server
version
Value: current bot version “1.1.2+pl1 1010201 pl1″; first item is the texto version, second item is a numerical version, and any following items are the names of patches that have been added
Módulo: core
numversion
Value: the current numeric bot version (for example: “1010201”). Numerical version is in the format of “MNNRRPP”, where:
M major release number
NN minor release number
RR sub-release number
PP patch level for that sub-release
Módulo: core
uptime
Value: the unixtime value for when the bot was started
Módulo: core
server-online
Value: the unixtime value for when the bot connected to its current server
Módulo: server
lastbind
Value: the last command binding which was triggered. This allows you to identify which command triggered a Tcl proc.
Módulo: core
isjuped
Value: 1 if bot’s nick is juped(437); 0 otherwise
Módulo: server
handlen
Value: the value of the HANDLEN define in src/eggdrop.h
Módulo: core
config
Value: the filename of the config file Eggdrop is currently using
Módulo: core

11. Bind

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.
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.
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’.
A.     Bind types
1.      MSG
bind msg <flags> <command> <proc>
procname <nick> <user@host> <handle> <texto>
Descripción: used for /msg commands. The first word of the user’s msg is the command, and everything else becomes the texto argument.
Módulo: server
2.      DCC
bind dcc <flags> <command> <proc>
procname <handle> <idx> <texto>
Descripción: used for partyline commands; the command is the first word and everything else becomes the texto 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.
Módulo: core
3.      FIL
bind fil <flags> <command> <proc>
procname <handle> <idx> <texto>
Descripción: the same as DCC, except this is triggered if the user is in the file area instead of the party line
Módulo: filesys
4.      PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <canal> <texto>
Descripción: used for commands given on a channel. The first word becomes the command and everything else is the texto argument.
Módulo: irc
5.      MSGM (stackable)
bind msgm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <texto>
Descripción: matches the entire line of texto from a /msg with the mask. This is useful for binding Tcl procs to words or phrases spoken anywhere within a line of texto. 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 trigged by texto that a MSGM bind has already handled.
Módulo: server
6.      PUBM (stackable)
bind pubm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <texto>
Descripción: 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 texto 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 trigged by texto that a PUBM bind has already handled.
Módulo: irc
7.      NOTC (stackable)
bind notc <flags> <mask> <proc>
procname <nick> <user@host> <handle> <texto> <dest>
Descripción: 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.
New Tcl procs should be declared as

proc notcproc {nick uhost hand texto {dest “”}} {
global botnick; if {$dest == “”} {set dest $botnick}

}

for compatibility.

 

Módulo: server
8.      JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal>
Descripción: triggered by someone joining the channel. The mask in the bind is matched against “#channel nick!user@host” and can contain wildcards.
Módulo: irc
9.      PART (stackable)
bind part <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <msg>
Descripción: 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 “”.
New Tcl procs should be declared as

proc partproc {nick uhost hand chan {msg “”}} { … }

for compatibility.

Módulo: irc
10. SIGN (stackable)
bind sign <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <razón>
Descripción: 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’.
Módulo: irc
11. TOPC (stackable)
bind topc <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <topic>
Descripción: triggered by a topic change. mask can contain wildcards and is matched against ‘#channel <new topic>’.
Módulo: irc
12. KICK (stackable)
bind kick <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <target> <razón>
Descripción: triggered when someone is kicked off the channel. The mask is matched against ‘#channel target razón’ 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 razón.
Módulo: irc
13. NICK (stackable)
bind nick <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal> <newnick>
Descripción: 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).
Módulo: irc
14. MODE (stackable)
bind mode <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <canal> <mode-change> <target>
Descripción: 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.
If it is a server mode, nick will be “”, user@host is the server name, and handle is *.
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.
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:
Old script looks as follows:

bind mode – * mode_proc
proc mode_proc {nick uhost hand chan mode} { … }

To make it work with 1.3.18+ and stay compatible with older bots, do:

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} { … }Módulo: irc

15. CTCP (stackable)
bind ctcp <flags> <keyword> <proc>
proc-name <nick> <user@host> <handle> <dest> <keyword> <texto>
Descripción: dest will be a nickname (the bot’s nickname, obviously) or channel name. keyword is the ctcp command (which can contain wildcards), and texto may be empty. If the proc returns 0, the bot will attempt its own processing of the ctcp command.
Módulo: server
16. CTCR (stackable)
bind ctcr <flags> <keyword> <proc>
proc-name <nick> <user@host> <handle> <dest> <keyword> <texto>
Descripción: just like ctcp, but this is triggered for a ctcp-reply (ctcp embedded in a notice instead of a privmsg)
Módulo: server
17. RAW (stackable)
bind raw <flags> <keyword-mask> <proc>
procname <from> <keyword> <texto>
Descripción: previous versions of Eggdrop required a special compile opción 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).
Módulo: server
18. BOT
bind bot <flags> <command> <proc>
proc-name <from-bot> <command> <texto>
Descripción: triggered by a message coming from another bot in the botnet. The first word is the command and the rest becomes the texto argument; flags are ignored.
Módulo: core
19. CHON (stackable)
bind chon <flags> <mask> <proc>
proc-name <handle> <idx>
Descripción: 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.
Módulo: core
20. CHOF (stackable)
bind chof <flags> <mask> <proc>
proc-name <handle> <idx>
Descripción: 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.
Módulo: core
21. SENT (stackable)
bind sent <flags> <mask> <proc>
proc-name <handle> <nick> <path/to/file>
Descripción: 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’).
Módulo: transfer
22. RCVD (stackable)
bind rcvd <flags> <mask> <proc>
proc-name <handle> <nick> <path/to/file>
Descripción: 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).
Módulo: transfer
23. CHAT (stackable)
bind chat <flags> <mask> <proc>
proc-name <handle> <channel#> <texto>
Descripción: 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 texto and supports wildcards.
NOTE: If a BOT says something on the botnet, the BCST bind is invoked instead.
Módulo: core
24. LINK (stackable)
bind link <flags> <mask> <proc>
proc-name <botname> <via>
Descripción: 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.
Módulo: core
25. DISC (stackable)
bind disc <flags> <mask> <proc>
proc-name <botname>
Descripción: triggered when a bot disconnects from the botnet for whatever razón. Just like the link bind, flags are ignored; mask is matched against the botnetnick of the bot that unlinked. Wildcards are supported in mask.
Módulo: core
26. SPLT (stackable)
bind splt <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal>
Descripción: 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.
Módulo: irc
27. REJN (stackable)
bind rejn <flags> <mask> <proc>
procname <nick> <user@host> <handle> <canal>
Descripción: someone who was split has rejoined. mask can contain wildcards, and is matched against ‘#channel nick!user@host’.
Módulo: irc
28. FILT (stackable)
bind filt <flags> <mask> <proc>
procname <idx> <texto>
Descripción: party line and file system users have their texto sent through filt before being processed. If the proc returns a blank string, the texto is considered parsed. Otherwise, the bot will use the texto returned from the proc and continue parsing that.
Módulo: core
29. NEED (stackable)
bind need <flags> <mask> <proc>
procname <canal> <type>
Descripción: 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.
Example:
bind need – “% op” needop < handles only need op
bind need – “*” needall < handles all needs
Módulo: irc
30. FLUD (stackable)
bind flud <flags> <type> <proc>
procname <nick> <user@host> <handle> <type> <canal>
Descripción: 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.
Módulo: server
31. NOTE (stackable)
bind note <flags> <mask> <proc>
procname <from> <to> <texto>
Descripción: 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.
Módulo: core
32. ACT (stackable)
bind act <flags> <mask> <proc>
proc-name <handle> <channel#> <action>
Descripción: when someone does an action on the botnet, it invokes this binding. flags are ignored; the mask is matched against the texto of the action and can support wildcards.
Módulo: core
33. WALL (stackable)
bind wall <flags> <mask> <proc>
proc-name <handle> <msg>
Descripción: when the bot receives a wallops, it invokes this binding. flags are ignored; the mask is matched against the texto 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.
Módulo: server
34. BCST (stackable)
bind bcst <flags> <mask> <proc>
proc-name <botname> <channel#> <texto>
Descripción: 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 texto and can contain wildcards. ‘channel’ argument will always be ‘-1′ since broadcasts are not directed to any partyline channel.
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′.
Módulo: core
35. CHJN (stackable)
bind chjn <flags> <mask> <proc>
proc-name <botname> <handle> <channel#> <flag> <idx> <user@host>
Descripción: 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.
Módulo: core
36. CHPT (stackable)
bind chpt <flags> <mask> <proc>
proc-name <botname> <handle> <idx> <channel#>
Descripción: when someone parts a botnet channel, it invokes this binding. The mask is matched against the channel and can contain wildcards. Flags are ignored.
Módulo: core
37. TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>
Descripción: 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.
Módulo: core
38. AWAY (stackable)
bind away <flags> <mask> <proc>
proc-name <botname> <idx> <texto>
Descripción: triggers when a user goes away or comes back on the botnet. texto is the razón than has been specified (texto is “” when returning). mask is matched against the botnet-nick of the bot the user is connected to and supports wildcards. flags are ignored.
Módulo: core
39. LOAD (stackable)
bind load <flags> <mask> <proc>
proc-name <module>
Descripción: triggers when a module is loaded. mask is matched against the name of the loaded module and supports wildcards; flags are ignored.
Módulo: core
40. UNLD (stackable)
bind unld <flags> <mask> <proc>
proc-name <module>
Descripción: triggers when a module is unloaded. mask is matched against the name of the unloaded module and supports wildcards; flags are ignored.
Módulo: core
41. NKCH (stackable)
bind nkch <flags> <mask> <proc>
proc-name <oldhandle> <newhandle>
Descripción: 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.
Módulo: core
42. EVNT (stackable)
bind evnt <flags> <type> <proc>
proc-name <type>
Descripción: Descripción: triggered whenever one of these events happen; flags are ignored; valid events are:
sighup called on a kill -HUP <pid>
sigterm called on a kill -TERM <pid>
sigill called on a kill -ILL <pid>
sigquit called on a kill -QUIT <pid>
save called when the userfile is saved
rehash called just after a rehash
prerehash called just before a rehash
prerestart called just before a restart
logfile called when the logs are switched daily
loaded called when the bot is done loading
userfile-loaded called after userfile has been loaded
connect-server called just before we connect to an IRC server
init-server called when we actually get on our IRC server
disconnect-server called when we disconnect from our IRC server
Módulo: core
43. LOST (stackable)
bind lost <flags> <mask> <proc>
proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>
Descripción: 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.
Módulo: transfer
44. TOUT (stackable)
bind tout <flags> <mask> <proc>
proc-name <handle> <nick> <path> <bytes-transferred> <length-of-file>
Descripción: 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 razón.
Módulo: transfer
B.     Return Values
Several bindings pay attention to the value you return from the proc (using ‘return <value>’). Usually, they expect a 0 or 1, and 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).
Here’s a list of the bindings that use the return value from procs they trigger:
1.      MSG
Return 1 to make Eggdrop log the command as:
(nick!user@host) !handle! command
2.      DCC
Return 1 to make Eggdrop log the command as:
#handle# command
3.      FIL
Return 1 to make Eggdrop log the command as:
#handle# files: command
4.      PUB
Return 1 to make Eggdrop log the command as:
<<nick>> !handle! command
5.      CTCP
Return 1 to ask the bot not to process the CTCP command on its own. Otherwise, it would send its own response to the CTCP (possibly an error message if it doesn’t know how to deal with it).
6.      FILT
Return “” to indicate the texto has been processed, and the bot should just ignore it. Otherwise, it will treat the texto like any other.
7.      FLUD
Return 1 to ask the bot not to take action on the flood. Otherwise it will do its normal punishment.
8.      RAW
Return 1 to ask the bot not to process the server texto. This can affect the bot’s performance by causing it to miss things that it would normally act on — you have been warned.
9.      CHON
Return 1 to ask the bot not to process the partyline join event.
10. CHOF
Return 1 to ask the bot not to process the partyline part event.
11. WALL
Return 1 to make Eggdrop not log the message that triggered this bind.
12. NOTE
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.
13. MSGM
Return 1 to make Eggdrop not log the message that triggered this bind.
14. PUBM
Return 1 to make Eggdrop not log the message that triggered this bind.
15. NOTC
Return 1 to make Eggdrop not log the message that triggered this bind.

12. Control procedures

Using the ‘control’ command, you can put a DCC connection (or outgoing TCP connection) in control of a script. All texto received from the connection is sent to the proc you specify. All outgoing texto should be sent with ‘putdcc’.
The control procedure is called with these parameters:
procname <idx> <input-texto>
This allows you to use the same proc for several connections. The idx will stay the same until the connection is dropped. After that, it will probably get reused for a later connection.
To indicate that the connection has closed, your control procedure will be called with blank texto (the input-texto will be “”). This is the only time it will ever be called with “” as the texto, and it is the last time your proc will be called for that connection. Don’t call killdcc on the idx when texto is blank, it will always fail with “invalid idx”.
If you want to hand control of your connection back to Eggdrop, your proc should return 1. Otherwise, return 0 to retain control.

13. TCP connections
Eggdrop allows you to make two types of TCP (“telnet”) connections: outgoing and incoming. For an outgoing connection, you specify the remote host and port to connect to. For an incoming connection, you specify a port to listen on.
All of the connections are *event driven*. This means that the bot will trigger your procs when something happens on the connection, and your proc is expected to return as soon as possible. Waiting in a proc for more input is a no-no.
To initiate an outgoing connection, use:
set idx [connect <hostname> <port>]
$idx now contains a new DCC entry for the outgoing connection.
All connections use non-blocking (commonly called “asynchronous”, which is a misnomer) I/O. Without going into a big song and dance about asynchronous I/O, what this means to you is:
·         assume the connection succeeded immediately
·         if the connection failed, an EOF will arrive for that idx
The only time a ‘connect’ 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.
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.
To create a listen port, use:
listen <port> script <proc>
Procs should be declared as:
procname <newidx>
For example:

listen 6687 script listen:grab

proc listen:grab {newidx} {
control $newidx listen:control
}

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.

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.

14. Match characters

Many of the bindings allow match characters in the arguments. Here are the four special characters:
? matches any single character
* matches 0 or more characters of any type
% matches 0 or more non-space characters (can be used to match a single word)
~ matches 1 or more space characters (can be used for whitespace between words)