This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

triggering on +mode exclusively, help! :(

Help for those learning Tcl or writing their own scripts.
Post Reply
m
magoni
Voice
Posts: 3
Joined: Wed Nov 28, 2007 10:48 pm

triggering on +mode exclusively, help! :(

Post by magoni »

Greetings!

I am writing a script that should, whenever a user halfops (changes mode to +h), the bot will output "CHARGIN UR LAZERS" to the channel.

Code: Select all

set m "+h"
bind mode - * userhop
proc userhop {nick uhost hand chan m victim} {
	puthelp "PRIVMSG $chan :CHARGIN UR LAZERS"
}
The issue: if someone -h (de-halfops), the bot runs proc userhop again (says CHARGIN UR LAZERS). I want it to only 'charge lazers' on +h, not -h. I have tried set m +h with and without quotes, with and without the + sign.

Does anyone have any possible fixes or insights as to why this may be happening? Thanks in advance!
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Well, you've set your mode-mask to *, basically matching any mode change.
Try something like this instead:

Code: Select all

bind mode - '% +h' userhop
proc userhop {nick host handle channel mode target} {
  puthelp "PRIVMSG $channel :CHARGIN UR LAZERS"
}
This should trigger on any channel, but only for +h modes.
NML_375
Post Reply