Server module


The server module allows the bot to connect to an IRC server.

  1. Config file settings
  2. Tcl commands
  3. Tcl variables
  4. Tcl bindings

1. Config file settings

Lines in bold are the lines that need to be included in the eggdrop config file if you want to use the share module.
Lines in bold italics are optional and only required if you wish to change the default behaviour for that particular feature.

This module provides the core server support. You have to load this if you want your bot to come on irc.

Put this line into your eggdrop.conf file to load server module:</>

loadmodule server

There are also some variables you can set in your config file:

set net-type 0

Define here the network you use. There are six settings:

0 = Efnet (non +e/+I hybrid)
1 = IRCnet
2 = Undernet
3 = Dalnet
4 = Efnet +e/+I hybrid
5 = Others

Valid settings are 0-5

set nick "LamestBot"

Set the nickname the bot will use on IRC here.

The bot will use the same nick for the botnet unless you specify a separate botnet-nick.

set altnick "LamestBot"

Set the alternate nickname the bot will use on IRC here.

If you include '?' characters in this setting, they will be replaced by a random number.

set keep-nick 1

This setting makes the bot try to get its original nickname back (for example, if the intended nickname is already in use).

set realname "/msg LamestBot hello"

This setting tells the bot what to display in the realname field that shows up on IRC

set init-server { putserv "MODE $botnick +i-ws" }

This setting allows the bot to evaluate Tcl commands when it first connects to a server.

set servers { IRCSERVER1:PORT IRSERVER2:PORT ... }

This setting tell the bot what servers it should use when connecting to IRC. You may optionally specify a port for each server.

For example:

set servers {
  irc.netw.ork
  irc.krow.ten:6668
}

This will make the bot connect on startup to irc.netw.ork using 'default-port'. On disconnect, or if someone uses the '.jump' command, it will then try to connect to irc.kwor.ten on port 6668.

set default-port 6667

Eggdrop will use this port if none is specified in the server list or given for the '.jump' command.

set strict-servernames 0

Often an irc server call itself somthing other then what its real dns name is. If you want eggdrop to replace your server entry in the config file with this name, set this to 1. If you turn this setting to 0, eggdrop will keep this name separate from the server list.

Valid settings are 0 and 1.

set server-cycle-wait 60

This setting defines how long eggdrop should wait before moving from one server to another on disconnect.

If you set 0 here, eggdrop wont wait at all and reconnect instantly. Please note, that a too low setting could result in k-line for your host, since many ircops don't like being flooded with connects.

Valid settings are 0-infinite

set never-give-up 1

This setting makes the bot cycle forever and keep trying to connect to all irc servers in it's current list if they're down.

Valid settings are 0 and 1.

set server-timeout 60

Set here the timeout how long eggdrop should wait for a response when connecting to a server before giving up and moving on to next server in list.

set servlimit 0

If the number of servers on the net gets below this number, it will jump to a new server (ie, it will assume it's on the losing end of a netsplit) -- set to 0 to turn off

Note that most irc networks use Time Stamping or Nick Delay now, so it's to your advantage to turn this off.

Valid settings are 0 and 1.

set check-stoned 1

Set this to 1 if eggdrop should check for stoned servers? (i.e. Where the server connection has died, but eggdrop hasn't been notified yet).

Valid settings are 0 and 1.

set serverror-quit 1

If you want your bot to exit the server if it receives a error msg set this to 1

Valid settings are 0 and 1.

set max-queue-msg 300

Set here the maximum number of lines to queue to the server. If you're going to dump large chunks of text to people over irc, you will probably want to raise this -- most people are fine at 300 though

set use-console-r 0

This setting allows you the logging of all information got from a server, via console mode 'r'

NOTE: This is a large security hole, allowing people to see passwords. This is now restricted to +n users only. Please choose your owners with care.

Valid settings are 0 and 1.

set debug-output 0

This setting allows you the logging of all information sent to a server, via console mode 'v'

NOTE: This is a large security hole, allowing people to see passwords. This is now restricted to +n users only. Please choose your owners with care.

Valid settings are 0 and 1.

set strict-host 0

Set this to 1 if you don't want your the bot to strip any leading '~' on user@hosts

Valid settings are 0 and 1.

set quiet-reject 1

This setting makes the bot squelch the error message when rejecting a DCC CHAT or SEND. Normally it tells the DCC user that the CHAT or SEND has been rejected because they don't have access.

Please note, sometimes IRC server operators detect bots that way.

Valid settings are 0 and 1.

set flood-msg 5:60

Set here how many msgs in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against msg floods

set flood-ctcp 3:60

Set here how many ctcps in how many seconds from one host are recognized as a flood. Not specifying or using number = 0 will not check against ctcp floods

set answer-ctcp 3

Set how many ctcps should be answered at once

set lowercase-ctcp 0

If you want your bot to answer lower case ctcp request (non rfc compliant) set this setting to 1.

Please note: mIRC will do this, most other clients will not

Valid settings are 0 and 1.

set trigger-on-ignore 0

If you want eggdrop to trigger binds for ignored users, set this to 1

Valid settings are 0 and 1.

set double-mode 0

Allow a message to be in the mode queue multiple times?

Valid settings are 0 and 1.

set double-server 0

Allow a message to be in the server queue multiple times?

Valid settings are 0 and 1.

set double-help 0

Allow a message to be in the help queue multiple times?

Valid settings are 0 and 1.

set use-penalties 1
(default on net-type 1)

This enables eggdrop's penalty calculation. Every command eggdrop sends to the irc server raises it's penatly points. If eggdrop reaches a server limit, it gets disconnected with "excess flood" message. Eggdrop is able to count internal those penalty points, too and take measures against excess flooding.

Note: it's highly adviced to turn this on!

set optimize-kicks 1

Optimize kicks optimizes kick queue. It also traces nick changes and parts in channel and changes the kick queue respectively.

There are three different options for this setting:
0 = disable
1 = optimize kick queue by sumarizing kicks.
2 = trace nick changes and channel parts and change the queue respectively. For example, bot wont try to kick users who have already parted the channel.

Valid settings are 0-2

These were the core irc module settings. There are more settings for 'net-type' 5.

Use this settings only if you set 'net-type' to 5!

set check-mode-r 1

This settings defines how umode +r is understood by eggdrop. Some networks use +r to mean a restricted connection. If this is your case, and you want your bot to leave restricted servers and jump to the next one on his server list, then set it to 1.

Please note, this setting is automatically set to 0 for net-type 0/2/3/4, and set to 1 for net-type 1.

Valid settings are 0 and 1.

set nick-len 9

This setting enables you to use different nick lengths then the ircd's default 9 (Dalnet uses 32 imo). The maximum supported length by eggdrop is 32.

Valid settings are 9-32


2. Tcl commands

putserv <text>

sends text to the server, like 'dump' (intended for direct server commands); output is queued so that you won't flood yourself off the server
returns: nothing

putquick <text>

sends text to the server, like 'dump' (intended for direct server commands); output is queued so that you won't flood yourself off the server, using the MODE queue (should be alot faster)
returns: nothing

putkick <channel> <nick,nick,...> [reason]

sends kicks to the server and tries to put as many nicks into one kick command as possible.
returns: nothing

puthelp <text>

sends text to the server like 'putserv', but uses a different queue (intended for sending messages to channels or people)
returns: nothing

queuesize [queue]

returns: the number of msgs in all queues. If a queue is specified, only the size of this queue is returned. valid queues are: mode, server help, or all.

clearqueue <queue>

returns: number of deleted lines from the specified queue

dumpfile <nick> <filename>

dumps out a file from the help/text directory to a user on IRC via msg (one line per msg); the user has no flags, so the flag bindings won't work within the file.

jump [server [port [password]]]

jumps to the server specified, or (if none is specified) the next server in the list
returns: nothing

3. Tcl variables

botnick

current nickname the bot is using, ie 'Sisko' or 'Sisko0', etc

botname

current nick!user@host that the server sees, ie 'Sisko!ikaney@uk.defiant.org'

isjuped

value is 1 if bots nick is juped(437) 0 otherwise.

server

current server the bot is using, ie 'irc.math.ufl.edu:6667'

server-online

unixtime value for when the bot connected to its current server


4. Tcl bindings

MSG

bind msg <flags> <command> <proc>
proc-name <nick> <user@host> <handle> <args>

used for /msg commands; the first word of the user's msg is the command, and everything else becomes the argument string

MSGM (stackable)

bind msgm <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <text>

matches the entire line of text from a /msg with the mask; this is more useful for binding Tcl procs to words or phrases spoken anywhere within a line of text

NOTC (stackable)

bind notc <flags> <mask> <proc>
proc-name <nick> <user@host> <handle> <text> <dest>

destination will be a nickname (the bot's nickname, obviously) or a channel name; matches the entire line of text from a /notice with the mask; it is considered a breach of protocol to respond to a /notice on IRC, so this is intended for internal use (ie, logging, etc) only

new Tcl procs should be declared as:

proc notcproc {nick uhost hand chan text {dest $botnick}} {
  ...
}

for compatiblity with older eggdrop versions

CTCP

bind ctcp <flags> <keyword-mask> <proc>
proc-name <nick> <user@host> <handle> <dest> <keyword> <args...>

destination will be a nickname (the bot's nickname, obviously) or a channel name; keyword is the ctcp command and args may be empty; if the proc returns 0, the bot will attempt its own processing of the ctcp command

CTCR

bind ctcr <flags> <keyword-mask> <proc>
proc-name <nick> <user@host> <handle> <dest> <keyword> <args...>

just like ctcp, but this is triggered for a ctcp-reply (ie, ctcp embedded in a notice instead of a privmsg)

RAW (stackable)

bind raw <flags> <keyword-mask> <proc>
proc-name <from> <keyword> <args...>

previous versions of eggdrop required a special compile option to enable this binding, but it's now standard; the mask is checked against the keyword (either a numeric like "368" or a keyword like "PRIVMSG"); from will be the server name or the source user (depending on the keyword); flags are ignored; the order of the arguments is identical to the order that the IRC server sends to the bot -- the pre-processing only splits it apart enough to determine the keyword; if the proc returns 1, eggdrop will not process the line any further. This could cause your bot to behave oddly in some cases.

FLUD (stackable)

bind flud <flags> <type> <proc>
proc-name <nick> <user@host> <handle> <type> <channel>

any floods detected through the flood control settings (like 'flood-ctcp') are sent here before processing; if the proc returns 1, no further action is taken on the flood; if the proc returns 0, the bot will do its normal "punishment" for the flood; the flood type is "pub", "msg", "join", or "ctcp" (and can be masked to "*" for the bind); flags are ignored

WALL (stackable)

bind wall <flags> <mask> <proc>
proc-name <nick> <msg>

when the bot receives a wallops, it invokes this binding; flags are ignored; the mask is checked against the text of the wallops msg


© 1997 Robey Pointer
© 1999,2000 Eggheads