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.

Trigger help

Help for those learning Tcl or writing their own scripts.
Post Reply
f
fluokabouter
Voice
Posts: 2
Joined: Mon Jan 29, 2007 5:39 am

Trigger help

Post by fluokabouter »

Hello,

I don't know how to search for this on the forum It's complicated to explain ;)

I would like to bind a new trigger for example !define
to forward this to !google define:

I know, it's incith's script. But he checks if define is set in his code,
its not just another proc to call..

bind - !define <other trigger> won't work I guess?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Not quite... What you could do I guess, is write a tiny proc that "fakes" a triggered binding.
I guess it would be something like this:

Code: Select all

bind pub -|- !define [list mydefine ::incith::google::public_message]
bind msg -|- !define [list mydefine ::incith::google::private_message
proc mydefine {type args} {
 set cmd [split [lindex $args end]]
 set cmd [join [lreplace $cmd 0 0 "!google define"]]
 eval "$type [lreplace $args end end $cmd]"
}
I hav'nt verified the code however, so I can't promise that it will work flawlessly (or at all).
NML_375
f
fluokabouter
Voice
Posts: 2
Joined: Mon Jan 29, 2007 5:39 am

Post by fluokabouter »

Thank you,
but it doesn't work properly ;)

Trying to fix it
Post Reply