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.

2 TCL Files. 1 Trigger.

Help for those learning Tcl or writing their own scripts.
Post Reply
s
squeege
Voice
Posts: 10
Joined: Fri Jan 13, 2012 11:14 am

2 TCL Files. 1 Trigger.

Post by squeege »

Hi,

I am running eggdrop1.8 as i need ssl :)
Anyway.. this will probably happen on all versions.

I am wondering.. i need to trigger 2 scripts from one !trigger.
But at the moment. Only one will operate at a time and I cannot combine scripts :( Anyway to fix this?

Thanks,

Louis
s
stormshadow
Voice
Posts: 7
Joined: Fri Mar 11, 2011 12:15 am

details

Post by stormshadow »

What do you mean by "trigger two scripts?"
Are you referring to procs?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: 2 TCL Files. 1 Trigger.

Post by speechles »

squeege wrote:Hi,

I am running eggdrop1.8 as i need ssl :)
Anyway.. this will probably happen on all versions.

I am wondering.. i need to trigger 2 scripts from one !trigger.
But at the moment. Only one will operate at a time and I cannot combine scripts :( Anyway to fix this?

Thanks,

Louis

Code: Select all

bind pub - !test wrapProcs

proc wrapProcs {nick uhost hand chan text} {
  proc1 $nick $uhost $hand $chan $text
  proc2 $nick $uhost $hand $chan $text
}

proc proc1 {nick uhost hand chan text} {
  putserv "privmsg $chan :procedure 1 is active!"
}

proc proc2 {nick uhost hand chan text} {
  putserv "privmsg $chan :procedure 2 is active!"
}
You merely write a wrapper that will call both procedures in the order you want. Associate the bind then to this wrapper. The wrapper will ensure both procedures run. There are other ways to do this involving "return codes" that can accomplish it as well. But "wrapping" the two together is the easier way.. Enjoy ;)
Post Reply