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

Guide to TCL scripting for Eggdrop 1.6


[ Previous ] [ Index ] [ Next ]


7.5 Executing when it's none of the above

Besides elseif you can also use else.
The body within else is executed when all of your if and elseif checks fail.
You can use else without having elseif in your if command.
Here are two small examples:

if {$nick=="SomeNick"} {
  (...)
} elseif {$chan=="#eggdrop"} {
  (...)
} elseif {$host != "*!eggdrop@eggheads.org"} {
  (...)
} else {
  (...)
}

if {$enabled} {
  (...)
} else {
  (...)
}

Unlike elseif, you can use else only once per if command.


[ Previous ] [ Index ] [ Next ]


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