public void Start() { UpdateScreen(); User32.SetForegroundWindow(App.MainWindowHandle); Thread.Sleep(_SleepTime); if (_IsComplete()) { Complete = true; CloseMenus(); } if (!_IsMenuOpen && Bot.IsCombatScreenUp(App)) { Debug.WriteLine("Menu has not been opened, opening menu"); OpenDungeons(); OpenToiDungeon(); _IsMenuOpen = true; } if (_IsAutoClearPresent()) { Click(autoClear[0].Point); } else { //Bot.PopUpKiller(App); } }
/// <summary> /// updates the party leader status by detecting the party leader crown on your characters name /// </summary> public void UpdateLeaderStatus() { if (Bot.IsCombatScreenUp(App)) { _isLeader = (PartyLeader[0].IsPresent(Screen, 2) && PartyLeader[1].IsPresent(Screen, 2)) ? true : false; MainWindow.main.UpdateLog = App.MainWindowTitle + " has been detected as party leader."; } }
/// <summary> /// detects wether you are party of a full party by looking for the 4th members HP bar /// </summary> public void UpdatePartyFullStatus() { if (Bot.IsCombatScreenUp(App)) { Click(PartyFull[1].Point); Thread.Sleep(TimeSpan.FromSeconds(.1)); _isPartyFull = (PartyFull[0].IsPresent(Screen, 2)) ? true : false; } }
private bool _IsWeeklyAvailable() { //If weeklyQuest pixels are detected this means the quest has NOT been started. //This is effective because once the quest begins the text changes from 'Available [Weekly]' to '[Weekly].' return((WeeklyAvailable[0].IsPresent(Screen, 2) && WeeklyAvailable[1].IsPresent(Screen, 2) && Bot.IsCombatScreenUp(App) || WeeklyAvailable[2].IsPresent(Screen, 2) && WeeklyAvailable[3].IsPresent(Screen, 2) && Bot.IsCombatScreenUp(App)) ? true : false); }
private bool _IsDone() { //if WeeklyDone[0] is detected and WeeklyDone[1] is not detected this means the quest HAS been completed return((WeeklyDone[0].IsPresent(Screen, 10) && !WeeklyDone[1].IsPresent(Screen, 10) && Bot.IsCombatScreenUp(App) || WeeklyDone[2].IsPresent(Screen, 10) && !WeeklyDone[3].IsPresent(Screen, 10) && Bot.IsCombatScreenUp(App) || WeeklyDone[4].IsPresent(Screen, 10) && !WeeklyDone[5].IsPresent(Screen, 10) && Bot.IsCombatScreenUp(App)) ? true : false); }
public void Start() { UpdateScreen(); User32.SetForegroundWindow(App.MainWindowHandle); Thread.Sleep(_SleepTime); if (_IsComplete()) { Complete = true; CloseMenus(); } if (!_IsMenuOpen && Bot.IsCombatScreenUp(App)) { Debug.WriteLine("Menu has not been opened, opening menu"); OpenDungeons(); ScrollToEnd(); OpenExpDungeon(); _IsMenuOpen = true; } if (enter.IsPresent(Screen, 2)) { Debug.WriteLine("Enter buton detected"); ChoseDungeon(); } if (_IsMenuOpen && Bot.IsCombatScreenUp(App) && !_IsAutoCombatEnabled) { EnableAutoCombat(); } if (Bot.IsCombatScreenUp(App) && _IsAutoCombatEnabled) { Thread.Sleep(_SleepTime); } if (_IsOkBtnPresent()) { Click(ok[0].Point); } else { //Bot.PopUpKiller(App); } }
/// <summary> /// Starts the Alter of Madness Quest logic /// </summary> public void Start() { UpdateScreen(); //updates Screen object in parent class with latest window size and x,y location. User32.SetForegroundWindow(App.MainWindowHandle); //brings window to front if (_finished == true && _riftMenuOpen == false) { if (Bot.IsCombatScreenUp(App)) { OpenRiftMenu(); } } if (_finished == true && _riftMenuOpen == true) { EnterDungeon(); } if (Bot.IsCombatScreenUp(App) && _startQuest == false && _finished == false) //look for combat screen, starts Quest once it is detected. { Thread.Sleep(TimeSpan.FromSeconds(1)); if (IsRechargeUp()) //added it here because of timing issues { Click(_closeRechargeWindow[0].Point); //closes recharge window if its present. Thread.Sleep(TimeSpan.FromSeconds(.1)); } _startQuest = true; Click(new Point(128, 370)); // clicks the quest go button _mapPoint.UpdateColor(Screen); } if (Bot.IsCombatScreenUp(App) && _startQuest == true && _finished == false) { if (TimeSpan.FromMilliseconds(Timer.ElapsedMilliseconds) > TimeSpan.FromSeconds(15)) { //checks if there has been any map movement in the last 15 seconds if (_mapPoint.IsPresent(Screen, 0)) { //resets quest status by clicking on the auto combat button 3 times //then changes _startQuest to false so i will start the quest again. Click(new Point(876, 684)); Thread.Sleep(TimeSpan.FromSeconds(.1)); Click(new Point(876, 684)); Thread.Sleep(TimeSpan.FromSeconds(.1)); Click(new Point(876, 684)); Thread.Sleep(TimeSpan.FromSeconds(.1)); _startQuest = false; } _mapPoint.UpdateColor(Screen); } } if (NeedRevived()) { Click(SpotRevive[0].Point); _startQuest = false; } if (IsGadgetUp()) { Click(_closeGadgetWindow[0].Point); Thread.Sleep(TimeSpan.FromSeconds(.1)); } if (IsRechargeUp()) { Click(_closeRechargeWindow[0].Point);//closes recharge window if its present Thread.Sleep(TimeSpan.FromSeconds(.1)); } if (_partyAccept[0].IsPresent(Screen, 2) && _partyAccept[1].IsPresent(Screen, 2)) { Click(PartyAccept[0].Point); Thread.Sleep(TimeSpan.FromSeconds(.1)); } if (IsFinished()) { DoAgain(); } Helper.Start(); }