This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Slap Attacks

Help for those learning Tcl or writing their own scripts.
Post Reply
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Slap Attacks

Post by romeo5k »

Code: Select all

bind pub - !slap slap:target

	proc slap:target {nick uhost hand chan arg} {
 		set target "[lindex [split $arg] 0]"
			putserv "PRIVMSG $chan :\001ACTION slaps $target around a bit with a larger trout\001"
 	 "PRIVMSG $chan :\001ACTION slaps $target around a bit with the remains of a big Smelly Trout!\001"
}
I must be writing this wrong.. i took the one u posted on here... and im just trying to add more comments to em so i have a variet, but its not reading. Im sure its on my end, but i cant gfigure how and why... Somone pls help!

ref: http://forum.egghelp.org/viewtopic.php?t=5784
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

It would seem you're missing a puthelp/putserv command on the second ctcp-action message. Also, it would be advisable to use puthelp rather than putserv in this case (both will work, however).
NML_375
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

ok.. i did that, and it seems to work okay so far, but i just had a noob come into the channel, and he just did something i can see me having a prob with He does !slap BOTNICK
and bot continuosly slaps himself.
If im not mistaken, is there a way to use the IF, Else commands to tell it is someone says !slap BOTNICK, ignore it, or if they do that, slap that individual for being stoopid.. Something like that!
Thanks
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

You probably would like to test $target using the isbotnick function (documented in doc/tcl-commands.doc)
Use with if/elseif/else-constructs to determine what your bot should do.
NML_375
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

got a new problem,

Code: Select all

bind pub - !slap slap:target

   proc slap:target {nick uhost hand chan arg} {
       set target "[lindex [split $arg] 0]"
         putserv "PRIVMSG $chan :\001ACTION slaps $target around a bit with a larger trout\001"
     puthelp "PRIVMSG $chan :\001ACTION slaps $target around a bit with the remains of a big Smelly Trout!\001"
}
when i say, !slap boodah <--(NICK)
it displays both slaps one after another. So if i was to add 10 more variety slaps, it would display all 10 back to back. Where is my error now. ?? dang, im feeeling real dumb now.!

edit** Would it be better for me to just ask someone to just crate me a script rather than trying to edit and add to someone elses, beeing that im not a pro at it yet. Cause i dont wanna fustrate anyone with my ignorance.
If anyone does wanna just create one from scratch , please feel free, i posted the things i would like on it is possible.
Just a slapp script so i can add other slaps and an if command incase a dummy wants to play with bot and have the bot slap him self, bot slaps him/her. thanks
Post Reply