Eggdrop Documentation - 9. Miscellaneous commands

30-12-2010 10:45

9. Miscellaneous commands

bind <type> <flags> <keyword/mask> [proc-name]

Description: 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).

Returns: name of the command that was added, or (if proc-name was omitted), a list of the current bindings for this command

Module: core

unbind <type> <flags> <keyword/mask> <proc-name>

Description: removes a previously created bind

Returns: name of the command that was removed

Module: core

binds [type/mask]

Returns: a list of Tcl binds, each item in the list is a sublist of five elements: {<type> <flags> <name> <hits> <proc>}

Module: core

logfile [<modes> <channel> <filename>]

Description: 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.

Returns: filename of logfile created, or, if no logfile is specified, a list of logfiles such as: {mco * eggdrop.log} {jp #lame lame.log}

Module: core

maskhost <nick!user@host>

Returns: 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")

Module: core

timer <minutes> <tcl-command>

Description: executes the given Tcl command after a certain number of minutes have passed

Returns: a timerID

Module: core

utimer <seconds> <tcl-command>

Description: executes the given Tcl command after a certain number of seconds have passed

Returns: a timerID

Module: core

timers

Returns: 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.

Module: core

utimers

Returns: 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.

Module: core

killtimer <timerID>

Description: removes a minutely timer from the list

Returns: nothing

Module: core

killutimer <timerID>

Description: removes a secondly timer from the list

Returns: nothing

Module: core

unixtime

Returns: a long integer which represents the number of seconds that have passed since 00:00 Jan 1, 1970 (GMT).

Module: core

duration <seconds>

Returns: 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.

Module: core

strftime <formatstring> [time]

Returns: 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.

Module: core

ctime <unixtime>

Returns: 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"

Module: core

myip

Returns: a long number representing the bot's IP address, as it might appear in (for example) a DCC request

Module: core

rand <limit>

Returns: a random integer between 0 and limit-1

Module: core

control <idx> <command>

Description: 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".

Returns: nothing

Module: core

sendnote <from> <to[@bot]> <message>

Description: simulates what happens when one user sends a note to another

Returns:

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

Module: core

link [via-bot] <bot>

Description: attempts to link to another bot directly. If you specify a via-bot, it tells the via-bot to attempt the link.

Returns: 1 if the link will be attempted; 0 otherwise

Module: core

unlink <bot>

Description: attempts to unlink a bot from the botnet

Returns: 1 on success; 0 otherwise

Module: core

encrypt <key> <string>

Returns: encrypted string (using the currently loaded encryption module), encoded into ASCII using base-64

Module: encryption

decrypt <key> <encrypted-base64-string>

Returns: decrypted string (using the currently loaded encryption module)

Module: encryption

encpass <password>

Returns: encrypted string (using the currently loaded encryption module)

Module: encryption

die [reason]

Description: causes the bot to log a fatal error and exit completely. If no reason is given, "EXIT" is used.

Returns: nothing

Module: core

unames

Returns: the current operating system the bot is using

Module: core

dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]

Description: 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.

Returns: nothing

Module: core

md5 <string>

Returns: the 128 bit MD5 message-digest of the specified string

Module: core

callevent <event>

Description: triggers the evnt bind manually for a certain event. For example: callevent rehash.

Returns: nothing

Module: core

traffic

Returns: 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).

Module: core

modules

Returns: 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.

Module: core

loadmodule <module>

Description: attempts to load the specified module.

Returns: "Already loaded." if the module is already loaded, "" if successful, or the reason the module couldn't be loaded.

Module: core

unloadmodule <module>

Description: attempts to unload the specified module.

Returns: "No such module" if the module is not loaded, "" otherwise.

Module: core

loadhelp <helpfile-name>

Description: attempts to load the specified help file from the help/ directory.

Returns: nothing

Module: core

unloadhelp <helpfile-name>

Description: attempts to unload the specified help file.

Returns: nothing

Module: core

reloadhelp

Description: reloads the bot's help files.

Returns: nothing

Module: core

restart

Description: rehashes the bot, kills all timers, reloads all modules, and reconnects the bot to the next server in its list.

Returns: nothing

Module: core

rehash

Description: rehashes the bot

Returns: nothing

Module: core

stripcodes <strip-flags> <string>

Description: 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

Returns: the stripped string

Module: core