Exemplo n.º 1
0
        /// <summary>
        /// 启动自动推兔
        /// </summary>
        private async void AutoPush()
        {
            IntPtr Han = GetWebHandle(mainWeb.Handle);

            MiscHelper.AddLog("开始推兔!", MiscHelper.LogType.System);
            Nodes Node = new Nodes();

            Node.ScInitialize(Han);

            Thread PushThread = new Thread(Node.Start);

            PushThread.Start();
            while (PushThread.IsAlive == true)
            {
                await Task.Delay(1000);

                if (PushTimes.Value() == 0)
                {
                    PushThread.Abort();
                }
                if (DataUtil.Game.isOnline == false &&
                    DataUtil.Config.sysConfig.gameRestart == true)
                {
                    PushThread.Abort();
                    Refresh();
                    Helpers.Color Col = Helpers.Color.Instance;
                    Mouse         Mou = Mouse.Instance;
                    while (Col.Check(437, 177, 211, 209, 205) == false)
                    {
                        Mou.Click(800, 200);
                        await Task.Delay(1000);
                    }
                    AutoPush();
                }
            }
        }
Exemplo n.º 2
0
        //Main
        /// <summary>
        /// 开始脚本与初始化数据
        /// </summary>
        public void Start()
        {
            Random rnd = new Random();

            while (PushTimes.Value() > 0 &&
                   DataUtil.Config.sysConfig.autoType == 0)
            {
                if (DataUtil.Config.sysConfig.actionPrep == true &&
                    Col.Check(540, 75, 55, 47, 44) == true)
                {
                    ScActionPrep();
                }

                //随即延迟
                delay  = rnd.Next(DataUtil.Config.sysConfig.delayTime, DataUtil.Config.sysConfig.delayTime * 2);
                sblock = DataUtil.Config.sysConfig.specialBlock;

                while (ScSelect() == false)
                {
                    Thread.Sleep(delay);
                }
                ScDepart();
                while (ScCombat() == false)
                {
                    Thread.Sleep(delay);
                }

                CoHomeReturn();

                PushTimes.Decrease();

                if (Col.Check(625, 70, 243, 212, 0) == true &&
                    DataUtil.Config.sysConfig.raidOther == true)
                {
                    CoHomeReturn();
                    ScGranRaid();
                }

                if (DataUtil.Config.sysConfig.sellTrue == true)
                {
                    CoHomeReturn();
                    ScSell();
                }

                if (DataUtil.Config.sysConfig.exploreTrue == true)
                {
                    CoHomeReturn();
                    if (Col.Check(258, 163, 99, 99, 99) == false &&
                        (Col.Check(520, 75, 50, 41, 37) == true ||
                         Col.Check(520, 77, 83, 81, 76) == true))
                    {
                        ScExplore();
                    }
                }

                if (DataUtil.Config.sysConfig.gardenTrue == true)
                {
                    CoHomeReturn();
                    if (DataUtil.Game.player.plantTime < DataUtil.Game.serverTime)
                    {
                        ScGarden();
                    }
                }
            }

            while (PushTimes.Value() > 0 &&
                   DataUtil.Config.sysConfig.autoType == 1)
            {
                //随机延迟
                delay = rnd.Next(DataUtil.Config.sysConfig.delayTime, DataUtil.Config.sysConfig.delayTime * 2);
                Thread.Sleep(delay);

                if (Col.Check(625, 70, 243, 212, 0) == true &&
                    DataUtil.Config.sysConfig.raidOther == true)
                {
                    CoHomeReturn();
                    ScGranRaid();
                }

                if (DataUtil.Config.sysConfig.exploreTrue == true)
                {
                    CoHomeReturn();
                    if (Col.Check(258, 163, 99, 99, 99) == false &&
                        (Col.Check(520, 75, 50, 41, 37) == true ||
                         Col.Check(520, 77, 83, 81, 76) == true))
                    {
                        ScExplore();
                    }
                }

                if (DataUtil.Config.sysConfig.gardenTrue == true)
                {
                    CoHomeReturn();
                    if (DataUtil.Game.player.plantTime < DataUtil.Game.serverTime)
                    {
                        ScGarden();
                    }
                }

                CoHomeReturn();
                Thread.Sleep(delay);
            }

            return;
        }