SUNiNET - Your Eggdrop & TCL resources site
[ Home Eggdrop TCL Links About ]

Guide to TCL scripting for Eggdrop 1.6

[ Previous ] [ Index ] [ Next ]

4.1 Binding events

With the bind command you can make the bot react on an event like a command, a message or a ctcp.
The syntax of the bind command is bind <type> <flags> <command> <procedure>.
I'll go through this now step-by-step.

The <type> is what event you want to make the bot react on.
For example, ctcp would bind a ctcp or msg would bind a message.
You can find all the available types in eggdrop/doc/tcl-commands.doc.

The <flags> refer to the flags you give users in your Eggdrop.
This goes in the form of <global flag>|<channel flag>.
Here are a few examples to explain it faster and easier:

#Bind to everyone (including users who are not in the userlist)
bind <type> - <command> <procedure>

#Bind to everyone (including users who are not in the userlist)
bind <type> * <command> <procedure>

#Bind to global owners
bind <type> n <command> <procedure>

#Bind to global operators
bind <type> o <command> <procedure>

#Bind to channel masters (NOT global masters)
bind <type> -|m <command> <procedure>

#Bind to global masters and channel masters
bind <type> m|m <command> <procedure>

#Bind to global operators and channel owners
bind <type> o|n <command> <procedure>

The <command> is on what parameter the bind is triggered. If you would use the bind type msg, the parameter would be the first word of the message or if you were to use the bind type dcc it would be the new partyline command you want to create.
For example, bind dcc <flags> test <procedure> would create a partyline command called test or bind msg <flags> hello <procedure> would make the bot react when it receives a message with "hello" as its first word.

The <procedure> is simply what procedure the bot must run when the bind is triggered.

[ Previous ] [ Index ] [ Next ]

Design & Graphics by Shawn Borton
Copyright © 2000-2005 Marijn van Zon