Random bot slap

By blodix on Feb 02, 2010

A simple random slapper for your bot or yourselfes. Simply type: !slap in the channel an it will slap the person with one of those slaps.

Hope you like it. :=)

Pretty easy though.

on *:TEXT:!slap *:#: { 
  if ($2 == $me) { .msg $chan No!
  }
  else { 
    /set %slap $rand(1,8) 
    if (%slap == 1) .describe $chan slaps $2 around a bit with a large trout 
    if (%slap == 2) .describe $chan slaps $2 around a bit with a large pig
    if (%slap == 3) .describe $chan slaps $2 around a bit with a large horse
    if (%slap == 4) .describe $chan slaps $2 around a bit with a large cat
    if (%slap == 5) .describe $chan slaps $2 around a bit with a Big Mac 
    if (%slap == 6) .describe $chan slaps $2 around a bit with a large dog
    if (%slap == 7) .describe $chan slaps $2 around a bit with a computer
    if (%slap == 8) .describe $chan slaps $2 around a bit with a stolen car

  }
}

Comments

Sign in to comment.
PuNkTuReD   -  Feb 08, 2010

being 6am here when i first seen $$2 ison 3
i had to sit here and think "O,o whyyy?"
but yea, gooood point, no point in slapping someone who isnt there eh.
lmfso.

 Respond  
Jethro   -  Feb 08, 2010

There are ways you can go about a random slap script. This is one of them:

on *:TEXT:*:#: {
  var %me ,,|,,__(>_<)__,,|,,:No!
  if ($strip($1-2) = !slap $me) .msg # $gettok(%me,$r(1,2),58)
  else {
    var %slap large trout,large pig,large horse,large cat,Big Mac,large dog,computer,stolen car
    $iif($$2 ison #,.describe # slaps $2 around a bit with a $gettok(%slap,$r(1,8),44))
  }
}
 Respond  
PuNkTuReD   -  Feb 08, 2010

geez napa, they call it "doing a napa" for a reason bro,
for a beginner regex is never "ez".
would be nice if some explaination was added to what and how your script works (for noobs or non regex users)

!slap (nick)

on *:TEXT:!slap *:#: { 
  if ($2 == $me) { .msg $chan No!  }
  else { set %slap $rand(1,8) | $slap.action $chan $$2 }
}

; return the string to msg the channel and grab the random object using $gettok
alias slap.action return .description $$1 slaps $$2 around a bit with a $gettok($slap.objects,%slap,58)
; the random objects using ";" $chr(58) as the seperator
alias slap.objects return large trout:large pig:large horse:large cat:big mac: large dog:computer:stloen car

also its late here but i cant see why (unless its bracket placement)
the msg $chan NO! doesnt work.

NOTE: i didnt test it myself

 Respond  
napa182   -  Feb 06, 2010

here then

 on $*:TEXT:/^!slap\s(\S+)$/iS:#: { 
  if ($regml(1) ison # && !$hget(slap,flood)) {
    .hadd -mu3 slap flood yes
    if ($regml(1) == $me) { msg # ,,|,,__(>_<)__,,|,, }
    else { 
      var %slap large trout|large pig|large horse|large cat|Big Mac|large dog|computer|stolen car
      describe # slaps $regml(1) around a bit with a $gettok(%slap,$r(1,8),124)
    }
  }
}

<~napa182> !slap Sick0
<&Sick0> ,,|,,_(><)__,,|,,

is that better?

 Respond  
`Dean   -  Feb 06, 2010

Haha, okay. :P

 Respond  
Jethro   -  Feb 06, 2010

Well, you could make the bot whine, cry or scream etc...if you wanted it to.

 Respond  
`Dean   -  Feb 06, 2010

When you try and slap the bot, it doesn't comment. :p

Nice job on the script though. Thanks.

 Respond  
napa182   -  Feb 02, 2010

you could do something ez like this.. plus it would be a good idea to add a bit of flood control to ur snippet.

 on $*:TEXT:/^!slap\s(\S+)$/iS:#: { 
  if ($regml(1) ison # && !$hget(slap,flood)) {
    .hadd -mu3 slap flood yes
    if ($regml(1) == $me) { msg # No! }
    else { 
      var %slap large trout|large pig|large horse|large cat|Big Mac|large dog|computer|stolen car
      describe # slaps $regml(1) around a bit with a $gettok(%slap,$r(1,8),124)
    }
  }
}

or take out that msg # No!

on $*:TEXT:/^!slap\s(\S+)$/iS:#: { 
  if ($regml(1) ison # && !$hget(slap,flood) && $regml(1) != $me) {
    .hadd -mu3 slap flood yes
    var %slap large trout|large pig|large horse|large cat|Big Mac|large dog|computer|stolen car
    describe # slaps $regml(1) around a bit with a $gettok(%slap,$r(1,8),124)
  }
}
 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.