Example #1
0
        public override void DoWork()
        {
            FlyingEngine.Navigator.Stop();
            if (ApproachPosFlying.Approach(_npc.Location, 12))
            {
                MoveHelper.MoveToLoc(_npc.Location, 3);
                //VendorManager.DoSell(_npc);

                while (!ObjectManager.MyPlayer.Target.Name.Equals(_npc.Name))
                {
                    // 目标选择NPC
                    KeyHelper.SendLuaOverChat("/target " + _npc.Name);
                    Thread.Sleep(500);
                }

                _npc.Interact();
                Thread.Sleep(500);

                // 卖东西
                SpyFrame.ExecSimpleLua("/script SellJunk:Sell()");
                Thread.Sleep(500);

                // 修理
                SpyFrame.ExecSimpleLua("/click MerchantRepairAllButton");
            }
            FlyingBlackList.Blacklist(_npc, 200, true);
            Logging.Write("[Vendor]Vendor done");
        }
Example #2
0
 public override void DoWork()
 {
     FlyingEngine.Navigator.Stop();
     if (ApproachPosFlying.Approach(_npc.Location, 12))
     {
         MoveHelper.MoveToLoc(_npc.Location, 5);
         VendorManager.DoSell(_npc);
     }
     FlyingBlackList.Blacklist(_npc, 200, true);
     Logging.Write("[Vendor]Vendor done");
 }
Example #3
0
 public override void DoWork()
 {
     Logging.Write("Found a mailbox, lets do something");
     FlyingEngine.Navigator.Stop();
     if (ApproachPosFlying.Approach(_mailbox.Location, 12))
     {
         MoveHelper.MoveToLoc(_mailbox.Location, 5);
         MailManager.DoMail();
     }
     ToTown.ToTownDoMail = true;
     _mailTimeout.Reset();
 }
Example #4
0
        private static void TrySpiritRess()
        {
            PUnit spirit = FindSpiritHealer();

            if (spirit == null)
            {
                Thread.Sleep(8000);
                spirit = FindSpiritHealer();
                if (spirit == null)
                {
                    LazyHelpers.StopAll("Could not find spirit healer");
                }
            }
            ApproachPosFlying.Approach(spirit.Location, 15);
            spirit.Face();
            DoSpiritRess(spirit);
        }
Example #5
0
        public override void DoWork()
        {
            Logging.Write("找到一个邮箱,整点什么。。。。。");
            FlyingEngine.Navigator.Stop();
            if (ApproachPosFlying.Approach(_mailbox.Location, 12))
            {
                MoveHelper.MoveToLoc(_mailbox.Location, 5);
                //MailManager.DoMail();

                // 改成使用插件邮寄
                if (MailManager.TargetMailBox())
                {
                    if (SpyFrame.initme())
                    {
                        DBLogger logger = new DBLogger("挖矿时的邮寄");
                        SpyTradeSkill.SendMain(logger, true);
                    }
                }
            }
            ToTown.ToTownDoMail = true;
            _mailTimeout.Reset();
        }
Example #6
0
        public override void DoWork()
        {
            FlyingEngine.Navigator.Stop();
            if (FlyingSettings.StopOnDeath)
            {
                LazyHelpers.StopAll("We died");
            }
            Logging.Write("Going to ress");
            FlyingEngine.UpdateStats(0, 0, 1);
            Location pos         = ObjectManager.MyPlayer.Location;
            Frame    frameByName = InterfaceHelper.GetFrameByName("StaticPopup1Button1");

            try
            {
                frameByName.LeftClick();
                Thread.Sleep(2000);
                frameByName.LeftClick();
                Thread.Sleep(3000);
                var maxTimeout = new Ticker(8000);
                if (!ObjectManager.MyPlayer.IsGhost && !maxTimeout.IsReady)
                {
                    frameByName.LeftClick();
                    Thread.Sleep(5000);
                }
            }
            catch
            {
            }
            if (FlyingSettings.FindCorpse && Mount.IsMounted())
            {
                KeyHelper.PressKey("Space");
                Thread.Sleep(20000);
                KeyHelper.ReleaseKey("Space");
                var toLong = new Ticker(150000);
                FlyingEngine.Navigator.SetDestination(new Location(pos.X, pos.Y, ObjectManager.MyPlayer.Location.Z));
                FlyingEngine.Navigator.Start();
                while (ObjectManager.MyPlayer.IsGhost)
                {
                    if (pos.DistanceToSelf2D < 20)
                    {
                        FlyingEngine.Navigator.Stop();
                        Logging.Write("Looks like we found our corpse");
                        DescentToCorpse();
                        Thread.Sleep(2000);
                        ApproachPosFlying.Approach(pos, 3);
                        frameByName.LeftClick();
                        var timeout = new Ticker(5000);
                        while (ObjectManager.MyPlayer.IsGhost && !timeout.IsReady)
                        {
                            Thread.Sleep(10);
                        }
                        break;
                    }
                    if (!Mount.IsMounted() && ObjectManager.MyPlayer.IsGhost)
                    {
                        Logging.Write("We are not mounted, cannot find corpse");
                        toLong.ForceReady();
                        break;
                    }
                    if (toLong.IsReady && ObjectManager.MyPlayer.IsGhost)
                    {
                        Logging.Write("We never found our corpse :(");
                        toLong.ForceReady();
                        break;
                    }
                }
            }
            else
            {
                TrySpiritRess();
            }
            FlyingEngine.Navigator.Stop();
            MoveHelper.ReleaseKeys();
            Thread.Sleep(1500);
            if (!ObjectManager.MyPlayer.IsAlive)
            {
                if (FlyingSettings.FindCorpse)
                {
                    Logging.Write("Could not find the corpse... trying to make it anyway");
                    InterfaceHelper.GetFrameByName("GhostFrame").LeftClick();
                    Thread.Sleep(5000);
                    TrySpiritRess();
                    if (!ObjectManager.MyPlayer.IsAlive)
                    {
                        LazyHelpers.StopAll("Could not ress :(");
                    }
                }
                else
                {
                    LazyHelpers.StopAll("Could not ress :(");
                }
            }
            Logging.Write("Ress worked :)");
            FlyingEngine.Navigator.Stop();
            if (ObjectManager.MyPlayer.HasBuff(15007) && FlyingSettings.WaitForRessSick)
            {
                Logging.Write("Waiting for ress sickness");
                Mount.MountUp();
                MoveHelper.Jump(6000);
                if (!Mount.IsMounted())
                {
                    Mount.MountUp();
                    MoveHelper.Jump(6000);
                }
                while (ObjectManager.MyPlayer.HasBuff(15007))
                {
                    Thread.Sleep(5000);
                }
            }
            else
            {
                CombatHandler.RunningAction();
            }
        }