mIRC Home    About    Download    Register    News    Help

Print Thread
#210597 21/03/09 12:42 PM
J
Joshy
Joshy
J
hi, im looking for a script, so if someone is spamming and sends like 3 lines in 5 seconds it kicks them.

#210598 21/03/09 01:47 PM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
If the network is using UnrealIRCd, I recommend using the +f channel protection mode, rather than a script, as that way the settings will remain intact even if the client that has the script is absent.

However, this should work
Code:
on *:text:*:#:{
  flood $chan $address $nick
}
on *:action:*:#:{
  flood $chan $address $nick
}
on *:notice:*:#:{
  flood $chan $address $nick
}
alias -l flood {
  .inc -u5 $+(%,flood,.,$network,.,$1,.,$2)
  if $($+(%,flood,.,$network,.,$1,.,$2),2) >= 3 {
    if $me isop $1 {      .kick $1 $3 Flooding    }
  }
}


#210599 21/03/09 02:12 PM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
I also recommend the usage of channelmode +f, if available.
Here's an alternative script, allowing you some more settings. Don't forget tu put the channel name of #YOURCHAN (you may specify multiple channels separated by comma)

Code:
on @*:text:*:#YOURCHAN: floodchk
on @*:action:*:#YOURCHAN: floodchk
on @*:notice:*:#YOURCHAN: floodchk

alias -l floodchk {
  ; ###### start of setup ###### 

  /*
  how to check for flooding. You can use:
  $!nick        to track acc. to a nickname
  $!site        to track acc. to the user's host
  $!address     to track acc. to "ident@host"
  $!fulladdress to track acc. to "nick!ident@host"
  */
  var %check = $!nick

  ; kick for N lines per N seconds
  var %lines = 3
  var %seconds = 5

  ; issue a kickban after N repeated kicks for flooding. If you set it to 0 it will never ban
  var %kickstoban = 3

  ; repeated kicks will be "forgotten" N seconds after the last kick
  ; (so you don't ban a user for "repeated flooding", if it was yesterday)
  var %unsetkicks = 600

  ; ###### end of setup ###### 

  hadd $+(-mu,%seconds) $+(floodcheck,.,$cid) $+($chan,.,%check,.,$rand(1,999999))
  if ($hfind($+(floodcheck,.,$cid),$+($chan,.,%check,.*),0,w) >= %lines) {
    if (%kickstoban) {
      hinc $+(-mu,%unsetkicks) $+(floodcheck.kicks,.,$cid) $+($chan,.,%check) 
      if ($hget($+(floodcheck.kicks,.,$cid),$+($chan,.,%check)) > %kickstoban) {

        BAN -k $chan $nick 1 Don't flood! (Limit is %lines lines per %seconds seconds)

        hdel $+(floodcheck.kicks,.,$cid) $+($chan,.,%check)
        return
      }
    }

    KICK $chan $nick Don't flood! (Limit is %lines lines per %seconds seconds)

    hdel -w $+(floodcheck,.,$cid) $+($chan,.,%check,.*)
  }
}

Last edited by Horstl; 21/03/09 02:30 PM.

Link Copied to Clipboard