disableTimer/enableTimer

Post Reply
Cooldown
Posts: 11
Joined: Sun Oct 11, 2009 10:26 am

disableTimer/enableTimer

Post 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.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: disableTimer/enableTimer

Post by Heiko »

Oops, this is bug. I'll fix it.

Cooldown
Posts: 11
Joined: Sun Oct 11, 2009 10:26 am

Re: disableTimer/enableTimer

Post 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.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: disableTimer/enableTimer

Post 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.

Cooldown
Posts: 11
Joined: Sun Oct 11, 2009 10:26 am

Re: disableTimer/enableTimer

Post 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

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: disableTimer/enableTimer

Post 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.

Cooldown
Posts: 11
Joined: Sun Oct 11, 2009 10:26 am

Re: disableTimer/enableTimer

Post 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 :)

Post Reply