bind pub - !cmd cmd
proc cmd {nick host handle chan text} {
if {$chan == "#"} {
puthelp "PRIVMSG $chan : this is the output on #chan1"
}
if {$chan == "#chan2"} {
puthelp "PRIVMSG $chan : And this is the output on #chan2"
}
}
My question is: Can I split a script in more sections, where each section describes all the binds and procs for it's own channel? Something like:
ObelNix wrote:My question is: Is this valid? Can I do this?
Not unless you do the channel check inside the procs like ppslim told you to.
Checking a global variable at compile time (like you did in your code example) won't do you any good.