|
Belmyrddyn Magician
Joined: 17 Oct 2001 Posts: 371 Location: USA
|
Posted: Fri May 03, 2002 1:20 am
Alarm Every Second |
Okay, I want an alarm to execute every second, or at least every second for a certain number of seconds.
Okay, so I get a Roundtime of say 8 seconds... Now I've got 2 variables: @RT and @RTBuffer. When I get the Roundtime line, I have the variables set to
[b]#VAR RT -8
#VAR RTBuffer -8
Now, every second I want to add 1 to each of these variables, until RT = 0, but then I want it to continue adding to RTBuffer until it reaches 2. Now, when I set up an alarm that executes each second with if statements checking to see if they need to add to either alarms, I get a error, which I'm assuming is a memory leak. I assumed that would be a problem with this sort of thing. Any suggestions? Using the tick timer is hard due to the complexity of this execution. Is there a way to cut the alarm off and on when needed?
Btw, this is for the game Dragonrealms, so any other DR players who do this, I'd appreciate you telling me how you resolved this problem.
Belmyrddyn |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri May 03, 2002 1:33 am |
#ALARM *1 {#IF (@RT < 0) {#ADD RT 1};#IF (@RTBuffer < 2) {#ADD RTBuffer 1}}
LightBulb
Vague questions get vague answers |
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Fri May 03, 2002 1:33 am |
Edited:(and Lightbulb beats me by 40 Sec, plus the browser won't let me kill my post. *sigh*)
|
|
|
|
Belmyrddyn Magician
Joined: 17 Oct 2001 Posts: 371 Location: USA
|
Posted: Fri May 03, 2002 9:16 pm |
Your sure that isn't gonna cause a memory leak or something? I'm running the latest beta version, btw.
Belmyrddyn |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat May 04, 2002 1:15 am |
No, I'm not sure. If you want an alarm that's going to fire every second, you need to expect that it's going to consume resources. You might consider moving it to a separate class, where you can disable it when it's not in use.
LightBulb
Vague questions get vague answers |
|
|
|
|
|