private static bool CheckDispatch() { if (PixelChecker.CheckPixelValue(LocationConstants.TAVERN_COMPLETE, ColorConstants.TAVERN_DISPATCH)) { MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.TAVERN_QUICK, true); Main.Sleep(2); if (PixelChecker.CheckPixelValue(LocationConstants.TAVERN_START, ColorConstants.TAVERN_START)) { MouseHandler.MoveCursor(LocationConstants.TAVERN_START, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); return(true); } else { Main.LogConsole("Not Enough Heroes to complete event!..."); return(false); } } return(false); }
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(); } }
public static void CheckMenu() { WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME); //Reset To Main Menu Main.ResetToHome(); //Open Menu First MouseHandler.MoveCursor(LocationConstants.HOME_MENU_BUTTON, true); //Setting Up Boolean Var Boolean[] NotifAvailable = new Boolean[7]; //Take New Screenshot WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME); //Check If Anything on the menu needs to be completed (Keep In Mind Quests Needs a deeper Check) GlobalVariables.QUESTS_FINISHED = !PixelChecker.CheckPixelValue(LocationConstants.MENU_QUEST, ColorConstants.MENU_QUEST_RED); //Requires more checks //Events Require Two Checks if (PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_GREEN) || PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_RED)) { GlobalVariables.EVENTS_COMPLETED = false; } GlobalVariables.HEARTS_SENT = !PixelChecker.CheckPixelValue(LocationConstants.MENU_FRIENDS, ColorConstants.MENU_FRIENDS_RED); GlobalVariables.UPGRADED_FAMILIAR = !PixelChecker.CheckPixelValue(LocationConstants.MENU_FAMILIAR, ColorConstants.MENU_FAMILIAR_GREEN); GlobalVariables.MAIL_EMPTY = !PixelChecker.CheckPixelValue(LocationConstants.MENU_MAILS, ColorConstants.MENU_MAIL_RED); Console.WriteLine(GlobalVariables.QUESTS_FINISHED); Console.WriteLine(GlobalVariables.EVENTS_COMPLETED); Console.WriteLine(GlobalVariables.HEARTS_SENT); Console.WriteLine(GlobalVariables.UPGRADED_FAMILIAR); Console.WriteLine(GlobalVariables.MAIL_EMPTY); }
public static bool ClaimQuestReward() { Main.ResetToHome(); Main.ResetToHome(); MouseHandler.MoveCursor(LocationConstants.HOME_MAINMENU_LOCATION, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.MENU_QUESTS_BUTTON_LOCATION, true); while (!PixelChecker.CheckPixelValue(LocationConstants.QUEST_CLAIM, ColorConstants.QUEST_UNCLAIMABLE_COLOR)) { MouseHandler.MoveCursor(LocationConstants.QUEST_CLAIMAIN_LOCATION, true); } bool isClaimable = false; //Checks is it is Unclaimable if since the claimable button is animated. if (!PixelChecker.CheckPixelValue(LocationConstants.QUEST_CLAIM_MASTER, ColorConstants.EVENTS_UNCLAIMABLE)) { isClaimable = true; } if (isClaimable) { MouseHandler.MoveCursor(LocationConstants.QUEST_CLAIM_MASTER, true); return(true); } return(false); }
public static Boolean MineGuildGold() { OpenObjects.OpenGuild(); if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_DAILY_COINS, ColorConstants.GUILD_DAILY_COINS)) { MouseHandler.MoveCursor(LocationConstants.GUILD_DAILY_COINS, true); } if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_MINE_BONUS, ColorConstants.GUILD_MINE_BONUS)) { Main.LogConsole("Claiming Previous Bonus"); MouseHandler.MoveCursor(LocationConstants.GUILD_CLAIM_BONUS, true); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_CLAIM, true); MineGuildGold(); } if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_START_DIGGING, ColorConstants.GUILD_START_DIGGING)) { Main.LogConsole("Digging next bonus..."); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_START_DIGGING, true); } return(true); }
public static void AttackDenOfSecrets() { bool AttackingDOS = true; int winAmount = 0; while (AttackingDOS) { Main.LogConsole($"Attacking Den Of Secrets. Total Levels Won: {winAmount.ToString()}"); for (int CurrentTry = 0; CurrentTry < OtherConstants.ATTACK_RETRY_AMOUNT; CurrentTry++) { Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.DOS_BATTLE_LOCATION, true); //Maybe Add SearchPixel If Problems Occur Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_TEAM_BATTLE_CONFIRM, true); Main.Sleep(3); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_SKIP, true); Main.Sleep(3); 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); winAmount += 1; break; } else { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); if (CurrentTry == 2) { AttackingDOS = false; } } } } Main.LogConsole($"Finished Attacking Den Of Secrets After 3 Losses On Same Level. Total Levels Won: {winAmount.ToString()}"); }
public static Boolean isHome() { if (PixelChecker.CheckPixelValue(LocationConstants.HOME_BOTTOM_BATTLE_ACTIVE, ColorConstants.HOME_BOTTOM_BATTLE_ACTIVE_COLOR)) { return(true); } return(false); }
public static bool GuildBossAttack(int BossesAttacked = 0) { Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_BATTLE, true); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_ATTACK, 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); } else { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); } BossesAttacked++; if (BossesAttacked >= GlobalVariables.attackSettings.GuildRetryAmount) { return(true); } else { GuildBossAttack(BossesAttacked); } return(true); }
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 Boolean SetGuildTeam() { OpenObjects.OpenGuild(); if (PixelChecker.CheckPixelValue(LocationConstants.GUILD_WAR_TEAM, ColorConstants.GUILD_SET_WAR)) { Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_WAR_TEAM, true); Main.Sleep(2); MouseHandler.MoveCursor(LocationConstants.GUILD_SET_TEAM, true); Main.Sleep(2); } return(true); }
private static bool FinishQuest() { for (int i = 0; i < 15; i++) { if (PixelChecker.CheckPixelValue(LocationConstants.TAVERN_COMPLETE, ColorConstants.TAVER_FINISH)) { MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); return(true); } Thread.Sleep(430); } return(false); }
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 Boolean ClaimPrivellage() { Main.ResetToHome(); Thread.Sleep(4000); MouseHandler.MoveCursor(LocationConstants.HOME_PIRVALLEGE_BUTTON, true); while (PixelChecker.CheckPixelValue(LocationConstants.PRIVALLEGE_CHECKIN_BUTTON, ColorConstants.PRIVALLEGE_CHECKIN_YELLOW)) { MouseHandler.MoveCursor(LocationConstants.PRIVALLEGE_CHECKIN_BUTTON, true); Thread.Sleep(500); } return(true); }
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(); } }
/// <summary> /// Function that resets the game back to the main Menu /// </summary> /// <returns></returns> public static Boolean ResetToHome() { WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME); //If Screen is stuck on a battle screen this will select it. (Doesn't Check if button is there just clicks it anyways); // Now thinking about it this could cause problems so i added a check if (PixelChecker.CheckPixelValue(LocationConstants.GLOBAL_BATTLE_FINISHED, ColorConstants.GLOBAL_BATTLE_FINISHED)) { MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); } //Force Back To Main Menu && Collect any gold (Ran 50 Times because it will click nonstop) for (int i = 0; i < 50; i++) { MouseHandler.MoveCursor(LocationConstants.HOME_BOTTOM_BATTLE, true); } //Check if Menu is Open And Close it if it is //Check if Battle Menu is Active and Returns true if (isHome()) { Console.WriteLine("Is Home"); return(true); } /* Going to Do this bit later since i need to find a place where the above will not return True * What i need to check ofr is * If Not At Home check for X Button and Click * Multiple Close Button Locations */ //Do Comment Above Here //ReCheck If Home if (isHome()) { Console.WriteLine("Is Home"); return(true); } Console.WriteLine("Is Not Home"); return(false); }
public static Boolean ClaimMail() { WindowCapture.CaptureApplication("Nox"); Main.ResetToHome(); //if (!Main.ResetToHome()) //{ // Console.WriteLine("Returning False"); // return false; //} Thread.Sleep(500); MouseHandler.MoveCursor(LocationConstants.HOME_MAINMENU_LOCATION, true); Main.Sleep(3); if (PixelChecker.CheckPixelValue(LocationConstants.MENU_MAILS, ColorConstants.MENU_MAIL_RED)) { Console.WriteLine("Its Red"); MouseHandler.MoveCursor(LocationConstants.MENU_MAILS, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.MAIL_RECEIVEALL, true); if (GlobalVariables.dailySettings.DeleteMail == false) { Main.ResetToHome(); return(true); } while (PixelChecker.CheckPixelValue(LocationConstants.MAIL_RECEIVE, ColorConstants.MAIL_DELETE)) { MouseHandler.MoveCursor(LocationConstants.MAIL_RECEIVE, true); } } else { Console.WriteLine("Its Not Red"); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BOT_IDLE_CLICK, true); } Main.ResetToHome(); return(true); }
private static bool CheckSpeedUp() { if (PixelChecker.CheckPixelValue(LocationConstants.TAVERN_COMPLETE, ColorConstants.TAVERN_SPEEDUP)) { MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); Thread.Sleep(1000); if (PixelChecker.CheckPixelValue(LocationConstants.TAVERN_SPEED, ColorConstants.TAVERN_SPEED)) { MouseHandler.MoveCursor(LocationConstants.TAVERN_SPEED, true); MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); return(true); } else { MouseHandler.MoveCursor(LocationConstants.TAVERN_COMPLETE, true); return(true); } } return(false); }
public static Boolean EventsAttack() { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true); Main.Sleep(1); 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); return(true); } else { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); return(false); } }
/// <summary> /// This function is only called once battle is finished /// </summary> /// <param name="checkAmount"></param> /// <returns></returns> public static Boolean CheckWin(int checkAmount = 0) { if (checkAmount == 5) { //Add Handler // Events To Stop This Main.ResetToHome(); return(false); //Returns False indicating battle was not won although no battle occured. } if (PixelChecker.CheckPixelValue(LocationConstants.GLOBAL_BATTLE_CHECK_WIN, ColorConstants.GLOBAL_BATTLE_WON)) { return(true); } else if (PixelChecker.CheckPixelValue(LocationConstants.GLOBAL_BATTLE_CHECK_LOSS, ColorConstants.GLOBAL_BATTLE_LOST)) { return(false); } else { return(CheckWin(checkAmount + 1)); } }
public static Boolean SummonCommonKey() { Main.ResetToHome(); OpenObjects.OpenHeroChest(); bool claimedCommon = false; //Goes to Bottom Of Hero Chest Screen for (int i = 0; i < 10; i++) { MouseHandler.MoveCursor(LocationConstants.CASTLE_SCROLL_LOCATION, true); } Main.LogConsole("Checking Daily Common Key"); if (PixelChecker.CheckPixelValue(LocationConstants.HEROCHEST_COMMON_FREE_CIRCLE, ColorConstants.HEROCHEST_COMMON_FREE)) { Main.LogConsole("Claiming Daily Free Common Summon Key"); MouseHandler.MoveCursor(LocationConstants.HEROCHEST_COMMON_FREE_CIRCLE, true); return(true); } if (!claimedCommon) { int CommonKeyNo = ImageToText.GetCommonKeyAmount(); if (CommonKeyNo > 0) { Main.LogConsole("Using Extra Common Summon Key In Backpack. Since No More Free Keys"); MouseHandler.MoveCursor(LocationConstants.HEROCHEST_COMMON_CLAIM, true); return(true); } } Main.LogConsole("No Keys Available to Summon Common Chest"); return(false);; }
public static void BotStart() { if (GlobalVariables.BOT_STARTED == true) { Main.LogConsole("Bot Already Started"); return; } //Add Functions to Check if a Supported Emulator Is Open WindowCapture.GetProccessName(); //Updates Process Name //if (GlobalVariables.GLOBAL_PROC_NAME == "InvalidProc") //{ // System.Windows.Application.Current.Shutdown(); //} WindowCapture.CaptureApplication(GlobalVariables.GLOBAL_PROC_NAME); //Add Functions to Check For Specific Options Console.WriteLine("Bot Started: " + GlobalVariables.BOT_STARTED.ToString()); GlobalVariables.BOT_STARTED = true; GlobalVariables.ISON = true; if (!Main.CheckSize()) { GlobalVariables.BOT_STARTED = false; GlobalVariables.ISON = false; return; } //Adding this to Another Thread won't work. KeyHandler.StartKeyHandler(); //Re-Checks if Credentials are correct var LoginThread = new Thread(() => { while (true) { bool check = Authentication.LoginHandler.CheckLogin(Properties.Settings.Default.username, Properties.Settings.Default.password); bool valid = false; string sHW = Authentication.LoginHandler.GetHWID(Properties.Settings.Default.username); string cHW = Authentication.FingerPrint.Value(); if (sHW == cHW) { valid = true; } else { valid = false; } if (!check && !valid) { GlobalVariables.ISON = false; Main.LogConsole("Attemp to connect to server failed... Retrying!"); } Main.Sleep(60); } }); //Create a new Thread to Handle All Bot Related Things var MainThread = new Thread(() => { DrawOverlay("Click F5 to stop the Bot"); Thread.Sleep(2000); //KeyHandler.StartKeyHandler(); //Everything must be contained into a while loop to make sure bot stops when it is told to stop while (GlobalVariables.BOT_STARTED == true && GlobalVariables.ISON == true) { Main.LogConsole("Bot Started"); //Reset Bot To Main Menu Main.ResetToHome(); //Check For Users Level, Gold, Purple ETC GlobalVariables.CURRENCY_INFO = UpdatePlayerInfo.GetCurrecyDetails(); Main.LogConsole($"Gold: {GlobalVariables.CURRENCY_INFO[0].ToString()} - Gems: {GlobalVariables.CURRENCY_INFO[1].ToString()} - Level: {GlobalVariables.CURRENCY_INFO[2].ToString()}"); Main.LogConsole($"Purple Souls: {GlobalVariables.CURRENCY_INFO[3].ToString()} - Golden Souls: {GlobalVariables.CURRENCY_INFO[4].ToString()}"); Main.CheckLimits(); Task DoDailes = new Task(() => { ClaimDailies(); }); DoDailes.Start(); DoDailes.Wait(); Main.LogConsole("Finished Attempting Daily Tasks.."); Main.ResetToHome(); Task DoAttack = new Task(() => { AttackBattles(); }); DoAttack.Start(); DoAttack.Wait(); Main.LogConsole("Finished Attacking Battles."); Console.WriteLine("Going back home..."); Main.ResetToHome(); Console.WriteLine("Idling..."); if (!GlobalVariables.EVENTS_COMPLETED) { Main.ResetToHome(); GlobalVariables.EVENTS_COMPLETED = UpdatePlayerInfo.ClaimEvents(); } //Add Functions to Claim Daily Items, Open Crates, etc //Make Bot Idle Click for 10 Minutes Then Move on GlobalVariables.BOT_STATE = "Idling"; Console.WriteLine("Bot State: Idling"); Console.WriteLine("Bot Idling"); //Create a new Task To Handle Clicking so it doesnt take up Main Thread. bool output = false; var task = new Thread(() => { output = Main.IdleClick(); }); task.Start(); Main.Sleep(15); //Sleep For 15 Minutes Before Continuing GlobalVariables.BOT_STATE = "Checking"; //Setting State Console.WriteLine("Checking If Account Alreay Logged In"); //Check If Bot Logged In if (PixelChecker.CheckPixelValue(LocationConstants.HOME_ACCOUNT_ALREADY_LOGGED, ColorConstants.RELOG_OK)) { Main.LogConsole("Account Logged In From Another Account Waiting 5 Minutes To Re-Log"); //Thread.Sleep(5 * 60000); Main.Sleep(30); MouseHandler.MoveCursor(LocationConstants.HOME_ACCOUNT_ALREADY_LOGGED, true); } } }); LoginThread.Start(); MainThread.Start(); var CheckState = new Thread(() => { while (true) { if (GlobalVariables.BOT_STARTED == false) { LoginThread.Abort(); MainThread.Abort(); } } }); CheckState.Start(); }
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 bool AttackBraveLeague(int RefreshAmount = 0) { Thread.Sleep(1000); int pos = GetLowestCE(); if (RefreshAmount > 10) { Main.LogConsole("Tried Refreshing 10 Times to find CE which matches your settings but couldn't find an opponent to match the criteria."); return(false); } switch (pos) { case -1: Main.LogConsole("All EnemyCE larger than Max BraveCE"); MouseHandler.MoveCursor(LocationConstants.BRAVE_REFRESH, true); AttackBraveLeague(RefreshAmount++); break; case 0: MouseHandler.MoveCursor(LocationConstants.BRAVE_BATTLE1, true); break; case 1: MouseHandler.MoveCursor(LocationConstants.BRAVE_BATTLE2, true); break; case 2: MouseHandler.MoveCursor(LocationConstants.BRAVE_BATTLE3, true); break; } //Attack Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_ENEMYINFO_BATTLE_CONFIRM, true); Main.Sleep(1); 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.BRAVE_CHOSEREWARD, ColorConstants.BRAVE_REWARD_COLOR)) { MouseHandler.MoveCursor(LocationConstants.BRAVE_CHOSEREWARD, true); MouseHandler.MoveCursor(LocationConstants.BRAVE_RANDOM, true); MouseHandler.MoveCursor(LocationConstants.BRAVE_RANDOM, true); MouseHandler.MoveCursor(LocationConstants.BRAVE_RANDOM, true); Thread.Sleep(500); 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); return(true); } else { Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.GLOBAL_BATTLE_FINISHED, true); return(false); } }
public static Boolean ClaimFriends() { WindowCapture.CaptureApplication("Nox"); Main.ResetToHome(); //if (!Main.ResetToHome()) //{ // Console.WriteLine("Not Home"); // return false; //} Main.ResetToHome(); Thread.Sleep(500); MouseHandler.MoveCursor(LocationConstants.HOME_MAINMENU_LOCATION, true); Main.Sleep(1); if (!PixelChecker.CheckPixelValue(LocationConstants.MENU_FRIENDS, ColorConstants.MENU_FRIENDS_RED)) { Console.WriteLine("Its Not Red"); return(true); } Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.MENU_FRIENDS, true); Main.Sleep(1); if (PixelChecker.CheckPixelValue(LocationConstants.FRIENDS_LIST, ColorConstants.FRIENDS_LIST_RED)) { MouseHandler.MoveCursor(LocationConstants.FRIENDS_LIST, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.FRIENDS_CLAIM_SEND, true); Main.Sleep(1); } if (PixelChecker.CheckPixelValue(LocationConstants.FRIENDS_REQUESTS, ColorConstants.FRIENDS_REQUESTS_GREEN)) { MouseHandler.MoveCursor(LocationConstants.FRIENDS_REQUESTS, true); Thread.Sleep(2000); if (GlobalVariables.dailySettings.AcceptFreindReq) { while (PixelChecker.CheckPixelValue(LocationConstants.FRIENDS_ACCEPT, ColorConstants.FRIENDS_ACCEPT)) { MouseHandler.MoveCursor(LocationConstants.FRIENDS_ACCEPT, true); Thread.Sleep(500); } } if (GlobalVariables.dailySettings.DeclineFriendReq) { MouseHandler.MoveCursor(LocationConstants.FRIENDS_DELETE, true); Thread.Sleep(500); } //Do Nothing for now } if (PixelChecker.CheckPixelValue(LocationConstants.FRIENDS_COOP, ColorConstants.FRIENDS_COOP_RED)) { MouseHandler.MoveCursor(LocationConstants.FRIENDS_COOP, true); Main.Sleep(1); MouseHandler.MoveCursor(LocationConstants.FRIENDS_SCOUT, true); Main.Sleep(1); } Main.ResetToHome(); return(true); }
public static Boolean ClaimEvents() { WindowCapture.CaptureApplication("Nox"); Main.LogConsole("Trying to Claim Daily Events"); Main.ResetToHome(); Thread.Sleep(500); MouseHandler.MoveCursor(LocationConstants.HOME_MAINMENU_LOCATION, true); Main.Sleep(1); if (!PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_GREEN) && !PixelChecker.CheckPixelValue(LocationConstants.MENU_EVENTS, ColorConstants.MENU_EVENTS_RED)) { Main.LogConsole("Events Already Claimed!"); return(true); } MouseHandler.MoveCursor(LocationConstants.MENU_EVENTS, true); bool[] wonAttack = { false, false, false }; bool[] attacked = { false, false, false }; int totalClaimed = 0; //remove 96 Height #region Attack Event //Check if an attack is available if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_1, ColorConstants.EVENTS_ATTACK_1)) { attacked[0] = true; MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_1, true); OpenChallenge(); if (!Attack.EventsAttack()) { Main.LogConsole("Failed Win Event 1 Challenge!"); } else { Main.LogConsole("Successfully Defeated Event 1 Challenge!"); totalClaimed++; wonAttack[0] = true; } } if (attacked[0]) { OpenObjects.OpenEvents(); } if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_2, ColorConstants.EVENTS_ATTACK_2)) { attacked[1] = true; MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_2, true); OpenChallenge(); if (!Attack.EventsAttack()) { Main.LogConsole("Failed Win Event 2 Challenge!"); } else { Main.LogConsole("Successfully Defeated Event 1 Challenge!"); totalClaimed++; wonAttack[1] = true; } } if (attacked[1]) { OpenObjects.OpenEvents(); } if (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_ATTACK_3, ColorConstants.EVENTS_ATTACK_3)) { attacked[2] = true; MouseHandler.MoveCursor(LocationConstants.EVENTS_ATTACK_3, true); OpenChallenge(); if (!Attack.EventsAttack()) { Main.LogConsole("Failed Win Event 3 Challenge!"); } else { Main.LogConsole("Successfully Defeated Event 1 Challenge!"); totalClaimed++; wonAttack[2] = true; } } #endregion if (attacked[2]) { OpenObjects.OpenEvents(); } #region Claim Events while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_1, ColorConstants.EVENTS_CLAIM_1)) { totalClaimed++; MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_1, true); } while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_2, ColorConstants.EVENTS_CLAIM_2)) { totalClaimed++; MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_2, true); } while (PixelChecker.CheckPixelValue(LocationConstants.EVENTS_CLAIM_3, ColorConstants.EVENTS_CLAIM_3)) { totalClaimed++; MouseHandler.MoveCursor(LocationConstants.EVENTS_CLAIM_3, true); } #endregion Main.LogConsole($"Claimed {totalClaimed.ToString()} Daily Events"); Main.ResetToHome(); return(true); }
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; } } } } }
public static Boolean CombineEquipment() { /* 0 1 2 3 4 * 0 D | D | D | D | D * 1 D | D | D | D | D * 2 D | X | X | X | N */ /* START AT (115, 535) * WHEN MOVING TO THE RIGHT DO (115 + (POS * 95), 535) * WHEN MOVING DOWN DO (115, 535 + (POS * 85)) * THIS SHOULD LEAVE U TO THE LAST Y = 705 * SO IN TOTAL THE CALCULATION IS * (115 + (POS * 95), 535 + (POS * 85)) */ ColorConstants.SetColours(); Main.ResetToHome(); OpenObjects.OpenBlackSmith(); Point startPos = LocationConstants.BLACKSMITH_DEFAULT; Point setPos = startPos; int combined = 0; Thread.Sleep(1000); for (int type = 0; type < 3; type++) { if (type == 1) { MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_ARMOR, true); } else if (type == 2) { MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_ACCESSORY, true); } else if (type == 3) { MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_HELMET, true); } for (int y = 0; y < 4; y++) { for (int x = 0; x < 5; x++) { if (combined >= 3) { return(true); } setPos = new Point(115 + (x * 95), 535 + (y * 85)); try { if (PixelChecker.CheckPixelValue(setPos, ColorConstants.Equipments[y, x])) { if (setPos.X == 495) { setPos = new Point(setPos.X - 5, setPos.Y); } Console.WriteLine($"Found Equipment that needs to be combined. Location - {x}:{y}"); MouseHandler.MoveCursor(setPos, true); int CombineAmount = ImageToText.GetCombineAmount(); if (CombineAmount == -1) { Console.WriteLine($"Unable To Read Combine Amount. Combining it Once"); LowerCombineAmont(100); int price = ImageToText.GetBlacksmithPurchaseAmount(); MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_PURCHASE, true); Thread.Sleep(3000); if (PixelChecker.CheckPixelValue(LocationConstants.BLACKSMITH_CLAIM, ColorConstants.BLACKSMITH_CLAIM_COLOR)) { MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_CLAIM, true); combined++; } else { Console.WriteLine("Insufficient Gold!"); } } else { int loweramount = CombineAmount - 3; LowerCombineAmont(loweramount); int price = ImageToText.GetBlacksmithPurchaseAmount(); MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_PURCHASE, true); Thread.Sleep(3000); if (PixelChecker.CheckPixelValue(LocationConstants.BLACKSMITH_CLAIM, ColorConstants.BLACKSMITH_CLAIM_COLOR)) { MouseHandler.MoveCursor(LocationConstants.BLACKSMITH_CLAIM, true); combined += 3; } else { Console.WriteLine("Insufficient Gold!"); } } } } catch { x++; } } } } Console.WriteLine("Finished"); return(true); }
public static Boolean ClaimAlchemy() { bool ClaimFree = false; bool Claim20 = false; bool Claim50 = false; MouseHandler.MoveCursor(LocationConstants.HOME_ALCHEMY_BUTTON, true); if (PixelChecker.CheckPixelValue(LocationConstants.ALCHEMY_FREE_BUTTON, ColorConstants.ALCHEMY_FREE)) { ClaimFree = true; } if (PixelChecker.CheckPixelValue(LocationConstants.ALCHEMY_20GEMS_BUTTON, ColorConstants.ALCHEMY_20GEMS)) { Claim20 = true; if (GlobalVariables.CURRENCY_INFO[2] < 30 && GlobalVariables.CURRENCY_INFO[2] != -1) { Claim20 = false; Main.LogConsole("Not Claiming 20 Gem Alchemy As Gem Amount is below 30"); } } if (PixelChecker.CheckPixelValue(LocationConstants.ALCHEMY_50GEMS_BUTTON, ColorConstants.ALCHEMY_50GEMS)) { Claim50 = true; if (ClaimFree && Claim20) { Claim50 = false; Main.LogConsole("Not Claiming 50 Gem Alchemy As Free & 20 Gem is Available"); } else if (GlobalVariables.CURRENCY_INFO[2] < 400 && GlobalVariables.CURRENCY_INFO[2] != -1) { Claim50 = false; Main.LogConsole("Not Claiming 50 Gem Alchemy As Gem Amount is below 500"); } } if (ClaimFree && Claim20) { MouseHandler.MoveCursor(LocationConstants.ALCHEMY_FREE_BUTTON, true); Thread.Sleep(400); MouseHandler.MoveCursor(LocationConstants.ALCHEMY_20GEMS_BUTTON, true); Thread.Sleep(400); Main.LogConsole("Claimed Daily Free & 20 Gem Alchemy"); } else if (ClaimFree && Claim50) { MouseHandler.MoveCursor(LocationConstants.ALCHEMY_FREE_BUTTON, true); Thread.Sleep(400); MouseHandler.MoveCursor(LocationConstants.ALCHEMY_50GEMS_BUTTON, true); Thread.Sleep(400); Main.LogConsole("Claimed Daily Free & 50 Gem Alchemy"); } else if (ClaimFree && Claim50) { MouseHandler.MoveCursor(LocationConstants.ALCHEMY_20GEMS_BUTTON, true); Thread.Sleep(400); MouseHandler.MoveCursor(LocationConstants.ALCHEMY_50GEMS_BUTTON, true); Thread.Sleep(400); Main.LogConsole("Claimed Daily 20 & 50 Gem Alchemy"); } else { return(false); } return(true); }