mIRC Home    About    Download    Register    News    Help

Print Thread
simple flood script requested #171222 21/02/07 09:40 AM
Joined: Jan 2003
Posts: 66
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Jan 2003
Posts: 66
I'd like a script that bans on a certain number of messages/seconds, but only if it's right after they joined.

sometimes regular members will paste large bits of text and that's fine, but it'a almost always a flooder if right when they join they start spamming tons of text. how would I make this?

Re: simple flood script requested [Re: maezr] #171226 21/02/07 12:25 PM
Joined: Jan 2007
Posts: 259
K
Kardafol Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
Code:
on @*:join:#Yourchannel: {
  set -u60 %jointimer. [ $+ [ $+($server,.,$cid,.,$chan,.,$nick) ] ] 1
}
on @*:text:*:#Yourchannel: {
  var %xid = $+($server,.,$cid,.,$chan,.,$nick)
  ; Change the # of times they can say somthing in x seconds before it bans/kicks here. Just edit the number after "%times =" or "%seconds =".
  ; %bantime is the number of seconds they will be banned.
  ; if %ban is 1, they will be banned and kicked for %bantime seconds, if %bantime is 0 it will need to be manualy removed.
  ; %kickreason is the reason you will see when they are kicked.
  var %times = 3, %seconds = 2, %bantime = 60, %ban = 0, %bantype = 2, %kickreason = Flooding


  if (%joinflood. [ $+ [ %xid ] ] > %times) {
    if (%ban) {
      ban $iif(%bantime > 0,-u [ $+ [ %bantime ] ]) $chan $nick %bantype
    }
    kick $chan $nick %kickreason
    unset %jointimer. [ $+ [ $+($server,.,$cid,.,$chan,.,$nick) ] ]
    return
  }
  if (%jointimer. [ $+ [ %xid ] ]) {
    inc -u [ $+ [ %seconds ] ] %joinflood. [ $+ [ %xid ] ] 1
  }
}

This script will only work if you are an OP in the channel, if you are a halfop you can remove the "@" at the first line of the events.
You can also change everything in the script via variables.
I haven't tested it, but it should work.
If it doesn't work, post a reply and I'll see if I can fix it (include any error messages/etc).


Those who can, cannot. Those who cannot, can.
Re: simple flood script requested [Re: Kardafol] #171258 22/02/07 01:33 AM
Joined: Feb 2007
Posts: 28
S
sner Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 28
on 1:TEXT:*:#channelname: {
if $len($parms) > = 330 { goto tf }
inc %tf [ $+ [ $nick ] ] | .timer 1 5 unset %tf [ $+ [ $nick ] ]
if %tf [ $+ [ $nick ] ] == 5 { goto tf }
goto end
:tf
unset %tf [ $+ [ $nick ] ]
if ($nick isvo #) { halt | goto end }
if ($nick isop #) { halt | goto end }
if ($me !isop #) halt
kick # $nick please don't flood
:end
}

Re: simple flood script requested [Re: sner] #171264 22/02/07 03:02 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I haven't tested your code, sner, but a few things I noticed.
1) When posting code, please use the Code Tags (which looks like the # character)
2) Usage of GOTO, while available, is, generally, not recommended
3) Usage of HALT statements, again, generally, is not recommended
4) I was unable to find the $parms identifier in the help file (this may be an old identifier, and may not work with up-to-date versions of mIRC)

Here's a suggestion for a re-write of your supplied code
Code:
on @*:text:*:#:{
  if $nick !isreg $chan {
    if $len($1-) < 330 {
      unset $+(%,tf,$address)
    }
    else {
      inc -u5 $+(%,tf,$address)
      kick $chan $nick Please don't flood
    }
  }
}