public static void OpenPlanetTrial() { //No Need to call OpenCastle Since this is at top of castle //Get Attention of screen incase its not ontop WindowCapture.CaptureApplication("Nox"); //Opening up Castle MouseHandler.MoveCursor(LocationConstants.HOME_BOTTOM_CASTLE_LOCATION, true); MouseHandler.MoveCursor(LocationConstants.CASTLE_SCROLL_LOCATION); Main.Sleep(2); //Scrolling to top of castle for (int i = 0; i < 8; i++) { MouseHandler.MouseWheelUp(); Main.Sleep(1); } //Search Pixel Method is better than Specific location Since Expedition is an animation if (PixelChecker.SearchPixel(ColorConstants.CASTLE_PLANET_TRIAL_COLOR, out Point Location)) { MouseHandler.MoveCursor(Location, true); } else { //TODO: Max 3 Retries before giving up OpenPlanetTrial(); } }
private static void OpenChallenge() { if (!PixelChecker.SearchPixel(ColorConstants.EVENTS_UNCLAIMABLE, out Point unClaimLoc)) { for (int i = 0; i < 3; i++) { MouseHandler.MoveCursor(LocationConstants.HOME_BOTTOM_CASTLE_LOCATION, true); } OpenChallenge(); } unClaimLoc = new Point(unClaimLoc.X, unClaimLoc.Y - 96); MouseHandler.MoveCursor(unClaimLoc, true); }
public static void OpenMarket() { OpenCastle(); if (PixelChecker.SearchPixel(ColorConstants.CASTLE_MARKET_CHECK_COLOR, out Point Location)) { MouseHandler.MoveCursor(Location, true); } else { //TODO: Max 3 Retry for recalling function OpenMarket(); //Tries Again Until it is clicked } }
public static void OpenCreationBag() { OpenCastle(); //Uses same Check as Above since its hard to check for creating bag since its an animation if (PixelChecker.SearchPixel(ColorConstants.CASTLE_CREATION_BAG_COLOR, out Point Location)) { MouseHandler.MoveCursor(Location, true); } else { //TODO: Max 3 Retry for recalling function OpenMarket(); //Tries Again Until it is clicked } }
public static void OpenFortuneWheel() { OpenCastle(); MouseHandler.MouseWheelUp(); Main.Sleep(2); MouseHandler.MouseWheelUp(); //Mouse Wheel Up doesnt always move the same amount upwards so searching for the pixel is used instead of a specific location if (PixelChecker.SearchPixel(ColorConstants.CASTLE_FORTUNE_WHEEL_COLOR, out Point Location)) { MouseHandler.MoveCursor(Location, true); } else { //TODO: Max 3 Retries before giving up OpenFortuneWheel(); } }
public static void HomeBossAttack(int retryAmount) { //Reset To Home WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME); bool lost = false; Main.Sleep(3); string BossStatus = ImageToText.HomeBoss(); if (BossStatus == "next") { MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_BATTLE_NEXT, true); Main.Sleep(2); Point loc = new Point(); if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out loc)) { MouseHandler.MoveCursor(loc, true); } Main.Sleep(1); HomeBossAttack(0); //Starts Idling On Next Stage Then Re-Calls Function to Check for updates status } else if (BossStatus == "waves") { Main.LogConsole("Idling main boss..."); for (int i = 0; i < 250; i++) { MouseHandler.MoveCursor(LocationConstants.GLOBAL_BOT_IDLE_CLICK, true); Thread.Sleep(200); } HomeBossAttack(0); //Clicks for 100 hundred times and then rechecks if waves have been defeated } else if (BossStatus == "battle") { for (int CurrentTry = 0; CurrentTry < OtherConstants.ATTACK_RETRY_AMOUNT; CurrentTry++) { MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_BATTLE_NEXT, true); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GLOBAL_TEAM_BATTLE_CONFIRM, true); Main.Sleep(3); Main.Sleep(15); //Sleeps for 15 seconds as player is unable to skip in Home Bosses bool BattleWon = CheckWin(); if (BattleWon) { Main.LogConsole("Won Home Boss Attack!"); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); HomeBossAttack(0); break; //Not Sure if this is needed but ill just add it anyways } else { Main.LogConsole("Lost Home Boss Attack!"); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); } Main.LogConsole("Outcome of the Home Boss Battle Won: {0}", BattleWon.ToString()); } } else //Sometimes there can be trouble if the Menu shows "waves" in this case we just try again { Main.LogConsole("Unable To Read..."); if (PixelChecker.CheckPixelValue(LocationConstants.HOME_BOSS_MAP_CIRCLE, ColorConstants.HOME_BOSS_MAP_CIRCLE)) { Main.LogConsole("Yeet Skeet Neet Pee"); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.HOME_BOSS_MAP_CIRCLE, true); if (PixelChecker.SearchPixel(ColorConstants.HOME_NEXT_MAP, out var loc)) { MouseHandler.MoveCursor(loc, true); if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out var loc3)) { MouseHandler.MoveCursor(loc3, true); HomeBossAttackHandler(); } } else { bool found = PixelChecker.SearchPixel(ColorConstants.HOME_NEXT_MAP, out var locs); if (found) { MouseHandler.MoveCursor(loc, true); } MouseHandler.MoveCursor(loc, true); if (PixelChecker.SearchPixel(ColorConstants.HOME_BOSS_NEXT, out var loc3)) { MouseHandler.MoveCursor(loc3, true); HomeBossAttackHandler(); } } } if (retryAmount == 15) { Main.LogConsole("Unable to read Boss Status..."); return; } Main.LogConsole("Moving Onto Next Stage.."); HomeBossAttackHandler(retryAmount++); } }
public static void PlanetTrialAttack() { bool AttackingPillar = true; while (AttackingPillar) { for (int CurrentTry = 0; CurrentTry < GlobalVariables.attackSettings.PlanetTrialRetryAmount; CurrentTry++) { Main.Sleep(5); var Location = new Point(0, 0); if (!PixelChecker.SearchPixel(ColorConstants.SKYPILLAR_BATTLE_COLOR, out Location)) { string BattleTest = ImageToText.GymBattleCheck(out Location); if (BattleTest != "battle") { PlanetTrialAttackHandler(); } Main.Sleep(1); MouseHandler.MoveCursor(Location, true); } else { MouseHandler.MoveCursor(Location, true); } Main.Sleep(3); MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true); Main.Sleep(3); MouseHandler.MoveCursor(LocationConstants.GLOBAL_TEAM_BATTLE_CONFIRM, true); Main.Sleep(3); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_SKIP, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_SKIP_CONFIRM, true); bool BattleFinished = false; while (!BattleFinished) { //Sleep for 2 seconds and then Check Main.Sleep(2); if (PixelChecker.CheckPixelValue(LocationConstants.GLOBAL_BATTLE_FINISHED, ColorConstants.GLOBAL_BATTLE_FINISHED)) { BattleFinished = true; } } bool BattleWon = CheckWin(); if (BattleWon) { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); break; } else { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); if (CurrentTry == 2) { AttackingPillar = false; } } } } }