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
Jorville
Wanderer


Joined: 30 Apr 2006
Posts: 58
Location: Brookhaven, MS

PostPosted: Mon Oct 19, 2009 2:40 pm   

date tracking script help
 
I got a script that keeps track of money I find and the date I started looking. So i got like "You have found 100 credits in 2 attempts for an average of 50 credits per attempt. You started looking on Mon Oct 19."
Im trying to find a way to add a "You have found an average of # credits per day." But I want the days to be total days, not just days logged in. I cant figure out what direction I need to take in this to even get started. I can't figure out anyway to take that 19 and use the current date to get the number of days. Because, if you got 19 and 25 you can convert that to say 7 but what happens when it rolls over to the 1st? 19-1 doesnt work. Any suggestions?
_________________
Jorville
Player on SWMUD
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Oct 19, 2009 2:46 pm   
 
You can easily use lua and os.time to determine the number of days passed. It's much more efficient than what you can do with zscript, though it applies pretty much the same principal. You'll have to search for such scripts, though you can find one I was working on in these forums. I'd give you what I have now, but I'm in the middle of moving and my computer is boxed up right now.

Charneus
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