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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
raviden
Novice


Joined: 02 Nov 2010
Posts: 45

PostPosted: Fri Aug 01, 2014 11:40 am   

Problem with alarms
 
Hey,

I've created a function, that returns random value between $min and $max:

<func name="random_alarm" id="781">
<value>$temp = %random($min, $max)
$temp = %replace(%float(%float($temp)/%float(1000)), ",", ".")

#return $temp</value>
<arglist>$min, $max</arglist>
</func>

Now, I'd like to use that function for creating alarms of random duration, f.e.:

#alarm {+@random_alarm(10000, 12132} {
do_something
}

Right now it seems to be not working, and I have no idea why. It used to be working some time ago though.

The alarm is beeing created:

<trigger name="_Alarm303" type="Alarm" priority="73800" id="7380">
<pattern>+@random_alarm(10000, 12132)</pattern>
<value>do_something</value>
</trigger>

However it simply disappears without beeing fired after the duration.

Some time ago, I've had similar problem with those alarms while trying to name them with an ID.
That time as far I remember, the timer passed the scheduled time of firing and the alarm did not fire or dissapear.

Can someone help with that?
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Wed Aug 06, 2014 5:43 am   
 
I created the trigger as you have it and it works for me. You must remember that the format #ALARM {+@var} {@cmds} will cause the trigger to delete itself when it fires after @var seconds elapse. Read the documentation for #ALARM more carefully, perhaps you missed something.
_________________
Sic itur ad astra.
Reply with quote
raviden
Novice


Joined: 02 Nov 2010
Posts: 45

PostPosted: Wed Aug 06, 2014 10:22 pm   
 
It suddenly, magicly started working btw ;) No changes made by myself.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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