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.

New to tcl, need help with a simple trigger script

Help for those learning Tcl or writing their own scripts.
Post Reply
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

New to tcl, need help with a simple trigger script

Post by Luminous »

Hi everyone.

Just started using eggdrop a few days ago, and I am starting to get the hang of how the bot works. I am a novice at tcl coming into it, but I am trying to write some scripts to learn. Trying out very basic ones first... like trying to use public triggers to make my bot say things. But I cannot figure out to use actions like, for example "/me hugs $nick" when someone uses !hug. The way I would write that script is:

bind pub - !hug pub:hug
proc pub:hug {nick uhost chan hand text} {
puthelp "ACTION :hugs $nick"

Which doesn't work I've tried it several different ways... without the :, etc, but no go. :( It has to be close... If someone can help me to understand how to use actions in triggers, it would be greatly appreciated. :) Thanks in advance.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

You should read the "TCL FAQ" part of the forum, it has alot of things that cover this. And I'd strongly recommend you read upon IRC Raws at least.

But good work. :) You can do actions with

Code: Select all

puthelp "PRIVMSG $chan :\001ACTION $text\001"
There is a putact command provided by the alltools.tcl if you have it loaded, so you can use

Code: Select all

putact $chan "action"
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Ah! I was close! Thanks, works great now. :D And I will read through that stuff you mentioned.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

http://suninet.the-demon.de/a2.htm covers it.

and there is a lot of other VERY good info there - easy to read, easy to follow.
t
tsukeh
Voice
Posts: 31
Joined: Thu Jan 20, 2005 6:22 am

Post by tsukeh »

proc pub:hug {nick uhost chan hand text} {

should be:

proc pub:hug {nick uhost hand chan text} {
d
doggo
Halfop
Posts: 97
Joined: Tue Jan 05, 2010 7:53 am
Contact:

Post by doggo »

Code: Select all

############################################################
#                    simple cmd tcl - doggo                #
############################################################

set userflag "-"

set huggle "!hug"

bind PUB $userflag $huggle hugcom

proc hugcom {nick uhost hand chan text} {
   global botnick
   puthelp "PRIVMSG $chan :\001ACTION huggles $text\001"
}


############################################################
putlog "hug script by doggo"

Code: Select all

 [11:16pm] <indigo6ix> !hug hub
[11:16pm] * various huggles hub
[11:19pm] <indigo6ix> !hug egghelp.forum
[11:19pm] * various huggles egghelp.forum
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

I actually ended up expanding mine to something similar doggo. :) i made it so that I can !hug to make my bot hug that person, or !hug <nick> to hug someone else. I'm slowly learning. :D
Post Reply