With this code the script works when called with either the pub or msg trigger. The problem is that anyone can msg the trigger to the bot without being in #channel. I need some help with the code to make it check if the user is on #channel and then if a)the user is not on the channel they would get a message informing them that they need to join #channel or b)they are on the channel and can use the script.
Set your channel here
set channel "#mychannel"
### PUB TRIGGER ###
bind pub - trigger pub_trigger
proc pub_trigger {nick uhost hand chan text} {
global channel
if {([string equal -nocase $channel $chan])} { # do your stuff
}
}
### MSG TRIGGER ###
bind msg - trigger msg_trigger
proc msg_trigger {nick uhost hand text} {
global channel
if {(![onchan $nick $channel])} { putserv "PRIVMSG $nick :You need to join $channel for this script to be triggered."; return 0 }
if {([onchan $nick $channel])} { # do your stuff
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Set your channel here
set channel "#mychannel"
### PUB TRIGGER ###
bind pub - trigger pub_trigger
proc pub_trigger {nick uhost hand chan text} {
global channel
if {([string equal -nocase $channel $chan])} { # do your stuff
}
}
### MSG TRIGGER ###
bind msg - trigger msg_trigger
proc msg_trigger {nick uhost hand text} {
global channel
if {(![onchan $nick $channel])} { putserv "PRIVMSG $nick :You need to join $channel for this script to be triggered."; return 0 }
if {([onchan $nick $channel])} { # do your stuff
}
}