Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Calculating efficiency decision choosing with different skill methods
- import random
- import array
- import sys
- xpHr = array.array('i',(0 for i in range(0,5)))
- gpHr = array.array('i',(0 for i in range(0,5)))
- totalHours = array.array('f',(sys.maxsize for i in range(0,5)))
- methodsSize = 5
- profitHr = 2000000
- xpHr[0] = 280000
- gpHr[0] = -1425000
- xpHr[1] = 90000
- gpHr[1] = 800000
- goalXp = 10000000
- bestMoneyHr = max(max(gpHr),profitHr)
- print("######################################")
- for i in range(methodsSize):
- if (xpHr[i] != 0):
- hours = 0
- print("method number",i+1)
- hours = goalXp/xpHr[i]
- totalProfit = gpHr[i] * hours
- if (gpHr[i] < 0):
- # adds extra hours for gathering gold for the skill
- extraHours = abs(gpHr[i])*hours/profitHr
- print ("extra hours gathering gold:",round(extraHours,2),"hours")
- print ("hours skilling: ",round(hours,2),"hours")
- hours += extraHours
- print("gold spent on the skill:",round(totalProfit,2),"gp")
- totalProfit = 0
- else:
- print("profit from the skill:",round(totalProfit,2),"gp")
- print("total hours:",round(hours,2),"hours")
- totalHours[i] = hours
- print("")
- fastestMethod = min(totalHours)
- for i in range(methodsSize):
- if (totalHours[i] > fastestMethod and xpHr[i] != 0):
- extraHours = totalHours[i] - fastestMethod
- moneyLoss = (extraHours * gpHr[i]) - (extraHours * bestMoneyHr)
- print("If you would choose method number",i+1,
- "you would lose", abs(round(moneyLoss,2)),
- "gp and spend",round(extraHours,2),
- "extra hours instead of choosing the fastest method and then grind money with your moneymaker.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement