Hi again this bit of script is really starting to annoy
I'm trying to get my bot to display a notice saying "I'm not in #channel" when the user triggers the procedure. in my tcl i have set a channel which works great with the rest of the script when the bot is in the set channel. but when i remove the bot id like it to notice the user of the trigger when its not in the set channel.
Following so far? im glad one of us is
heres the part of my code which might explain a bit better..
Check out 'validchan' (explained in tcl-commands.doc)
i read the small explination in that doc which i didnt know existed till now. thanks basically all it said was that using validchan returns a 1 or a 0 depending if the bot is in channel or not which is what i need but it still throws up the same error as before when using it
proc getKey {chan} {
if {![validchan $chan]||![botonchan $chan]} {return "I'm not on $chan"}
if {![string match *k* [getchanmode $chan]]} {return "There's no key on $chan"}
if {![botisop $chan]} {return "I'm not oped on $chan (i need to be to see the key :P)"}
return "The key on $chan is '[lindex [split [getchanmode $chan]] 1]' :)"
}
proc getKey {chan} {
if {![validchan $chan]||![botonchan $chan]} {return "I'm not on $chan"}
if {![string match *k* [getchanmode $chan]]} {return "There's no key on $chan"}
if {![botisop $chan]} {return "I'm not oped on $chan (i need to be to see the key :P)"}
return "The key on $chan is '[lindex [split [getchanmode $chan]] 1]' :)"
}
Of course, if there is a limit (+l) on the chan, and happens to be before the +k, then you will be returning the chanlimit instead of the key
strikelight wrote:
Of course, if there is a limit (+l) on the chan, and happens to be before the +k, then you will be returning the chanlimit instead of the key
Nope. (the key is always the second element if there's a key)