|
Jorville Wanderer
Joined: 30 Apr 2006 Posts: 58 Location: Brookhaven, MS
|
Posted: 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 |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
|
|