Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Muorshai
Newbie


Joined: 20 Jan 2002
Posts: 3

PostPosted: Wed Apr 30, 2003 6:41 am   

Alarm ID interfering with execution
 
Ok, here's a strange one, I have the following expression trigger set up....

((@Health_Mana_Queue <> %null) AND (@Health_Mana_Balance = 1))

This code works perfectly


Health_Mana_Balance = 0
Health_Mana_Queue = %sort( @Health_Mana_Queue)
drink %delete( %item( @Health_Mana_Queue, 1), 1, 4)
Health_Mana_Queue = %delitem( %item( @Health_Mana_Queue, 1), @Health_Mana_Queue)
#ALARM {+5} {Health_Mana_Balance = 1}

note there is a "plus" before the 5 in the Alarm.

If you make Health_Mana_Queue = "500_Health|500_Health|500|Health" it gives you....

drink health
drink health
drink health

in 5 second intervals

when you change the last line to

#ALARM "HealthManaTimer" {+5} {Health_Mana_Balance = 1}

it then only executes twice, leaving Health_Mana_Balance as 0

Can anyone tell me what the difference is?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 30, 2003 4:36 pm   
 
The difference (obviously) is that you assigned an ID to it.

When you assign the ID, your new alarm has the same ID as the one that's being deleted and will overwrite it. Apparently, zMUD is fast enough to create the new alarm (overwriting the old one) before the self-deletion process is finished, so when zMUD deletes "HealthManaTimer" it's your brand-new alarm that goes away.

LightBulb
Advanced Member
Reply with quote
Muorshai
Newbie


Joined: 20 Jan 2002
Posts: 3

PostPosted: Thu May 01, 2003 12:49 am   
 
Nope, tried a few variations for delays to create the new trigger up to a second or so, no luck.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu May 01, 2003 4:21 am   
 
Open up the debugger window and step through it?

Help Debugging Scripts
Help Watch

Maybe you can catch the issue.

Ton Diening
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 01, 2003 5:19 pm   
 
I didn't give you a solution. I gave you an explanation. The solution is to use your original script, without the ID.

LightBulb
Advanced Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net