mIRC Homepage
Posted By: Abuser__ Op check - 22/04/05 01:47 PM
Is it possible to make the script that checks the channel every 5 minutes and ops people who are on auto op list or level 2000?

grin
Posted By: tidy_trax Re: Op check - 22/04/05 02:27 PM
Code:
on *:op:#:{
  if ($opnick == $me) { .timer 0 300 opcheck $chan }
}
alias opcheck {
  if ($me isop $1) {
    var %i = 1
    while ($nick($1, %i)) {
      if ($v1 isaop) || ($level($address($v1, 5)) == 2000) { mode $1 +o $nick($chan, %i) }
      inc %i
    }
  }
}
Posted By: BarGarth Re: Op check - 22/04/05 04:01 PM
to make a little improvement:

use $nick($1, %i, hvr) instead of $nick($1, %i) to check only those people that aren't already an op and stop opping them several times.
Posted By: tidy_trax Re: Op check - 22/04/05 07:26 PM
Good point.. but instead of using hvr you can use ao to mean 'anyone except ops'

Code:
on *:op:#:{
  if ($opnick == $me) { .timer 0 300 opcheck $chan }
}
alias opcheck {
  if ($me isop $1) {
    var %i = 1
    while ($nick($1, %i, ao)) {
      if ($v1 isaop) || ($level($address($v1, 5)) == 2000) { mode $1 +o $nick($chan, %i) }
      inc %i
    }
  }
}
Posted By: BarGarth Re: Op check - 22/04/05 08:13 PM
then you should use $nick($1, %i, a, o) instead of $nick($1, %i, ao)

and not only in the condition of the while-loop but also the if-statement.

Code:
on *:op:#:{  
  if ($opnick == $me) { .timer 0 300 opcheck $chan }
}
alias opcheck {  
  if ($me isop $1) {    
    var %i = 1    
    while ($nick($1, %i, a, o)) {      
      if ($v1 isaop) || ($level($address($v1, 5)) == 2000) { mode $1 +o $nick($chan, %i, a, o) }      
      inc %i    
    }  
  }
}
 


only problem if you this method on ircX-servers the owners (+q) will still be affected, which is not the case with hvr (actually vr is enough since h is not used on most ircX servers)
© mIRC Discussion Forums