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.

can i load a TCL from a process?

Help for those learning Tcl or writing their own scripts.
Post Reply
t
topdawg_b
Voice
Posts: 32
Joined: Sun Dec 07, 2008 7:13 pm

can i load a TCL from a process?

Post by topdawg_b »

i have a whole set of triggers that i want to turn off and on from time to time. is there a way to load and unload a tcl from the party line or from a process?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

There are some rudimentary attempts to build script-APIs to allow dynamic loading and unloading, although I cannot comment on the usability of these scripts.

Depending on the number of triggers/commands, I'd suggest simply using globalspace variables to specify the operation of the different triggers/commands.

Ie, something like this:

Code: Select all

set EnableMytrigger 1
...
bind dcc - "enabletrigger" DccEnableMytrigger
proc DccEnableMytrigger {hand idx text} {
 set ::EnableMytrigger 1
}
bind dcc - "disabletrigger" DccDisableMytrigger
proc DccDisableMytrigger {hand idx text} {
 set ::EnableMytrigger 0
}

bind pub - "trigger" PubMytrigger
proc PubMyTrigger {nick host hand chan text} {
 if {![info exists ::EnableMytrigger] || $::EnableMytrigger != 1} {
  return 0
 }
#rest of script here
}
NML_375
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

I use a pre-rehash script, which unbinds all non-default binds upon rehash. So if you remove your script from the config file, it wont be reloaded.
r0t3n @ #r0t3n @ Quakenet
Post Reply