Each time my script gets back to the start, I have it display how many minutes I've been running (working properly) and how many items I've collected since I started (working properly), but for the life of me, can't figure out how that would equate into gold per hour. I figure total gold earned is the total items collected * 50,000, but how to use that with the time ran to figure gold/hour?
Here's what I have right now:
Code: Select all
printf("starting with %s items.\n", initialInv) ---- works properly based on initialInv set in onload section.
local curInv = inventory:itemTotalCount(204527)
printf("Now have %s items.\n", curInv) --works properly
local runtime = (os.time()-time)/60
printf("been running for %s minutes.\n", runtime) -- works properly
local earned = curInv - initialInv
local gph = 0
local totalgoldearned = 0
if earned == 0 then
totalgoldearned = 0
gph = 0
else
totalgoldearned = earned * 50000
epm = runtime/earned -- is this how you figure gold per hour? not working for me.
end
printf("Earning approx. %s gold per hour.", gph)