Don't use either...
When using if, the first parameter is the conditional to test, the second the code to execute if the conditional was true. The optional third would be what to execute if the conditional was false. There is no need to "escape" from those code-blocks.. once they reach the end, the processing continues with the first command after the if conditional.
Code: Select all
...
if {$chan == "#chan1"} {
if {$nick == "notwantednick"} {
#executed if $chan == #chan1 and $nick == notwantednick
} {
#executed if $chan == #chan1 and $nick != notwantednick
}
}
if {$::botnick == "nisse"} {
#executed if bot's nick is nisse, regardless of $chan or $nick...
}
Notice how I don't use any return, break, or continue there. Instead I let each code-block run to it's end.
Return has the sole purpose of stopping a proc from running, and returning a value to whatever called the proc in the first place. Whether you use 0 or 1 or anything else won't affect this behaviour, some eggdrop bindings do care for the returned value, but that's outside the scope of this discussion.
Continue is used in loops, such as
for,
foreach, and
while. It instructs the loop controller to halt the current iteration immediately, and proceed to the next iteration.
Break is used in loops, such as
for,
foreach, and
while, as well as the conditional construct
switch It instructs the controller to halt the current iteration immediately, and return, allowing the next command in the script to be executed.