public int GetCurrentBoss() { if (!window.Locked) { window.Click(FightBossConstants.pointPageFightBoss, false, true); string input = window.OCRTextSearch(FightBossConstants.rectCurrentBoss, false); int start = input.IndexOf("Boss"); if (start < 0 || input.Length < start + 4 + 1) { return(-1); } start += 4; input = input.Substring(start); BigInteger boss = window.Parse(input); return((int)boss - 1); } else { return(-1); } }
public BigInteger GetEXP() { if (window.Locked) { return(-1); } window.Click(SpendEXPConstants.pointPageSpendEXP, false, true); string input = window.OCRTextSearch(SpendEXPConstants.rectExp, false); int start = input.IndexOf("have ") + 5; int end = input.IndexOf(" EXP"); int length = end - start; if (start < 1 || length < 1 || start + length > input.Length) { return(new BigInteger(0)); } input = input.Substring(start, length); BigInteger exp = window.Parse(input); string diffSinceLast = string.Empty; if (currentExp == -1) { window.Log($"Current Exp: {exp,5}"); } else if (currentExp > -1 && currentExp != exp) { if (exp > currentExp) { gainedExp += exp - currentExp; } else if (exp < currentExp) { allocatedExp += currentExp - exp; } window.Log($"Current Exp: {exp,5} - GainedExp: {gainedExp,5} - SpendExp {allocatedExp,5} - DiffSinceLast: {exp - currentExp, 6}"); } currentExp = exp; return(exp); }