Page 1 of 1

How to do formula for gold per hour?

Posted: Fri Aug 01, 2014 4:30 pm
by noobbotter
Hi. I'm trying to figure out how to do a gold/hour formula based on an estimated AH price (50K per item, for example). How would I go about doing that?

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)
Thanks.

Re: How to do formula for gold per hour?

Posted: Fri Aug 01, 2014 10:53 pm
by rock5
You collected earned number of items over a period of runtime minutes. If you divide the items by the minutes you get an item per minute rate
  • earned/runtime = items per min
If you multiply this value by your cost value of 50000 then you will have your gold per minute
  • 50000*earned/runtime = gold per min
If you want gold/hour then multiply by 60
  • 60*50000*earned/runtime = gold per hour
I think that's right.

Re: How to do formula for gold per hour?

Posted: Mon Aug 04, 2014 9:09 am
by noobbotter
I did finally figure it out. Had some other errors in my variables as well, but finally got it working.

My script I built has me earning about 7M gold per hour... provided I can sell the items in the AH, which I am doing manually one stack at a time so as to not over flood the market. So really it si "potentially" worth 7M per hour, but it's limited to buyers unlike with KS where items are immediately sold to vendors.

Re: How to do formula for gold per hour?

Posted: Tue Aug 05, 2014 11:08 pm
by lisa
my set window userfunction has an option for AH items to be included in the calculations.