mIRC Homepage
Posted By: J0ke Query flood protection... - 01/09/03 07:16 PM
This would be very good adition. #)(%*@#% floodclones...
Posted By: pheonix Re: Query flood protection... - 01/09/03 07:59 PM
on ^*:TEXT:*:?:{
if (!%flood) {
set -u5 %flood 1
}
elseif (%flood <= 5) {
inc -u5 %flood
}
elseif (%flood > 5) {
window -c $nick | haltdef
}
}
Posted By: LocutusofBorg Re: Query flood protection... - 01/09/03 08:32 PM
Once again, massive correcting of code:

Code:
on *:TEXT:*:?: {
  [color:green]; no need to check if %flood exists. inc will increment to 1 if it doesn't[/color]
  inc -u5 %flood
  [color:green]; trigger only when it IS 5 to avoid creating a flood yourself[/color]
  [color:green]; although there is little to no chance of that with the /ignore in place[/color]
  if (%flood == 5) { 
    [color:green]; ignore all queries for the next 60 seconds.[/color]
    [color:green]; not doing this will keep the script triggering over and over and over and over....[/color]
    ignore -mu60 *!*@*
    [color:green]; since you used ? for query, you might wanna use -m (query) and not -c (dcc chat),[/color]
    [color:green]; and leave out the $nick so ALL query windows get closed instead of just the last[/color]
    [color:green]; nick who msgd you (this will also work against a multiple-nick query flood...)[/color]
    close -m
    [color:green]; haltdef? why? there is no reason for it in this code[/color]
  }
}
Posted By: pheonix Re: Query flood protection... - 01/09/03 08:39 PM
even though there was no faults, you just felt you had to improve it crazy
Posted By: J0ke Re: Query flood protection... - 01/09/03 08:42 PM
I would like to see it built in. "Protection against multiple queries being opened." Maybe an option to set max queries would be good. Theese examples wont work against 350 floodclones... mIRC just hangs untill all 350 queries r opened...
Posted By: LocutusofBorg Re: Query flood protection... - 01/09/03 08:42 PM
No faults? I would consider the part where your code only works against a single-nick flood a major fault in a flood protection script. If someone loads a few dozen floodbots that each start flooding you your code doesn't stand a chance, as it won't do. It will nicely close each 5th message window, allowing all the other bots to flood you into oblivion.

Then a minor fault being the pointless if statements, which take time and slow down the effectiveness of the code.
Posted By: LocutusofBorg Re: Query flood protection... - 01/09/03 08:44 PM
Actually, my code will protect against 350 queries being opened -- when the 5th query opens within 5 seconds, all others will be ignored. So the other 345 queries won't be opened. A few may slip by, but it can't be much.
Posted By: v0id Re: Query flood protection... - 01/09/03 11:11 PM
Quote:

I would like to see it built in. "Protection against multiple queries being opened." Maybe an option to set max queries would be good. Theese examples wont work against 350 floodclones... mIRC just hangs untill all 350 queries r opened...


on ^*:OPEN:?:*: {
if ($query(0) >= 20) {
if (!$window($+(@Query, $cid))) {
window -nv $+(@Query, $cid)
}
aline -hpi2 $+(@Query, $cid) $timestamp $+(<,$nick,>) $1-
halt
}
}
Posted By: pheonix Re: Query flood protection... - 01/09/03 11:24 PM
Code:
on ^*:TEXT:*:?:{
  if (!%flood) {
    set -u5 %flood 1
  }
  elseif (%flood &lt;= 5) {
    inc -u5 %flood
  }
  elseif (%flood &gt; 5) {
    inc -u5 %flood
    window -c $nick | haltdef
  }
} 

add an extra inc -u5 and its fine :tongue:
Posted By: Ashkrynt Re: Query flood protection... - 02/09/03 12:09 AM
The option for ignoring private messages is -p, not -m. -m will appear to work but it actually ignores everything.
Posted By: LocutusofBorg Re: Query flood protection... - 02/09/03 04:10 AM
Actually it's not - it still won't actually protect you from the flood. You just keep on closing windows until the server disconnects you for being flooded. You cannot script this right without at some point flipping an ignore.
Posted By: LocutusofBorg Re: Query flood protection... - 02/09/03 04:10 AM
My bad.
Posted By: psycogod Re: Query flood protection... - 02/09/03 05:38 PM
if your worried about so many clones attacking use /silence
Posted By: Watchdog Re: Query flood protection... - 02/09/03 05:45 PM
/silence list is limited to 10, on my network anyway, and is useless unless all clones have an identical user ID. A better option, if your server software supports it is /umode +m as it stops private messages at server level. You would only need to have this on fairly briefly as you'd then have time to manually block the attack while not feeling the affects of it.
Posted By: Raccoon Re: Query flood protection... - 02/09/03 08:35 PM
EFNet just added this exact feature, but it's usermode +g
//mode $me +g

Blocks all private messages, notices, etc.. and warns you via /notice if someone is trying to contact you... unless you're being flooded. I'm guessing if you're being flooded while you're +g, it alerts opers present and aids them in k-lining them, since it would be obvious they're blindly messaging someone who doesn't want to be messaged.
Posted By: LocutusofBorg Re: Query flood protection... - 02/09/03 08:41 PM
On DALnet you could use mode +R, which stops msgs from users who haven't identified to NickServ -- which is exactly the reason I used /ignore. /silence is limited, and so many networks have so many relevant usermodes. The user should be able to change the /ignore with something that might work better on his network, but for all purposes, I feel a network-independent code fits best on these forums, unless the user in his question clearly states he wants to use the code on a certain network.
Posted By: neophyte Re: Query flood protection... - 03/09/03 05:11 AM
Actually, you are incorrect in using -c in the ignore command for DCC's.


The help file lists -d for ignoring DCC's. -c is for Channels.
© mIRC Discussion Forums