| View previous topic :: View next topic |
| Author |
Message |
topdawg_b Voice
Joined: 07 Dec 2008 Posts: 32
|
Posted: Sun Dec 14, 2008 6:22 am Post subject: can i load a TCL from a process? |
|
|
| 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? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Dec 14, 2008 1:09 pm Post subject: |
|
|
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: | 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Dec 14, 2008 4:26 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|