mIRC Home    About    Download    Register    News    Help

Print Thread
#184716 31/08/07 06:46 PM
Joined: Aug 2007
Posts: 8
A
Awake Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Aug 2007
Posts: 8
So there is lots of scripts out there that will rescue a channel if a group of ops suddenly get deopped all at once.

But what about slower ops removal?

Where instead of the person trying to take over going:

/mode # -ooo n1 n2 n3 etc..

They did:

/mode # -o n1
/mode # -o n2
/mode # -o n3 etc..

Mass deop scripts seem to not take this into account, so how would I approach making a small protection script to combat this method?

Any help offered is much appreciated :-)

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
How long is the interval between each deop?

Try this
Code:
on @!*:DEOP:#: {
    inc $iif(!$($+(%,deopfld,.,$chan,.,$nick),2),-eu10) $+(%,deopfld,.,$chan,.,$nick)
    if ($($+(%,deopfld,.,$chan,.,$nick),2) >= 3) ban -k # $nick 2 Mass DeOp. Go sit in a corner! 
}


^^ will set a variable for that nick who deopped another nick & if they do 3 or more deops within 10 secs, they will be kick-banned. If they have longer intervals, then change the 10 in -eu10, make it higher. Hope that helps.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Just a suggestion - I'd use "random" hash table items instead.
Personally, I dislike timers like "inc -uN" for protections etc, as they were "restarted" on every deop. (likely to named timers: every time they were triggered before they are "done", the unset period is reset. Flood protection scripts etc often have the same issue...) smile

Well, xDaeMoN escaped this source of error, but many scripts dont. frown

This is watching deops in general (disregarding the nick):
Code:
on *:deop:#: {
  var %timeout = 30, %limit = 3
  hadd $+(-mu,%timeout) $+(deop.,$network,.,$chan) $rand(1,999)
  if ($hfind($+(deop.,$network,.,$chan),*,0,w) > %limit) {
    echo -a more than %limit deops in %timeout seconds on $chan detected
  }
}

If you want to detect deops by a single nick, you can add e.g. the nickname as data for the hashtable item, and use $hfind().data:
Code:
on *:deop:#: {
  var %timeout = 30, %limit = 3
  hadd $+(-mu,%timeout) $+(deop.,$network,.,$chan) $rand(1,999) $nick
  if ($hfind($+(deop.,$network,.,$chan),$nick,0,w).data > %limit) {
    echo -a more than %limit deops in %timeout seconds by $nick on $chan detected
  }
}


Edit: if it's not about flood protection (and in this case it's not), $ticks would be as good as a random number for the item name of the hash table.

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Yeah, Im aware of using hash tables, but this code is what I've been using on my bot before so I just copy/pasted it. smile


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Aug 2007
Posts: 8
A
Awake Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Aug 2007
Posts: 8
Thanks a lot to both of you for the help!

Tis much appreciated :-)

Awake


Link Copied to Clipboard