mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Does it really matter? It's like comparing dicksizes.

So what, a millisecond here really is gonna kill someone.

If the script works, then it works. If someone else had somethat that shaved 1sec-5sec of processing time, then I'd be impressed, but given the speed of most systems these days, 1ms really is gonna cut your balls waiting for it to be processed.


Phoenix: you replied in one part of this thread that your code checked if a certain variable was greater than something, well, it doesn't, it actually checks if it's less than.

>= checks for greater or equal.

And yes, I am aware of your return statement, and else statement.

Wouldn't it however, be far simpler to do this:

if (%var >= somenumber) { do action } ?

*edit* - remove the additional > in the %var


--------
mIRC - fun for all the family (except grandma and grandpa)
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
Code:
on *:TEXT:*:#:{
inc -u5 %flood. [ $+ [ $nick ] ]
if (%flood . [ $+ [ $nick ] ] <= 4) { return }
else { ban -k $chan $nick }
} 

i realise that checks that its less than, but it doesnt kick unless its more than..


new username: tidy_trax
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
As I said, I know you have a return and an else statement.

I was just simply pointing out an error you made in a latter post, etc.


--------
mIRC - fun for all the family (except grandma and grandpa)
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
your way would be easier, i just edited my own flood prot, where it gives warnings etc.


new username: tidy_trax
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Again, the pointless time consuming if statement that does nothing. In scripts where speed is of the essence, don't waste time with useless if statements.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
like i said, when my script missed the 5, it would have worked, yours wouldnt.
however neophyte's would be the best(fastest)


new username: tidy_trax
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Plus a useless "else". If the above condition was true, the script would have returned and never seen the "else".

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i know, like i also said, i just modified my own flood protection with warnings.


new username: tidy_trax
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
(pheonix: this is a general reply, it's just that your post is currently the last one with the "Reply" link :tongue:)

Well, after thinking a little, I don't know why I agreed with ignoring *!*@*. If various flooders attack a channel, the script would only kickban one of them, ignoring the rest by 5 secs, while it could be kickbanning them as well.. I guess it would be fast enough to bypass the screen flood they may cause.
So, the best thing to do IMO is really just to ignore specific addresses.

Also, I thought about checking if /silence is supported and using it if so. This complicates things a little, because the absence of the SILENCE flag from numeric 005 isn't sufficient to assume it's not supported. This feature is easily removable, if considered useless.

That said, I don't know if this still matters to the thread poster, but anyway, I enjoyed scripting the code below and figuring out some other things. Now, I only want to share.. nothing more. Anyone is free to change/improve/fix/do whatsoever with it. It's not well commented but I hope it's still playable.

Code:
raw 421:* SILENCE *:{
  if ($var($+(%,flood.,$cid,.silence),1)) { unset $ifmatch | halt }
}
;;; The below raw events only work on mIRC 6.1, due to the $ level prefix
raw $005:/.* SILENCE=[1-9]\d* .*/i:{ set $+(%,flood.,$cid,.silence) 1 }
raw $000:/^[+-]\S+!\S+@\S+$/:{
  var %toggle = $left($1,1), %mask = $mid($1,2)
  if (%toggle == +) {
    if (%mask == <check>!*@*) {
      set $+(%,flood.,$cid,.silence) 1
      !silence -<check>
      halt
    }
    elseif ($($+(%,flood.,$cid,.silence.,%mask),2)) {
      set $+(%,flood.,$cid,.silence.,%mask) 1
      .timer.flood.silence. $+ %mask 1 60 silence - $+ %mask
      halt
    }
  }
  else {
    if ($($+(%,flood.,$cid,.silence.,%mask),2)) {
      set -u $+(%,flood.,$cid,.silence.,%mask)
      halt
    }
    elseif (%mask == <check>!*@*) { halt }
  }
}

on *:CONNECT:{ if (!$($+(%,flood.,$cid,.silence),2)) !silence +<check> }
on *:DISCONNECT:{ unset $+(%,flood.,$cid,.*) }

on @^*:TEXT:*:#:{
  inc -u5 $+(%,flood.,$cid,.,$wildsite,.,$chan)
  if ($($+(%,flood.,$cid,.,$wildsite,.,$chan),2) > 4) { 
    ban -k $chan $nick 2 Stop flooding dude
    .ignore -u5 $wildsite
    if ($($+(%,flood.,$cid,.silence),2)) {
      set $+(%,flood.,$cid,.silence.,$wildsite) 1
      !silence + $+ $wildsite
    }
  }
}


* cold edits his posts 24/7
Page 2 of 2 1 2

Link Copied to Clipboard