Slap Script

By TheDreamLord on Jan 07, 2011

When someone slaps you i.e TheDreamLord slaps DreamBot around a bit with a large trout it shall say the following...
thats how it is eh?
YOURBOT chases $nick with a gun!
YOURBOT fires!
Damn i missed!/ WOO I HIT!

P.S Change YOURBOT to the name of your bot :P

on *:ACTION:*slaps $me around a bit with a large trout:#: {
  msg $chan thats how it is eh?
  describe $chan chases $nick with a gun!
  describe $chan fires!
  msg $chan $iif($r(1,2) == 1, damn i missed..., I hit! WOO!)
}

Comments

Sign in to comment.
Phil_FW   -  Jan 12, 2011

ahh i get it now :D

 Respond  
Jethro   -  Jan 12, 2011

on :text:hello*:#:{
if (!%flood [ $+ [ $site ] ]) {
; if the dynamic %flood doesn't exist, we set it to 3 seconds before it's unset after 3 seconds have expired.
set -u3 %flood $+ $site $true
; we set it to 3 seconds. The code will ignore any trigger "hello" until 3 seconds have passed. This in turn will diminish the likelihood of trigger flood.
msg # Hello $nick
}
}

 Respond  
Phil_FW   -  Jan 12, 2011

how does it work? like can you explain the anatomy of that piece of code? so i know like, where i can set the amount of times b4 its %flood

 Respond  
Jethro   -  Jan 12, 2011

The %flood var gets unset in 3 seconds.

 Respond  
Phil_FW   -  Jan 12, 2011

what does the u3 do? the limit of times??

 Respond  
Jethro   -  Jan 12, 2011

Bielie, using $site is better than $nick. Also, you do not need the evaluation bracket when you set the %flood:

if (!%flood [ $+ [ $site ] ]) {
    set -u3 %flood $+ $site $true 
    ;the body of code goes here
  }
 Respond  
Bielie   -  Jan 12, 2011

just add .ignore -u3 $nick to the end of each script phil24\

Or for a trustebler way

if (%flood [ $+ [ $nick ] ]) { halt }
set -u3 %flood [ $+ [ $nick ] ] $true

 Respond  
Phil_FW   -  Jan 09, 2011

examples help me but i like things being explained as well, like the functions of the code pieces.

 Respond  
Jethro   -  Jan 08, 2011

if you had seen many of napa's examples or mine, you'd already be graduated from learning how to implement a basic trigger flood check...:P

 Respond  
Phil_FW   -  Jan 08, 2011

i like napa's idea... i need to learn how to add flood control to my scripts lol

 Respond  
napa182   -  Jan 08, 2011

maybe name the timers as well as adding some kind of flood control.

 Respond  
Phil_FW   -  Jan 08, 2011

dont include the trout part.. just do

on *:action:$($+(*,slaps,*,$me,*)):#:{ 
msg $chan thats how it is eh?
  .timer 1 2 describe $chan chases $nick with a gun!
  .timer 1 3 describe $chan fires!
  .timer 1 4 msg $chan $iif($r(1,2) == 1, damn i missed..., I hit! WOO!)
}

that way if they do something like /me slaps ... then it will still work

 Respond  
Jethro   -  Jan 08, 2011

I've always included a trigger flood control for a snippet like this, 'cause you'll never know when someone messes with you by flooding before you can react to it.

 Respond  
Known   -  Jan 08, 2011

You should include some timers to make it happen in a given set of time, instead of all happening at once, and creating spam (which in some channels can get you kicked).

on *:ACTION:*slaps $me around a bit with a large trout:#: {
  msg $chan thats how it is eh?
  .timer 1 2 describe $chan chases $nick with a gun!
  .timer 1 3 describe $chan fires!
  .timer 1 4 msg $chan $iif($r(1,2) == 1, damn i missed..., I hit! WOO!)
}
 Respond  
GuitarMasterx7   -  Jan 07, 2011

instead of ppl having to change the YOURBOT
text, replace it wif $me

on *:ACTION:*slaps $me around a bit with a large trout:#: {
 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.