mIRC Homepage
Posted By: KlasicKumputerz Auto Channel Modes! - 31/07/14 08:29 PM
I am looking for a script that will auto re set certain modes like to -m or -G or -U if the server sets them to +m or +G or +U. I want this to set -m, -G, -U automatically when the server does.
Posted By: Nillen Re: Auto Channel Modes! - 31/07/14 09:08 PM
Code:
on @1:RAWMODE:#CHANNEL: {
  var %users $2-, %mode $1, %n $nick
  if (%n == $me) halt
  elseif (%n != ChanServ) notice %n You're not allowed to use the mode system.
  elseif (%n == ChanServ) && ($me isin %users) halt
  var %m $left(%mode,1)
  var %action $iif(%m == +,-,+)
  var %mode $replace(%mode,%m,%action)
  /mode # %mode $iif(%users,$v1,$null)
}
I'm using something similar.
Posted By: KlasicKumputerz Re: Auto Channel Modes! - 31/07/14 09:14 PM
This one is a little more complicated than I need. Plus I don't want it to send chanserv messages.
Posted By: hixxy Re: Auto Channel Modes! - 31/07/14 09:27 PM
Code:
on @*:rawmode:#channel:{ mode # -mGU }


/mode doesn't throw out an error message if the mode is already set / not set, so just unset the modes whenever the modes in the channel change.

No need for any complex checks or parsing of the modes.
Posted By: KlasicKumputerz Re: Auto Channel Modes! - 31/07/14 09:29 PM
I'll give that a try and report back.
Posted By: Nillen Re: Auto Channel Modes! - 31/07/14 10:23 PM
My bad, I assumed that you wanted all modes to be reversed upon change.

Either way, it was primarily intended to become a template for you to use.
Posted By: KlasicKumputerz Re: Auto Channel Modes! - 05/08/14 11:28 PM
This works perfect.




Originally Posted By: hixxy
Code:
on @*:rawmode:#channel:{ mode # -mGU }


/mode doesn't throw out an error message if the mode is already set / not set, so just unset the modes whenever the modes in the channel change.

No need for any complex checks or parsing of the modes.
Posted By: hixxy Re: Auto Channel Modes! - 06/08/14 08:59 PM
Good stuff smile
© mIRC Discussion Forums