It turns on/off the moderation on the channel. You need to add a variable: %modchan <true/false>
on 1:TEXT:!modon:#: {
if (%modchan == false) { mode $chan +m | set %modchan true | /msg $chan $nick has made the channel +m }
else { /msg $chan The channel is already moderated. Please try when the channel is not moderated. }
}
on 1:TEXT:!modoff:#: {
if (%modchan == true) { mode $chan -m | set %modchan false | /msg $chan $nick has made the the channel -m }
else { /msg $chan The channel not moderated. Please try when the channel is moderated. }
}
also, coolsecretspy, if using the original script, make sure %modchan matches the mode for the channel before you attempt to use it. Finally, the person running the script has to be oped.
Jethro_, you could a check with the $gettok after the mode change with and if-else statement to message the chan as well. This way it functions aesthetically identically to the original script.
cooksecretspy, this snippet by ChrisP wasn't made with careful consideration. The person who triggers the snippet has to be either voiced or opped or above to command the bot to turn the moderation on and off. Try this version by napa with jaytea's suggestion:
on @*:text:!modem:#:{
if $nick !isreg # {
mode # $+($iif(m !isincs $gettok($chan(#).mode,1,32),+,-),m)
}
}
The command is: !modem
If the +m is set, the command will demode it; if not, it'll set it.
P.S. The check for people who are regular users are rather pointless really, because moderation mode won't apply to them...
instead of setting false, unset the variable to turn it off and when checking for false, instead check for $null.
This way, a user doesn't have to manually set the variable to use the script. :)
also, you don't need a slash in front of msg.
finally, you may want to add a check ($nick isvoice #). this will allow anybody voiced to do the command. it won't (I don't think) allow ops. (although they can just use their client for that)
Happy Scripting :)