Remove +R on services split

By NiveusLuna on Apr 12, 2008

The name should tell you, but for the idiots out there, here it is again :P. When services split from the network, this script should remove +R on any channels you have op in.
I unfortunately do not know if, once triggered, it will remove +R for all channels in multiple networks at once or not. Someone please try to break it :D.
When you first load this, create a variable in your variables tab called %quit and set it to value 0. It should read as "%quit 0" in the display. Replace "Services.Caelestia.net" with your services server, whatever it is, and you should be good to go.
I'm hoping the %quit thing will keep it from triggering multiple times from multiple bots.
I use %NumberOfChannels here on purpose so I know what I'm looking at. I'm not used to the mIRC notation yet.
<-- uses Java too much

on *:QUIT:{
  if (( Services.* isin $1- ) && (%quit == 0)) {
    set %quit 1
    timer 1 5 set %quit 0
    var %NumberOfChannels = $chan(0)
    var %i = 1
    while (%i <= %NumberOfChannels) {
      if ((R isincs $chan(%i).mode) && ($me isop $chan(%i)) { mode $chan(%i) -R }
      inc %i
    }
  }
}

Comments

Sign in to comment.
Cheiron   -  Nov 25, 2008

so what about servers where OperServ itself sets a server wide +R mode? you do a manual -R when that happens and OperServ will just pop it right back on

 Respond  
Joshuaxiong1   -  Nov 25, 2008

oh... hum..

 Respond  
NiveusLuna   -  May 02, 2008

Pay attention >_>. This removes +R on netsplits.

 Respond  
Joshuaxiong1   -  Apr 13, 2008

Why would you want to set +R on net splits? imagine if owner get dc and he can\'t get back on his channel

 Respond  
NiveusLuna   -  Apr 12, 2008

And I thought I did that already. Guess not. adds

 Respond  
NiveusLuna   -  Apr 12, 2008

That\'s a good idea. It\'d make it more universal. Thing is though, it\'d also be easier to set off accidentally.
Then again, that\'s what modelock is for. shrug

 Respond  
F*U*R*B*Y*   -  Apr 12, 2008

uhm, add a if ($me isop $chan(%i)) {

 Respond  
Jonesy44   -  Apr 12, 2008

Could be made a little simpler .. ?

on *:QUIT:{
  if (*services* isin $1-) {
    var %i = 1
    while (%i <= $chan(0)) {
      if (R isincs $chan(%i).mode) {
        mode $chan(%i) -R
      }
      inc %i
    }
  }
}
 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.