Moderation on/off

By ChrisP on Nov 30, 2010

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. }
}

Comments

Sign in to comment.
Savage_CL   -  Jan 06, 2011

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.

 Respond  
Jethro   -  Dec 04, 2010

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...

 Respond  
coolsecretspy   -  Dec 04, 2010

this script doesn't work, it doesn't moderate the channel, it just says The channel is already moderated. Please try when the channel is not moderated. when the channel isn't even moderated.

 Respond  
napa182   -  Dec 01, 2010

ah so true forgot about keyed chans
hmm tried it without the $gettok with a key set to m and still sets +/-m without screwing with the key, but i guess to be on the safe side use $gettok

 Respond  
Jethro   -  Dec 01, 2010

Ditto.

 Respond  
jaytea   -  Dec 01, 2010

try to get into the habit of using $gettok($chan(#).mode, 1, 32) since extra parms such as channel keys could conceivably include the letter 'm'.

 Respond  
napa182   -  Nov 30, 2010

lol
could do something ez like

on @*:text:!modem:#:{
  if ($nick isop #) {
    mode # $+($iif(m !isincs $chan(#).mode,+,-),m)
  }
}

if you don't want all then messages.

 Respond  
Jethro   -  Nov 30, 2010

The question is, how are you supposed to trigger the !modoff when the channel is in moderation mode? Only the voiced, ops or above should be able to bypass that.

 Respond  
napa182   -  Nov 30, 2010

why use a var in the first place? look into using $chan(#).mode then make a if comparison.

 Respond  
Dark|   -  Nov 30, 2010

lol
why not just set it by yourself two clicks your done xD

 Respond  
Savage_CL   -  Nov 30, 2010

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 :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.