Repeat Kick: Version 1

By sukhbira on Feb 26, 2013

The Repeat Kicker can be done in several ways. The general idea is to somehow store what a person last said and then the next time they speak see if what they said was what they said last time. I like to use variables to record this information however some people may not like to do that because it could take up a lot of space. Anyway, here is some code: and last one is with changing of modes

ON @*:TEXT:*:#:{
  IF ($nick isop # ) { RETURN }
  VAR %text = $hash($strip($1-),32) 
  IF ($len($strip($1-)) >= 10 ) {
    ;this 10 will ignore words like laught out loud brb etc.
    VAR %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  VAR %old.text = $deltok(%old.text,1,46) }
  IF ((%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text)) {
    ; If the person didn't repeat or the person spoke for the 
    ; first time then we need to create this variable:
    SET -u790 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text 
    ; Note how its set to unset in 10 seconds - so the person has to repeat within 10seconds
    ; The variables format is: %rp.#channel.nickname N.%text
    ; N being the number of times the %text was said
    RETURN
  }
  VAR %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  VAR %count = $gettok(%temp,1,46)
  INC %count
  SET -u90 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text
  IF (%count >= 2) {
    echo -at 5 $nick 4 is repeating upper line in the Channel 3 %count Times in 2 mins.  
    IF (%count >= 7) {
      echO -at notice  9,1 $nick : Repeating 3 %count times! $1- 
      mode # +b $address($nick,4) | kick # $nick 4No Repeating/Flooding.4Banned..
    }
  }
}
ON @*:text:*:#:{
  IF ($nick isop # ) { RETURN }
  VAR %text = $hash($strip($1-),32) 
  IF ($len($strip($1-)) >= 9 ) {
    ;this 10 will ignore words like laught out loud brb etc.
    VAR %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  VAR %old.text = $deltok(%old.text,1,46) }
  IF ((%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text)) {
    ; If the person didn't repeat or the person spoke for the 
    ; first time then we need to create this variable:
    SET -u940 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text 
    ; Note how its set to unset in 10 seconds - so the person has to repeat within 10seconds
    ; The variables format is: %rp.#channel.nickname N.%text
    ; N being the number of times the %text was said
    RETURN
  }
  VAR %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  VAR %count = $gettok(%temp,1,46)
  INC %count
  SET -u90 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text
  IF (%count >= 3) {
    echo -at 5 $nick 4 is repeating upper line in the Channel # 3 %count Times in 2 mins. 
    IF (%count >= 3) {
      echO -at notice  9,1 $nick : Repeating 3 %count times in $chan ! 
      IF (%count >= 4) {
        .mode # +f *5:2
        IF (%count >= 5) {   
          .timer 1 2 mode $active +b $address($_ip:nick,2) | .timer 1 2 kick # $nick 4No Repeating/Flooding.4Banned
        }
      }
    }
  }
}

Comments

Sign in to comment.
LunaMorgan   -  Sep 20, 2014

OK stupid question, but if I want to change the timer to keep the message for u300, how do I do it?

 Respond  
napa182   -  Mar 03, 2013

you would be better off using hash instead of vars, but to each their own.

Conscious  -  Mar 03, 2013

Yes, then there's no leftover vars from the set -u60 if mIRC crashes - hashes just clear.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.