mIRC Home    About    Download    Register    News    Help

Print Thread
#212334 19/05/09 11:04 AM
Joined: May 2009
Posts: 28
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: May 2009
Posts: 28
how to write a code for repeat kick if the chatter try to type the same msg in 5 line/min?


Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Code:
on *:text:*:#: {
  if (%repflood != disabled) && ($me isop $chan) {
    var %rp.repeats = rp. $+ $nick $+ . $+ $chan
    var %rp.text = rp. $+ $nick $+ . $+ $chan $+ .text
    if ( % [ $+ [ %rp.repeats ] ] == $null ) {
      set -u [ $+ [ %rep_time ] ] % [ $+ [ %rp.repeats ] ] 1
      set -u [ $+ [ %rep_time ] ] % [ $+ [ %rp.text ] ] $1-
    }
    elseif ( % [ $+ [ %rp.text ] ] == $1- ) {
      inc % [ $+ [ %rp.repeats ] ]
    }
    elseif ( % [ $+ [ %rp.text ] ] != $1- ) {
      set -u [ $+ [ %rep_time ] ] % [ $+ [ %rp.text ] ] $1-
      set -u [ $+ [ %rep_time ] ] % [ $+ [ %rp.repeats ] ] 1
    }
    if ( % [ $+ [ %rp.repeats ] ] >= %rep_antal ) {
      if (%repflood == 1) { ban $+(-u,$calc(%temp.ban * 60)) $chan $nick 3 }
      kick $chan $nick $eval(%rep.flood,2) $kcs
      unset %rp. $+ $nick $+ . $+ $chan
      unset %rp. $+ $nick $+ . $+ $chan $+ . $+ text
    }
  }
}

Disable the script.
/set %repflood disabled

Ban the user repeating
/set %repflood 1

How long time the ban should last (in minutes)
/set %temp.ban

Will kick the user, but not ban.
/set %repflood 0

Amount of repeats. (in your case 5)
/set %rp.repeats 5

Repeats during how long time. (in minutes)
/set %rep_time 1

I don't think i missed anything, untested tho. And the code goes in to your remote.. ALT + R in mirc.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2009
Posts: 28
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: May 2009
Posts: 28
dun seem to work .. can any1 teach me some simple code?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
first of all try to read some events :

/help on

then see the identifiers :

/help $

and at the end see the mirc if-then :

/help if then else


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Did you enable the script? did you set the settings? cos i can't see any reason why that wouldn't work, and you dont have a on text event a bow the code?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
There are countless repeat kicking scripts out there. If you google around with the search keywords: mirc repeat kicker
You'll easily get hit with one result that may fit your needs.


Link Copied to Clipboard