mIRC Home    About    Download    Register    News    Help

Print Thread
#252223 28/03/15 02:02 PM
Joined: Mar 2015
Posts: 19
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Mar 2015
Posts: 19
I have a script for Caps spam(HELLO) and repeating character spam(hiiiiii, heeeeeelllo) I need a way to detect repeated word spam (WOLF WOLF WOLF WOLF WOLF) Here is my code..

Code:
alias sticky {
  var %re = /(.)\1{4,}/
  return $iif($regex($1-,%re), $regml(1), $null)
}

on *:Text:*:#:{
  if ($nick !isop #) { return }
  ; Looping through the words in the line to find sticky letters...
  var %x = 1
  while ($gettok($1-, %x, 32) != $null) {
    var %word = $v1

    ; Checking if there's sticky letters in the word..
    if ($sticky(%word) != $null) {
      if !$istok(%spam.warned,$nick,32) {

        ; warning user      
        msg $chan $nick -> stop spamming! [warning] 

        ; add user to %spam.warned, so we can check it later
        set -e %spam.warned $addtok(%spam.warned,$nick,32)

        ; set timer to remove user from %spam.warned after 300s
        .timer 1 300 remove.warned $nick
      }
      else {
        msg $chan $nick -> you had been warned! [Timedout for 120 sec.] 
        msg $chan .timeout $nick 120
      }

    }
    inc %x
    
     if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 70 ) { 

      ; check if user is not warned yet
      if !$istok(%caps.warned,$nick,32) {

        ; warning user      
        msg $chan $nick -> stop typing in caps! [warning] 

        ; add user to %caps.warned, so we can check it later
        set -e %caps.warned $addtok(%caps.warned,$nick,32)

        ; set timer to remove user from %caps.warned after 300s
        .timer 1 300 remove.warned $nick
      }
      else {
        msg $chan $nick -> you had been warned! [Timedout for 120 sec.] 
        msg $chan .timeout $nick 120
      }
    }
}


Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Mar 2015
Posts: 19
B
Pikka bird
OP Offline
Pikka bird
B
Joined: Mar 2015
Posts: 19


Thank you, I replied on that post with a question


Link Copied to Clipboard