{}
run-icon
main.py
import math import time print("Enter a list of your clan members' levels, separated by commas.") print("You may also indicate the member's class with a forward slash and the class' initial (P, M, or R)") print("Immortal Soul number goes after '-' at the end") print("") print("Example list: 10/M-1200, 8/P-100, 3/R, 4/P, 12-800, 9") print("") inputList = input("Type list here --> ") currentImmo = int(input("Current immortal level --> ")) cps = int(input("Clan CPS --> ")) # targetImmo = int(input("How long to get to immortal level ___? ")) # all "target" code is for finding time to a specific value instead of generating the whole table checkInRate = int(input("expected % of check-ins+bonus fights missed: ")) startTime = time.time() clanInputList = inputList.strip().split(",") clanList = [] classList = [] soulList = [] print("") def soulsToLevelUp(level): return 150*level*(3*level+1) def health(level): if level < 7: p = level + (level % 4) - math.ceil(level / 3) else: p = (2 * ((level - 1) % 3)) + 3 immohealth = 5250 * p * (3 ** (math.ceil(level / 3) - 1)) return immohealth def finddpc(clanList): dpcNoClass = 0 dpcHoly = 0 dpcPhysical = 0 dpcArcane = 0 for person in range(len(clanList)): if classList[person] == "P" or classList[person] == "p": dpcHoly += 12.5 * (3 ** (int(clanList[person]) - 1)) else: dpcHoly += 10 * (3 ** (int(clanList[person]) - 1)) if classList[person] == "M" or classList[person] == "m": dpcArcane += 12.5 * (3 ** (int(clanList[person]) - 1)) else: dpcArcane += 10 * (3 ** (int(clanList[person]) - 1)) if classList[person] == "R" or classList[person] == "r": dpcPhysical += 12.5 * (3 ** (int(clanList[person]) - 1)) else: dpcPhysical += 10 * (3 ** (int(clanList[person]) - 1)) return [dpcArcane,dpcHoly,dpcPhysical] for i in range(len(clanInputList)): if "-" in clanInputList[i]: soulList.append(float(clanInputList[i].split("-")[1])) levelAndClass = clanInputList[i].split("-")[0] else: soulList.append(0) levelAndClass = clanInputList[i] if "/" in clanInputList[i]: clanList.append(int(levelAndClass.split("/")[0])) classList.append(levelAndClass.split("/")[1]) else: clanList.append(int(clanInputList[i].split("-")[0])) classList.append('N') rubyCount = 0 minimumDpc = min(finddpc(clanList)) for day in range(1,36500): years = math.floor(day/365) days = day % 365 rubyCount += (100-checkInRate)*(9+currentImmo) for member in range(len(soulList)): soulList[member] += (200-(2*checkInRate)) * currentImmo if soulList[member] >= soulsToLevelUp(clanList[member]): soulList[member] -= soulsToLevelUp(clanList[member]) clanList[member] += 1 minimumDpc = min(finddpc(clanList)) if health(currentImmo + 1) <= 15 * cps * minimumDpc: currentImmo += 1 print(f"Lvl {currentImmo} after {years}y {days}d -- rubies earned: {rubyCount}") if currentImmo == targetImmo: targetYears = years targetDays = days targetRubies = rubyCount targetClan = clanList print("") print(f"Lvl {targetImmo} reached in {targetYears}y {targetDays}d -- rubies earned: {targetRubies}") print(f"Final clan levels: {targetClan}") print("") endTime = time.time() dt = endTime - startTime print(f"code done in a blistering {1000*dt} ms")
Output