proc AV_V {N C c} {
global av_M
if {$av_M($c) == 0} {return 0}
if {[onchan $N $C] && ![isvoice $N $C]} {
putquick "MODE $C +v $N"
}
return 0
}
I want to modify this proc so the script won't voice a user that has a global or channel q flag. By the way : q flag means "quiet" user (user cannot gain voice)
Use "matchattr" to test wether a user has a given flag or combination of flags.
The following should be "true" if the user has neither global or channel-speciffic q:
Now, since you did not post the full script, you'll have to figure out how to get the handle and channel. I would guess $C is the channel, and $N is the nickname to be voiced, and in this case you could use nick2hand to get the handle:
Thanks for yur help, and indeed, you are right about the intuitive thing. I need to add a new condition now before voicing a user. I dont want the script to voice anyone when the channel is on mode "D", case sensitive. What to do to test that mode "D" is one of the channels modes at that time ?
string match "*D*" [lindex [split [getchanmode $C]] 0]
This extracts the first part of the channelmode, getting rid of any channelkey and/or limit, then does a simple match to see wether there is a capital D within the remaining string. If there is, it will return true.
In your case, you would probably like to negate it, as shown earlier posts.