I searched the archive for the script in the topic and found voiceme.tcl by Silviu. However I think it's limited to only 1 channel. Can it be edited to include more than 1? Also, is this script secure to be allowed for pub? Thanks
set vchan #channel
bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
global vchan
global botnick
if {![onchan $nick $vchan]} {
puthelp "NOTICE $nick :I do not see you on $vchan"
return 0
}
if {[isvoice $nick $vchan]} {
puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
return 1
}
pushmode $vchan +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
}
set vchans "#channel #channel2"
bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
global vchans botnick
foreach vchan [split $vchans] {
if {![onchan $nick $vchan]} {
puthelp "NOTICE $nick :I do not see you on $vchan"
continue
}
if {[isvoice $nick $vchan]} {
puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
continue
}
pushmode $vchan +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
}
return 1
}
Thanks for the prompt reply. It's all good except it assumes that the user is on both channels. So if the user is only on #channel, he'll receive the message: "I do not see you on #channel2"
Is there anyway to make the bot scan which channels the user is on and then voice him in that channel without noticing him that he is not on the other channels in the script? Or do I need to bind another keyword like voiceme2?
set vchan1 #channel1
set vchan2 #channel2
##### Channel 1 #####
bind msg - voiceme1 msg:voiceme1
proc msg:voiceme1 { nick host hand text } {
global vchan1
global botnick
if {![onchan $nick $vchan1]} {
puthelp "NOTICE $nick :I do not see you on $vchan1"
return 0
}
if {[isvoice $nick $vchan1]} {
puthelp "NOTICE $nick :You already have +v on $vchan1. If you do not need use /msg $botnick devoiceme1"
return 1
}
pushmode $vchan1 +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
}
##### Channel 2 #####
bind msg - voiceme2 msg:voiceme2
proc msg:voiceme2 { nick host hand text } {
global vchan2
global botnick
if {![onchan $nick $vchan2]} {
puthelp "NOTICE $nick :I do not see you on $vchan2"
return 0
}
if {[isvoice $nick $vchan2]} {
puthelp "NOTICE $nick :You already have +v on $vchan2. If you do not need use /msg $botnick devoiceme2"
return 1
}
pushmode $vchan2 +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
}
One question I have is, is it possible to bind 2 trigger wrods to one command? For example: