napa182 commented on a Page, Anti-Slapper script  -  Jul 13, 2008

look in to while loops and tokens you can use them to make this script into somthing like this

on *:action:*:#:{
  var %sl = slaps,hits,whacks,wacks,attacks,kicks,throws, %x = $numtok(%sl,44) 
  while (%x) { 
    if ($istok($1-,$gettok(%sl,%x,44),32) && $me isin $1- && !%spam) {
      var %ap blocks $nick $+ 's attack and beats six shades of shoot out of their pets|drops dead on the ground|ducks and takes aim with an M16|beats $nick like a red-headed step child|gets up off the ground and roundhouse kicks $nick in the face|does an evasive backflip and throws ninja stars at $nick ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ $nick ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤|throws rocks at $nick
      describe # $gettok(%ap,$r(1,7),124)
      set -u15 %spam on
    }
    dec %x
  }
}

or you can do

on *:action:*:#:{
  if ($regex($1-,/(slaps|hits|whacks|wack|attacks|kicks|throws)/i) && $me isin $1- && !$($+(%,spam,.,$nick),2)) { 
    var %ap blocks $nick $+ 's attack and beats six shades of shoot out of their pets|drops dead on the ground|ducks and takes aim with an M16|beats $nick like a red-headed step child|gets up off the ground and roundhouse kicks $nick in the face|does an evasive backflip and throws ninja stars at $nick ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ $nick ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤|throws rocks at $nick
    describe # $gettok(%ap,$r(1,7),124)
    set -u3 $+(%,spam,.,$nick) on
  }
}
 Respond  
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.