egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New to tcl, need help with a simple trigger script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Sat Feb 13, 2010 2:18 am    Post subject: New to tcl, need help with a simple trigger script Reply with quote

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. Sad It has to be close... If someone can help me to understand how to use actions in triggers, it would be greatly appreciated. Smile Thanks in advance.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Feb 13, 2010 6:45 am    Post subject: Reply with quote

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. Smile You can do actions with
Code:
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:
putact $chan "action"

_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Sat Feb 13, 2010 11:25 am    Post subject: Reply with quote

Ah! I was close! Thanks, works great now. Very Happy And I will read through that stuff you mentioned.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Feb 13, 2010 8:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
tsukeh
Voice


Joined: 20 Jan 2005
Posts: 31

PostPosted: Sun Feb 14, 2010 5:35 am    Post subject: Reply with quote

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

should be:

proc pub:hug {nick uhost hand chan text} {
Back to top
View user's profile Send private message
doggo
Halfop


Joined: 05 Jan 2010
Posts: 97

PostPosted: Mon Feb 15, 2010 7:17 pm    Post subject: Reply with quote

Code:
############################################################
#                    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:
 [11:16pm] <indigo6ix> !hug hub
[11:16pm] * various huggles hub
[11:19pm] <indigo6ix> !hug egghelp.forum
[11:19pm] * various huggles egghelp.forum

_________________
NON geeky!! http://gotcode4u.com/
Back to top
View user's profile Send private message Visit poster's website
Luminous
Op


Joined: 12 Feb 2010
Posts: 146

PostPosted: Thu Feb 18, 2010 10:13 pm    Post subject: Reply with quote

I actually ended up expanding mine to something similar doggo. Smile 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. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber