mIRC Home    About    Download    Register    News    Help

Print Thread
Ban protection 4 another OP #32667 27/06/03 04:37 PM
Joined: Jun 2003
Posts: 7
M
Me2k3 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Jun 2003
Posts: 7
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!

Re: Ban protection 4 another OP #32668 27/06/03 04:40 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i can only make 1 that will kick them straight after.


new username: tidy_trax
Re: Ban protection 4 another OP #32669 27/06/03 05:42 PM
Joined: Jan 2003
Posts: 41
T
Thedude Offline
Ameglian cow
Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 41
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.
Re: Ban protection 4 another OP #32670 27/06/03 07:43 PM
Joined: Dec 2002
Posts: 169
J
Jerk Offline
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
$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.

Re: Ban protection 4 another OP #32671 27/06/03 09:39 PM
Joined: May 2003
Posts: 215
lammkott Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2003
Posts: 215
You might want to try mIRC's /protect system, (/help /protect)
This will do what you're asking for


- Jason