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 problem after rehash

Help for those learning Tcl or writing their own scripts.
Post Reply
B
BoaR
Halfop
Posts: 48
Joined: Fri Jul 20, 2007 1:36 am

Trigger problem after rehash

Post by BoaR »

whenever i change the trigger on the script and rehash, the old trigger is still active and so is the new trigger, how can i fix this so that it wont answer on the old trigger after rehash and will only answer to the new one ?

thanks
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

For it to work with a .rehash, you'd have to include some code to unbind the old bindings. Syntax is quite similar to bind: unbind <type> <flags> <keyword/mask> <proc-name>

One option might be to use .restart instead, as this pretty much wipes the whole tcl environment, including settings, bindings, etc.
NML_375
B
BoaR
Halfop
Posts: 48
Joined: Fri Jul 20, 2007 1:36 am

Post by BoaR »

yeah but i dont want to .restart all the time i do testing.. like adding/removing codes on the script since i dont know tcl i pretty much just test i cant have it right on the first try.

this code:

Code: Select all

bind evnt - prerehash ::MyScript::uninstall
proc ::MyScript::uninstall { args } {
    foreach bind [binds *:*] {
        foreach {a b c d e} $bind break
        unbind $a $b $c $e
    }
}
http://eggdrop.azatom.info/wiki/Tcl:Aut ... ll_scripts

made by bot ping time out..

my binds are
msg:<name>
pub:<name>
dcc:<name>

do i have to change a b c d e for my binds names ?
Post Reply