slap counter

By Phil_FW on Aug 10, 2010

Just a simple slap counter with a twist XD. when someone slaps you it makes you take out gun and it counts each time u do that. please feel free to suggest things if it can be neater/better. and Enjoy!

on *:action:$($+(*,slaps,*,$me,*)):#:{
  if ($2 == $me) { 
   inc %slaps
   describe $chan pulls out an 12AK47...
  .timer 1 2 msg $chan 9Bitch do 4NOT 9fucking slap me!
  .timer 1 4 describe $chan points the AK at 6 $nick
  .timer 1 6 msg $chan 7Got it?!
  .timer 1 8 msg $chan 9I pulled out this AK15 %slaps 9times now.
  .timer 1 10 msg $chan 7,1CREDITS TO 15,1PHIL
}

Comments

Sign in to comment.
SnoooP   -  Aug 13, 2010

Sunny you don't even need one "if ($2 == $me) {" because the on action event takes care of that.

on *:action:$($+(*,slaps,*,$me,*)):#:{

notice the $me in it :x

 Respond  
Sorasyn   -  Aug 10, 2010

@Jethro_ not everyone is a pro at regex like you are lol

As for the 50 "if ($2 == $me)" one will suffice and enclose them in brackets

on *:action:$($+(*,slaps,*,$me,*)):#:{
  if ($2 == $me) {
    inc %slaps
    describe $chan pulls out an 12AK47...
   .timer 1 2 msg $chan 9Bitch do 4NOT 9fucking slap me!
   .timer 1 4 describe $chan points the AK at 6 $nick
   .timer 1 6 msg $chan 7Got it?!
   .timer 1 9 msg $chan 9I pulled out this AK15 %slaps 9times now.
  }
}
 Respond  
Phil_FW   -  Aug 10, 2010

like i said.. im an amateur lol. but hey, im learnin :P

 Respond  
Jethro   -  Aug 10, 2010

Why the if $2 == $me? You already have that taken care of in the match text section of the event. That if statement becomes pointless. If you must use an if condition, then:

on *:action:*:*:{
   if ($strip($1-2) == slap $me) {
    msg $iif(#,#,$nick) blah blah

But I prefer regex

on $*:action:$(/\bslaps?\s(\Q $+ $me $+ \E)\b/iS):#:{

Reason being, if you use wilcard, like $2 isin $me or $me , it'll often result in false positives. Using $istok or $1-2 == $me also has a downfall that won't trigger if someone adds a punctuation mark in front or at the end of your main nick.

 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.