private void MobileGo_Shop() { Touch("모바일_상점_클릭"); UStatus("상점메뉴 이동"); Touch("모바일_단품_클릭"); UStatus("단품메뉴 이동"); status = MacroStatus.Shop; }
private void MobileGo_Release() { Touch("모바일_구단관리_클릭"); UStatus("구단관리메뉴 이동"); Touch("모바일_팀관리_클릭"); UStatus("팀관리메뉴 이동"); status = MacroStatus.Release; }
private void MobileGo_Scout() { Touch("모바일_상점_클릭"); UStatus("상점메뉴 이동"); Touch("모바일_선수영입_클릭"); UStatus("선수영입메뉴 이동"); status = MacroStatus.Scout; }
private void MobileGo_Trade() { Touch("모바일_구단관리_클릭"); UStatus("구단관리메뉴 이동"); Touch("모바일_트레이드_클릭"); UStatus("트레이드메뉴 이동"); status = MacroStatus.Trade; }
public void Pause() { if (Status == MacroStatus.Paused) { return; } PauseMacro(); Status = MacroStatus.Paused; OnStatusChanged(Status); }
public void Stop() { if (Status == MacroStatus.Stopped) { return; } StopMacro(); Status = MacroStatus.Stopped; OnStatusChanged(Status); }
protected virtual void OnStatusChanged(MacroStatus status) { if (status == MacroStatus.Idle || status == MacroStatus.Stopped) { client.Status = null; } else { client.Status = status.ToString(); } StatusChanged?.Invoke(this, new MacroStatusEventArgs(status)); }
/// <summary> /// This command aborts any executing macro and returns both its ID code and the command number currently in process. /// An exception is a System Macro that is executing with the UNKILLABLE flag set. /// A normal return code indicates the ID Code of the aborted macro as well as the command number at which execution was stopped. /// A return ID code of 00h indicates that no macro was running and an ID code with FFFFh as the CmdNum that the macro was unkillable. /// </summary> /// <param name="statusCallback">Callback used to handle the response of the SpheroDevice</param> public void AbortMacro(Action <MacroStatus> statusCallback) { CommandPacket command = new CommandPacket(0xFF, DeviceIDs.SPHERO, CommandIDs.Sphero.ABORT_MACRO, null); _connection.SendCommand(command, response => { if (statusCallback != null) { MacroStatus ms = new MacroStatus(response.Data); statusCallback(ms); } }); }
private void MobileGo_TradeMarket() { Touch("모바일_이적시장_클릭"); UStatus("이적시장메뉴 이동"); Touch("모바일_판매_클릭"); Thread.Sleep(3000); if (chkReceive.Checked) { Touch("모바일_이적시장_판매목록_클릭"); } Thread.Sleep(500); status = MacroStatus.TradeMarket; }
protected override void OnStatusChanged(MacroStatus status) { switch (status) { case MacroStatus.Running: SetPlayerStatus(this.PlayerStatus); break; case MacroStatus.Paused: SetPlayerStatus(this.PlayerStatus); client.Status = string.Format("Paused: {0}", client.Status); break; case MacroStatus.Stopped: ResetMacro(); break; } }
public void Start() { if (Status == MacroStatus.Running) { return; } SaveKnownState(); if (Status == MacroStatus.Paused) { ResumeMacro(); } else { StartMacro(); } Status = MacroStatus.Running; OnStatusChanged(Status); }
private void MobileEscape() { runFlag = true; Escape(); Escape(); Escape(); Escape(); Escape(); Bitmap big = Imaging.GetScreen(); if (ImageMatch(big, "모바일_메인화면_게임종료")) { this.Invoke(new MethodInvoker(delegate() { Touch("모바일_메인화면_게임종료취소"); Touch("모바일_메인화면_" + cboSupervisor.Text.Substring(0, 1) + "번감독선택"); status = MacroStatus.Main; errorCount = 0; })); } else if (ImageMatch(big, "모바일_메인화면_감독선택")) { this.Invoke(new MethodInvoker(delegate() { Touch("모바일_메인화면_" + cboSupervisor.Text.Substring(0, 1) + "번감독선택"); status = MacroStatus.Main; errorCount = 0; })); } big.Dispose(); big = null; System.GC.Collect(0, GCCollectionMode.Forced); System.GC.WaitForPendingFinalizers(); Thread.Sleep(10000); runFlag = false; }
void btnStart_Click(object sender, EventArgs e) { if (btnStart.Text.Equals("시작")) { if (cboADBList.SelectedIndex < 0) { return; } btnRefresh.Enabled = false; cboADBList.Enabled = false; chkReceive.Enabled = false; Imaging.GetHWND(); btnStart.Text = "중지"; mAdb.device = cboADBList.Text; //t = new Thread(Macro, Int32.MaxValue); //t.Start(); sw.Start(); timer.Start(); } else { btnRefresh.Enabled = true; cboADBList.Enabled = true; chkReceive.Enabled = true; btnStart.Text = "시작"; t.Abort(); sw.Stop(); timer.Stop(); runFlag = false; status = MacroStatus.Main; buyCount = 0; //timer.Stop(); } }
void UpdateUIForMacroStatus(MacroStatus status) { if (!CheckAccess()) { this.Dispatcher.InvokeIfRequired<MacroStatus>(UpdateUIForMacroStatus, status, DispatcherPriority.DataBind); return; } switch (status) { case MacroStatus.Running: startMacroButton.Tag = "Start Macro"; startMacroButton.IsEnabled = false; pauseMacroButton.IsEnabled = true; stopMacroButton.IsEnabled = true; break; case MacroStatus.Paused: startMacroButton.Tag = "Resume Macro"; startMacroButton.IsEnabled = true; pauseMacroButton.IsEnabled = false; stopMacroButton.IsEnabled = true; break; default: startMacroButton.Tag = "Start Macro"; startMacroButton.IsEnabled = true; pauseMacroButton.IsEnabled = false; stopMacroButton.IsEnabled = false; break; } }
protected virtual void OnStatusChanged(MacroStatus status) { if (status == MacroStatus.Idle || status == MacroStatus.Stopped) client.Status = null; else client.Status = status.ToString(); StatusChanged?.Invoke(this, new MacroStatusEventArgs(status)); }
public void Pause() { if (Status == MacroStatus.Paused) return; PauseMacro(); Status = MacroStatus.Paused; OnStatusChanged(Status); }
public void Stop() { if (Status == MacroStatus.Stopped) return; StopMacro(); Status = MacroStatus.Stopped; OnStatusChanged(Status); }
public MacroStatusEventArgs(MacroStatus status) { this.status = status; }
public void Start() { if (Status == MacroStatus.Running) return; SaveKnownState(); if (Status == MacroStatus.Paused) ResumeMacro(); else StartMacro(); Status = MacroStatus.Running; OnStatusChanged(Status); }