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
gxyzod
Beginner


Joined: 10 May 2012
Posts: 12

PostPosted: Fri Nov 16, 2012 8:12 pm   

Timer
 
Dear all,

I'm as usual contacting you for help!
I'm trying to figure out how to create a timer that keeps track of how many minutes/hours have passed, in game, after a specific message (spell) has been cast.
This spell lasts for 40 hours real time, and as such goes on over different gaming sessions. I'd need something that when the spell is cast starts keeping track and shows me the time that has passed. Even if I disconnect from the game and reconnect.
Not playing other games with CMUD it could be a generally thing.

Thanks for any help!

Sasa
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Nov 16, 2012 9:59 pm   
 
You want an #ALARM, you can set it to go off in X amount of time, or at a specific time of day.
Of course an alarm cant fire if CMUD is not loaded into memory.

Or you could just have it pull the current %time when activated and have an alias check against it and do date math..
_________________
Discord: Shalimarwildcat
Reply with quote
gxyzod
Beginner


Joined: 10 May 2012
Posts: 12

PostPosted: Fri Nov 16, 2012 11:15 pm   
 
I would need to see how much time has passed. Yes, it would be calculated on the hours CMUD is up and running.
How could it be done?

Thanks once again, you are a life saver :)

Sasa
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sat Nov 17, 2012 2:38 am   
 
You could do something like this to make an alarm to go off in 40 hours:
Code:
#alarm "spellalarm" +144000 {do something}

144,000 is the number of seconds in 40 hours. If you wanted to use this for other spells with different times, you'd just need to adjust that, and I'd suggest renaming the alarm from "spellalarm" to the actual name of the spell.

To see the number of milliseconds remaining until the alarm fires, you can use %alarm("spellalarm"), or if you rename it, whenever the new name is. Just do some division to get that in a more readable format, instead of milliseconds.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Nov 17, 2012 4:25 am   
 
Daern, your method requires the session to be loaded... i believe he wants to be able to track even with logouts and reboots

for that the math is required, to figure out at what time and day it will work (im not good with date math)

then you can make an alarm to test weather or not you have passed that point in time that would fire off every minute or so

#TR {spell activates} {based on %time, figure out ending time}
#ALARM "SpellStillActive" -60 {testingAlias}
#ALIAS testingAlias {#IF (we are past the end %time) {do something}}
_________________
Discord: Shalimarwildcat
Reply with quote
gxyzod
Beginner


Joined: 10 May 2012
Posts: 12

PostPosted: Sun Nov 18, 2012 8:55 pm   
 
Thanks for the info. I resolved it asking the staff to implement the possibility to see how much time is left :D
Hope that they shall do so soon!
Thank you for your time and effort.


Sasa
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