mIRC Home    About    Download    Register    News    Help

Print Thread
#32667 27/06/03 04:37 PM
M
Me2k3
Me2k3
M
Hi, is it possible to protect another OP from being banned (and/or kicked) - (i.e. just like a ban protect script for yourself but one that protects another OP)

thanks for ur help!

P
pheonix
pheonix
P
i can only make 1 that will kick them straight after.

T
Thedude
Thedude
T
You can't stop the kick and ban, but you can unban him.

Code:
on *:ban:#channel:{
if ($me !isop #) halt
if ($bnick isop #) { mode # -b $banmask | mode # -o $nick }
}

Last edited by Thedude; 27/06/03 05:47 PM.
Joined: Dec 2002
Posts: 168
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 168
$bnick is only filled if is in the banmask itself. Ex:
mode #mirc +b loser!*@*somehost.com -> $bnick is "loser" even if there is no such nickname on the channel.
mode #mirc +b Jerk!*@not.my.real.host -> $bnick is "Jerk" (me) even though the ban does not really match me.
mode #mirc +b *!*@my.real.host -> $bnick is $null even though the ban does match me.

$bnick is really sort of worthless. You need to loop through $ialchan() to really find out who matches the ban or not. This means you're ial list must be updated.
Code:
on !@*:ban:#:{
  var %i = 1
  while ($ialchan($banmask,$chan,%i).nick) {
    if ($ifmatch isop $chan) {
      mode $chan -ob $nick $banmask
      halt
    }
    inc %i
  }
}
To the original poster:
You cannot really block kicks because by the time mIRC knows about a kick it already has happened. The best you can do is punish the kicker and invite the kicked person back.
Code:
on !@*:kick:#: {
  if ($knick isop $chan) { 
    mode $chan -o $nick
    if (i isin $gettok($chan($chan).mode,1,32)) { .invite $knick $chan }
    if ($chan($chan).key != $null) { .notice $knick Please rejoin. Type: /join $chan $ifmatch }
  }
}

Another note. You kind of need a deop protection script as well. Otherwise one op could deop another op, then kick or ban and your script wouldn't protect them at all. Deop protection scripts can be kind of dangerous. You WANT your channel ops to be able to deop a person if they got accidently opped.

Joined: May 2003
Posts: 215
L
Fjord artisan
Offline
Fjord artisan
L
Joined: May 2003
Posts: 215
You might want to try mIRC's /protect system, (/help /protect)
This will do what you're asking for


Link Copied to Clipboard