| View previous topic :: View next topic |
| Author |
Message |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sat Feb 13, 2010 2:18 am Post subject: New to tcl, need help with a simple trigger script |
|
|
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. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Sat Feb 13, 2010 6:45 am Post subject: |
|
|
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: | | 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 |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Sat Feb 13, 2010 11:25 am Post subject: |
|
|
Ah! I was close! Thanks, works great now. And I will read through that stuff you mentioned. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Feb 13, 2010 8:46 pm Post subject: |
|
|
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 |
|
 |
tsukeh Voice
Joined: 20 Jan 2005 Posts: 31
|
Posted: Sun Feb 14, 2010 5:35 am Post subject: |
|
|
proc pub:hug {nick uhost chan hand text} {
should be:
proc pub:hug {nick uhost hand chan text} { |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Mon Feb 15, 2010 7:17 pm Post subject: |
|
|
| 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 |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Thu Feb 18, 2010 10:13 pm Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
|