I'll use it on Quakenet.I want to devoice who had been voiced by @'s except Q bot.e.g If I voice someone my bot will devoice him.But if Q voice him my eggdrop will do nothing.I found a little code for irc script but i couldn't find .tcl version of it.Here is the script version of it.Maybe it helps to understand what i want the hostmask is belong to Q bot.If there is a few way to do it i'll really appreciate.
You can try this code
So what will actually do is if someone will voice an user on that specified channel from the script and its not Q it will devoice the user who got voiced. If bot voices someone he wont do anything
He only asked for a script that will devoice used who are not voiced by Q (or the bot himself) if the user gets +vo i don`t think -v would mean something tot that user. So i only matched the +v channel mode and never tested for +vo
But i will make another version now that you mentioned that
### EDIT
I tested for +vo it seems like the bot keeps tracks for every mode once so its should be ok
Mode bindings are indeed triggered once for each mode, not once for the MODE command. Separating which parameter (in this case, the nickname), is also handled by eggdrop itself - target will always be the parameter applied to this mode-change (or empty string in the event that the current mode-change does not have a parameter).
I knew that, my point was that the egghelp:mode would have been triggered for each mode change in particular. For instance, in a +vvvvvv user1 user2 user3 user4 user5 user6 mode, the egghelp:mode would be triggered 6 times.
A better way to deal with this would have been a raw mode bind.
Once the game is over, the king and the pawn go back in the same box.
Since the script uses pushmode, you'd still gain the mode-stacking advantage, yet you don't have to bother with dividing up each mode change yourself. As for the performance impact, 1 bind trigger as opposed to 6, I'd consider that neglible.
If you're a real Cookie Cutter, Just change the bind mask from * to "#saphira +v", and skip the checks for channelname and mode:
Yet i will try use something like this in the future ... and i used string tolower to check the channel because in the past i encoutered problems with the channel names. $temp(chan) != $chan (#Saphira with #saphira) sometimes the eggdrop would recognise the channel with an "S" and sometimes with 's'
Madalin,
No worries, your code looks good enough to me. Using switch might be a bit excessive, but then again, it makes the function easy to extend for other modes as well.
If you don't care for compatibility with older versions of tcl, you could use "string equal -nocase $temp(devoice) $chan" when comparing the channel (as for the case of the channel name, that all comes down to what the actual mode-changer used).
I always use that kind of code. I like using switch because it gives me alot of movement in the future if i want to update the script and its easier to read the code atleast for me