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