0

I'm looking for a way to kick users for flood. The idea is:

on [lessthanhalfop]:text:*:#chan: {
  If [timer$nick] !== 0 {
    set %kickstate$nick +1
    if %kickstate$nick < 4 {
      kick $nick #chan [reason:flood]
      echo > kickedlist.txt
      delete [timer$nick]
    delete [timer$nick]
    makenew timer with 4 seconds
    }
  Set timer$nick 5seconds
}

Can anyone help me with this so that it is workable with unique timers for each $nick so that they do not overide for each user. All i want it to do is kick people that flood the chat by typing within a particular time period(in this case 2 secons). Can anyone help me solve this?

I'm using mIRC, but the channel is in the swiftirc network, if anyone wants to know.

AstroCB
  • 12,337
  • 20
  • 57
  • 73
Tom
  • 1
  • 1

1 Answers1

1

Solution:
A. We are setting a variable and incremental (with a live span of 2 seconds) with the following format "cTxtFlood.USER-ADDRESS". this allow us to track every new flooder at our system + it will clean the people who talked BUT not flooders.

B. We are checking if the variable counter exceed X lines (5 in the example)

C. If flooder, then we are banning and kicking the user with a ban span of 300 seconds.

Little info:

chan - the channel you want to protect

@* - only if I got op at the channel
-u2 = unset variable in 2 seconds
ban -ku300 = kick and ban for 300 seconds

Complete Code (wasn't tested)

on @*:text:*:#chan: {
  inc -u2 % [ $+ [ $+(cTxtFlood.,$wildsite) ] ]
  if (% [ $+ [ $+(cTxtFlood.,$wildsite) ] ] == 5) {
    echo -ag ban -ku300 # $nick 2 Channel Flood Protection (5 lines at 2 sec's)
  }
}
Orel Eraki
  • 11,940
  • 3
  • 28
  • 36
  • 1
    Be aware that this script will do certain things when places in a file with other scripts. If placed above any other `on *:text:...` trigger, it will prevent that other trigger from going off. The reason for this is that mIRC searches each file until it finds a script that will trigger, and then stops seaching that file. `on *:text:*:#chan ...` would trigger on _any_ text in a channel, and therefore always match. Solution for this would be to put this in a separate file, or at least place this in the bottom of the file. Two of these triggers can never be in the same file. – melwil May 03 '13 at 10:47