puppet bot

By PATX on May 04, 2009

well i would not have posted this, but i did not see one of them on here so... here it goes....

i made this a while back and thought it would be one of those stupid scripts that nobody liked right? well it turned out that everybody liked it! ppl who had my bot in my channel liked to be able to make the bot do/say whatever they wanted for some reason... so i figure i post it here if you guys want to make ppl happy w/ ur fail bot! :) commands are:

~say
~do

oh and if you dont want ppl to see who triggers the bot you can pm him....

/msg ~say
/msg ~do

; puppet script by patx (patx@patxbot.tk) (http://www.patx.tk)
; the code it licensed under the patx license version 3!!!!!!!
; http://www.iolanguage.com/paste/p/07f3dc4a0.html << license.

alias -l antiflood { if (!$($+(%,antiflood,.,$1),2)) { set -u5 $+(%,antiflood,.,$1),2)) on } | else { halt } }

on *:text:~do*:?: { $antiflood($1)
describe $2 $3- }
on *:text:~say*:?: { $antiflood($1)
msg $2 $+(% ,$3-) }
on *:text:~do*:#: { $antiflood($1)
describe $chan $2- }
on *:text:~say*:#: { $antiflood($1)
msg $chan $+(''',$2-,''') }

Comments

Sign in to comment.
Ghost-writer   -  Aug 31, 2009

~do $ip :]

 Respond  
Trev   -  Jul 07, 2009

Meh, it's all in one text event :p

 Respond  
PATX   -  Jul 07, 2009

does not seem shorter :/ :P

 Respond  
Trev   -  Jul 07, 2009

You could use regex in the trigger to make it shorter:

On $*:TEXT:/^[~]*/Si:*: { 
  if ($mid($1,1) == ~do) {
    $antiflood($1) 
    $iif($query($nick),describe $2 $3-,describe # $2-)
  }
  Elseif ($mid($1,1) == ~say) {
    $antiflood($1)
    $iif($query($nick),msg $2 $+(% ,$3-),msg # $+(''',$2-,'''))
  }
}
 Respond  
PATX   -  May 06, 2009

well it works....

 Respond  
napa182   -  May 05, 2009

i used that as an example nothing more.

 Respond  
PATX   -  May 05, 2009

ok. and i did....

$+(''',$2-,''') there a three ' in front and back. i did not do it for the dos cos you cannot trigger server commands with /me anywhere in it.

 Respond  
napa182   -  May 05, 2009

yeah but i would still put somthing in front of the $2- so someone cant trigger a server command or w/e
ex:

on *:text:~do *:#: { $antiflood($1) | describe # $+($chr(160),$2-) }
 Respond  
PATX   -  May 05, 2009

so just replace $antiflood($1) instaed of $antiflood?

 Respond  
napa182   -  May 05, 2009

when useing that antiflood alias i made you need to use $antiflood($1) the $1 = the trigger you use so you can use it in other on text triggers as well.

 Respond  
PATX   -  May 05, 2009

k updated...

  • changed the flood pro
  • took out the user level info in da into seeing how it does not apply
  • made it so there is a ''' in front of the stuff

tell me about any errors please?

 Respond  
Aucun50   -  May 04, 2009

I would go with the anti flood napa put here as it's easy to use and works great, are make a anti flood that doesn't turn off the script for everyone only the person who used it.

You could put this into one on text and have some checks. Also if you say something in your intro you should have that in your script, "/auser 5 " yet i don't see any functions in your script to support that.

 Respond  
napa182   -  May 04, 2009

PATX Said:

and and by the way you need to have user level 5 to prevent spam.... to set this use

/auser 5

You say that, but you didn't apply it to ur code. You should really have it place somthing in the front of the $2- like for ex:

on 5:text:~say *:#: { $antiflood | msg # $+(::,$2-,::) }

or

on 5:text:~say *:#: { $antiflood | msg # $+($chr(160),$2-) }

that way someone can't do ~say !op blah or w/e

 Respond  
PATX   -  May 04, 2009

ty Kirbeh_Pr0nz.

 Respond  
Kirbeh_Pr0nz   -  May 04, 2009

i made my version to where only certain pplz can use it, also mine works through query only. http://www.hawkee.com/snippet/5799/
nice patx

 Respond  
PATX   -  May 04, 2009

ok. the reason tho is i way too lazy to make one....

 Respond  
napa182   -  May 04, 2009

why use that antiflood from that bot Weasel posted?

you can do that like this as well

alias -l antiflood { if (!$($+(%,antiflood,.,$1),2)) { set -u5 $+(%,antiflood,.,$1),2)) on } | else { halt } }

then in ur code put $antiflood($1)

but only use the -l switch if you are going to use this alias along with the code in the same remote if not then remove the -l switch.

 Respond  
PATX   -  May 04, 2009

or i could use user levels....

edit: egh just added a anit flood. thata way all ppl can use it... tell me what ya think?

 Respond  
napa182   -  May 04, 2009

you should really think about adding a few checks to this as well as making sure not everyone can use this if the bot has +o in the chan cuz they can end up screwing up ur channel.

 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.