/// <summary> /// Find the in-game screen we're on. /// </summary> /// <param name="device"></param> /// <returns></returns> private BotState GetCurrentBotState(DeviceData device) { // Check if in Main screen if (!ADBCommandService.IsL2RRunning(device)) { return(BotState.L2R_DEAD); } else if (GStateInGameMagMainScreen.IsState(device, _data) || GStateInGameMainScreen.IsState(device, _data)) { if (RunElite) { return(BotState.GOTO_ELITE); } return(BotState.MAIN_INGAME_SCREEN); } //if (EliteTransition[EliteTransition.Count - 1].IsState(device)) //{ // if (RunElite) // { // return BotState.RUN_ELITE; // } //} return(BotState.L2R_DEAD); }
public override bool Run(DeviceData device) { ushort maxWait = 60; while (maxWait > 0) { Console.WriteLine("State: " + GetType() + " " + maxWait); if (IsState(device)) { Thread.Sleep(3000); ushort.TryParse(_data["macros:weekly_rewards_menu_exit:x"], out ushort x); ushort.TryParse(_data["macros:weekly_rewards_menu_exit:y"], out ushort y); ADBCommandService.SendTripleClick(device, x, y); Thread.Sleep(3000); return(true); } else if (GStateInGameMagMainScreen.IsState(device, _data) || GStateInGameMainScreen.IsState(device, _data)) { Thread.Sleep(3000); return(true); } --maxWait; } return(true); }
public override bool IsState(DeviceData device) { if (ADBCommandService.CheckPixel(device, Sig.X, Sig.Y, Sig.Color)) { return(true); } return(GStateInGameMagMainScreen.IsState(device, _data) || GStateInGameMainScreen.IsState(device, _data)); }
public override bool Run(DeviceData device) { ushort maxTries = 6; while (maxTries > 0) { ushort.TryParse(_data["macros:map:x"], out ushort xMap); ushort.TryParse(_data["macros:map:y"], out ushort yMap); ADBCommandService.SendTripleClick(device, xMap, yMap); Thread.Sleep(5000); ushort.TryParse(_data["macros:map_portal_button:x"], out ushort xMapPortal); ushort.TryParse(_data["macros:map_portal_button:y"], out ushort yMapPortal); ADBCommandService.SendTripleClick(device, xMapPortal, yMapPortal); Thread.Sleep(2000); ushort.TryParse(_data["macros:goto_mag_button:x"], out ushort xGotoMag); ushort.TryParse(_data["macros:goto_mag_button:y"], out ushort yGotoMag); ADBCommandService.SendTripleClick(device, xGotoMag, yGotoMag); Thread.Sleep(2000); ushort.TryParse(_data["macros:enter_mag_button:x"], out ushort xEnterMag); ushort.TryParse(_data["macros:enter_mag_button:y"], out ushort yEnterMag); ADBCommandService.SendTripleClick(device, xEnterMag, yEnterMag); // Maybe we can wait for isstate here Thread.Sleep(10000); if (GStateInGameMagMainScreen.IsState(device, _data) || GStateInGameMainScreen.IsState(device, _data)) { ushort.TryParse(_data["macros:exit_instance_button:x"], out ushort xExitMag); ushort.TryParse(_data["macros:exit_instance_button:y"], out ushort yExitMag); ADBCommandService.SendTripleClick(device, xExitMag, yExitMag); Thread.Sleep(2000); return(true); } else { --maxTries; } } return(false); }
public override bool IsStartState(DeviceData device) { return(GStateInGameMagMainScreen.IsState(device, _data) || GStateInGameMainScreen.IsState(device, _data)); }