Modifiable permanent timers

bluebaleen
Posts: 48
Joined: Sun Feb 06, 2011 2:00 pm

Modifiable permanent timers

Post by bluebaleen »

Hi,

I was wondering if Mudlet yet supports a means by which to modify the firing rate of a permanent timer via script. Last I read, GUI Timers could only be enabled or disabled via script but their firing rate could not be modified due to some kind of cross-platform compatibility issue. If this still is not possible via GUI Timers, would anyone have a recommendation for another means of accomplishing this mechanism (i.e. a continuously firing timer with modifiable firing rate)? Thanks!

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Modifiable permanent timers

Post by tsuujin »

You could always just delete and redefine a timer whenever you needed to change it's time. Just check for existence, delete, recreate.

bluebaleen
Posts: 48
Joined: Sun Feb 06, 2011 2:00 pm

Re: Modifiable permanent timers

Post by bluebaleen »

Hm, how would this work in the case of GUI Timers where the timer calls several functions at each firing?

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Modifiable permanent timers

Post by tsuujin »

You'd just have to build the script into the timer creation call, which is most easily done by having it call a function rather than directly execute commands
Code: [show] | [select all] lua
function doSomething()
    -- make a couple of calls
    -- execute your script in general
end

if exists("Timer Name", "timer") == 0 then 
    killTrigger("Timer Name")
end
permTimer("Timer Name","",1.5,doSomething())

bluebaleen
Posts: 48
Joined: Sun Feb 06, 2011 2:00 pm

Re: Modifiable permanent timers

Post by bluebaleen »

Excellent. That did exactly what I needed it to. Thanks for your time!

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Modifiable permanent timers

Post by tsuujin »

No problem.

To bad we don't have a "Thanks!" button like some other forums. I'd be a good way to track who's being generally helpful.

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Modifiable permanent timers

Post by Vadi »

It'd a good idea.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Modifiable permanent timers

Post by tsuujin »

I wonder how hard it'd be to write a mod for it. I know phpBB supports mods, but I also know that the official forums only have a small handful of them so I've always imagined they're either not very powerful or very difficult to write.

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Modifiable permanent timers

Post by Vadi »

Not sure. There might be one available already - I haven't looked, I'm way busy. But if you find something - let me know and I'll try adding it.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Modifiable permanent timers

Post by tsuujin »

I can't find one at all, actually. I'll take a look into what modding it would be like, but it looks like it'll cost me more time than I have at the moment as well.

Post Reply