Alright, i was bored with my bot, so I made this. It just makes it to where, when you make an action involving petting the person with the script loaded, they'll purr. :) fun to freak out people. Enjoy :)
on *:action:*:#: {
if (( pets isin $1- ) && ( $me isin $1- )) {
.timer 1 1 /describe $chan purrrrrr.... purrrrrr....
}
else {
halt
}
}
if you want it per person for the flood control you can use..
if (!$($+(%,purrflood,.,$nick),2)) { set -u3 $+(%,purrflood,.,$nick) $nick
so now the code would look like..
on *:action:$($+(*,pets,*,$me,*)):#: { if (!$($+(%,purrflood,.,$nick),2)) { set -u3 $+(%,purrflood,.,$nick) $nick | .timer.purr 1 1 describe # purrrrrr.... purrrrrr.... } }
also i would add a few responses..
on *:action:$($+(*,pets,*,$me,*)):#:{ if (!$($+(%,purrflood,.,$nick),2)) { set -u3 $+(%,purrflood,.,$nick) $nick | .timer.purr 1 1 describe # $gettok(purrrrrr.... purrrrrrssss....|moans|ask's for a happy ending,$r(1,3),124) } }
also you should really name ur timers.
If you're saying you don't understand what slacker did, Aucun,
on *:action:$($+(*,pets,*,$me,*)):#: { if (!%purrflood) { set -u3 %purrflood on | .timer.purr 1 1 describe # purrrrrr.... purrrrrr.... } }
There is a $ infront of the $+(,pets,,$me,) because you cannot directly use identifiers like $+'s as a match.
is just a wildcard, so there can be anything between "pets" and "$me".
So the script can be activated, assuming let's say the bot nick is CatBot, by saying something like:
/me pets the bot CatBot by touching her fur.
As slacker has said,
on *:action:$($+(*,pets,*,$me,*)):#: { if (!%purrflood) { set -u3 %purrflood on | .timer.purr 1 1 describe # purrrrrr.... purrrrrr.... } }
, can be used, however it disables the script all together for three seconds.
To make antispam per person, you can also do
on *:action:$($+(*,pets,*,$me,*)):#: { if ($wildsite !isin %purrflood) { set -u3 %purrflood $addtok(%purrflood,$wildsite,32) | .timerpurr 1 1 .describe # purrrrrr.... purrrrrr... } }
using tokens, or the traditional method:
on *:action:$($+(*,pets,*,$me,*)):#: { if (!%purrflood. [ $+ [ $nick ] ]) { set -u3 %purrflood. [ $+ [ $nick ] ] | .timerpurr 1 1 .describe # purrrrrr.... purrrrrr... } }
Aucun50 why would you use a $iif for that. an $iif is not needed.
and you should really think about some sort of flood control, and for just pets and the bot's nick within $1- just do
on *:action:$($+(*,pets,*,$me,*)):#:{
so with no flood control
on *:action:$($+(*,pets,*,$me,*)):#: { .timer.purr 1 1 describe # purrrrrr.... purrrrrr.... }
with flood control witch you should use...
on *:action:$($+(*,pets,*,$me,*)):#: { if (!%purrflood) { set -u3 %purrflood on | .timer.purr 1 1 describe # purrrrrr.... purrrrrr.... } }