Page 1 of 1

disableTimer/enableTimer

Posted: Wed Nov 11, 2009 11:11 am
by Cooldown
Do these actually work for non-temp timers that you make in the GUI? I've tried it several ways and it doesn't seem to be working at all.

Re: disableTimer/enableTimer

Posted: Wed Nov 11, 2009 12:15 pm
by Heiko
Oops, this is bug. I'll fix it.

Re: disableTimer/enableTimer

Posted: Wed Nov 11, 2009 1:11 pm
by Cooldown
This is along the same lines. I use a trigger group with several triggers inside of it and am working on a button to enable/disable it. When I enable it with the button, it is not reflected in the script editor it seems. The script group is enabled, because the scripts inside fire, but the group still shows its disabled.

Edit: It updates but not when I have the script editor open. Even if I close it and reopen it after it has been enabled this way, it doesn't update unless I disable and enable it again.

Edit 2: Is there a way to determine if a group is enabled or disabled? I would like to have just one button turn it on and off, and I would use the "push down" part of the button, but it sends the command as text rather than executing the enable/disable command internally.

Re: disableTimer/enableTimer

Posted: Wed Nov 11, 2009 5:52 pm
by Heiko
1. The enableTimer() and disableTimer() functions have been fixed to work with GUI timers as well. -> latest version on git
2. About 2 state buttons: There is a function that can be used to determine the state of the button. http://mudlet.git.sourceforge.net/git/g ... uttonState
3. The activation status of GUI elements that has been changed via scripting is not being visually updated unless you manually click on the item in question and thus perform a visual update yourself. The reason is that any form of automatic GUI update would negative effects on Mudlet's overall performance.
4. I'll put your request to be able to get the activation state of elements on my todo list.

Re: disableTimer/enableTimer

Posted: Thu Nov 12, 2009 3:34 pm
by Cooldown
I've downloaded the latest git update just now, Nov 9 2009 update, and I'm still having trouble with the enable/disable timer. This is the script I've got it in, and it should work because the only difference is names and the fact that the other script uses triggers rather than timers:

Code: Select all

herbalcheck = getButtonState()
if herbalcheck == 1 then
  enableTimer("herbala")
  enableTimer("herbalb")
elseif herbalcheck == 0 then
  disableTimer("herbala")
  disableTimer("herbalb")
end

Re: disableTimer/enableTimer

Posted: Thu Nov 12, 2009 5:10 pm
by Heiko
Version names are not updated in git versions. To get the latest git you have to get the head: http://mudlet.git.sourceforge.net/git/g ... EAD;sf=tgz

I just did a new git update just in case git was too old for the fix.
Update again and check your timer name spelling. If the name doesnt exit, it cannot be enabled. Also turn on the debug console.
These functions definitely work now.

If it doesn't work for you please attach a screenshot of your timer screen + your button script if you want help.

Re: disableTimer/enableTimer

Posted: Thu Nov 12, 2009 7:07 pm
by Cooldown
Ok, that worked. I guess the one I grabbed from the git wasn't as up to date. Thanks, its working fine now :)