Note: The mainteinance of the scripting examples is discontinued since I no longer have an interest to continue doing so. The pages will remain here, for now, but that might not be the case in the future. You are free to download all the material on these pages and set a up mirror, or even continue the maintenance of the material by enhancing the examples yourself.

All the material in these examples are for the mIRC version 6.03. It is very likely that some or most of these examples won't work in future versions.

Automatical kick for repeating

Some people create annoyance by repeating the same line over and over. Reasons for this vary. It might be spamming or just something else that's very disruptive. Kicking for repeating is usually very safe since it's very rare that anyone will keep repeating identical lines accidentally.

The algorithm for dealing with repeating is rather simple. You store the last line of every user into a hash table and set the item to expire for the time you want the repeat algorithm to take effect. If the user is repeating, the script increases a counter variable. If the counter variable is greater than the allowed number of repeats, then the script will kick. Note that even this simple script might take lots of processor time when someone tries to flood the channel. That's why it's important to set the script to work only in the circumstances you really want it to work in. Configure it to work only in the channels you need it.

Example script

; This script kicks users on #chat and #idle if they repeat the same line
; four times within five minutes

on @*:TEXT:*:#chat,#idle: {
  ; If the user is repeating, increase the counter
  if ( $hget($+(repeattext,$cid,$chan),$nick) == $1- ) {
    inc -u300 $+(%,repeatcount,$cid,$chan,$nick)

    ; If the user is repeating more then three times, ban and kick
    if ( $eval($+(%,repeatcount,$cid,$chan,$nick),2) > 3 ) {
      mode $chan +b $mask($fulladdress,3)
      kick $chan $nick Automatic ban for repeating
  else {
    ; If the user isn't repeating, reset the variables
    ; Set the time limit to five minutes (300 seconds)
    hadd -mu300 $+(repeattext,$cid,$chan) $nick $1-
    ; /set and /inc need the -u switch only to clean unneeded variables
    set -u300 $+(%,repeatcount,$cid,$chan,$nick) 1

Replace the highlighted channels with channels you want the script to act on.

Last updated 2003-04-05, Janne 'Geetee' Nikula,