Пример #1
0
 private void MobileGo_Shop()
 {
     Touch("모바일_상점_클릭");
     UStatus("상점메뉴 이동");
     Touch("모바일_단품_클릭");
     UStatus("단품메뉴 이동");
     status = MacroStatus.Shop;
 }
Пример #2
0
 private void MobileGo_Release()
 {
     Touch("모바일_구단관리_클릭");
     UStatus("구단관리메뉴 이동");
     Touch("모바일_팀관리_클릭");
     UStatus("팀관리메뉴 이동");
     status = MacroStatus.Release;
 }
Пример #3
0
        private void MobileGo_Scout()
        {
            Touch("모바일_상점_클릭");
            UStatus("상점메뉴 이동");
            Touch("모바일_선수영입_클릭");
            UStatus("선수영입메뉴 이동");

            status = MacroStatus.Scout;
        }
Пример #4
0
        private void MobileGo_Trade()
        {
            Touch("모바일_구단관리_클릭");
            UStatus("구단관리메뉴 이동");
            Touch("모바일_트레이드_클릭");
            UStatus("트레이드메뉴 이동");

            status = MacroStatus.Trade;
        }
Пример #5
0
        public void Pause()
        {
            if (Status == MacroStatus.Paused)
            {
                return;
            }

            PauseMacro();

            Status = MacroStatus.Paused;
            OnStatusChanged(Status);
        }
Пример #6
0
        public void Stop()
        {
            if (Status == MacroStatus.Stopped)
            {
                return;
            }

            StopMacro();

            Status = MacroStatus.Stopped;
            OnStatusChanged(Status);
        }
Пример #7
0
        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));
        }
Пример #8
0
        /// <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);
                }
            });
        }
Пример #9
0
        private void MobileGo_TradeMarket()
        {
            Touch("모바일_이적시장_클릭");
            UStatus("이적시장메뉴 이동");
            Touch("모바일_판매_클릭");
            Thread.Sleep(3000);
            if (chkReceive.Checked)
            {
                Touch("모바일_이적시장_판매목록_클릭");
            }
            Thread.Sleep(500);

            status = MacroStatus.TradeMarket;
        }
Пример #10
0
        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;
            }
        }
Пример #11
0
        public void Start()
        {
            if (Status == MacroStatus.Running)
            {
                return;
            }

            SaveKnownState();

            if (Status == MacroStatus.Paused)
            {
                ResumeMacro();
            }
            else
            {
                StartMacro();
            }

            Status = MacroStatus.Running;
            OnStatusChanged(Status);
        }
Пример #12
0
        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;
        }
Пример #13
0
        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();
            }
        }
Пример #14
0
        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;
              }
        }
Пример #15
0
        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));
        }
Пример #16
0
        public void Pause()
        {
            if (Status == MacroStatus.Paused)
            return;

              PauseMacro();

              Status = MacroStatus.Paused;
              OnStatusChanged(Status);
        }
Пример #17
0
        public void Stop()
        {
            if (Status == MacroStatus.Stopped)
            return;

              StopMacro();

              Status = MacroStatus.Stopped;
              OnStatusChanged(Status);
        }
Пример #18
0
 public MacroStatusEventArgs(MacroStatus status)
 {
     this.status = status;
 }
Пример #19
0
 public MacroStatusEventArgs(MacroStatus status)
 {
     this.status = status;
 }
Пример #20
0
        public void Start()
        {
            if (Status == MacroStatus.Running)
            return;

              SaveKnownState();

              if (Status == MacroStatus.Paused)
            ResumeMacro();
              else
            StartMacro();

              Status = MacroStatus.Running;
              OnStatusChanged(Status);
        }