Ok, I want to have a script that will activate on a /msg $botnick but look in a channel for the trigger phrase (well, character), when the users give that character (a single ' * ', I think I defined that right) it will voice that user and put their nick in a file to be used later, then on /msg $botnick voiceoff, it will read each of those users out of that file and devoice them. I think I have the second part right, but I can't get the first part to work correctly. Can anyone help me out? Here is the script that I have so far:
That would make it so that everyone who sends a /msg to the bot with the trigger would be voiced, right? That's not exactly what I want. I want to turn on the script with a message to the bot, but have the trigger be something that is said in the channel text, not as a /msg
Well, I still don't understand what exactly you're asking for? If you mean you want the bot to voice those who say * in a channel only when you have voice set to on, then you can bind msg to voiceon for example, and set a variable to 1, then set it to 0 if voiceoff is sent. In the pub bind check if the variable is set to 1 then voice the nick.
Ok, I think I see what you're saying. Let me see if I got it right:
bind the msg to voiceon to start the script, then inside that set a variable to 1 that is default set to 0, and have another proc look for the trigger in the channel, but only if the variable is set to 1
So do I have the second bind check for the trigger? IE:
bind pub \* voice:on
proc voice:on { nick host hand chan args } {
if [$variable == 1] {
(add nick to file and voice nick in channel)
}
}
bind pub * voice:on
proc voice:on {nick host hand chan arg} {
if {$::variable == 1} {
(add nick to file and voice nick in channel)
}
}
When using the pub bind, * means the character '*' and not a wildcard (to match with wildcards use pubm) and don't use args in a proc as it has a special meaning, instead use arg for example. Also $variable should be global since you're gonna use it in diferent procs, that's why I used $::variable but you can simply add 'global variable' at the beginning of each proc and normally use $variable.