mIRC Home    About    Download    Register    News    Help

Print Thread
#247380 31/07/14 08:29 PM
Joined: Apr 2009
Posts: 34
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2009
Posts: 34
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.


Computer expert of 32 years!
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2009
Posts: 34
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2009
Posts: 34
This one is a little more complicated than I need. Plus I don't want it to send chanserv messages.


Computer expert of 32 years!
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Joined: Apr 2009
Posts: 34
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2009
Posts: 34
I'll give that a try and report back.


Computer expert of 32 years!
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2009
Posts: 34
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Apr 2009
Posts: 34
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.


Computer expert of 32 years!
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Good stuff smile


Link Copied to Clipboard