Exemplo n.º 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");
        }
Exemplo n.º 2
0
        public static void DoSell(PUnit vendor)
        {
            try
            {
                ProtectedList.Load();
                MailList.Load();
                MoveHelper.MoveToUnit(vendor, 3);
                vendor.Location.Face();
                vendor.Interact(false);
                Thread.Sleep(1000);
                if (ObjectManager.MyPlayer.Target != vendor)
                {
                    vendor.Location.Face();
                    vendor.Interact(false);
                    Thread.Sleep(1000);
                }

                //MouseHelper.Hook();
                //MailManager.OpenAllBags();
                if (LazySettings.ShouldVendor)
                {
                    Logging.Write("[Vendor]Going to sell items");
                    //Sell();
                }
                if (LazySettings.ShouldRepair)
                {
                    Repair();
                }
            } finally
            {
                MailManager.CloseAllBags();
                MouseHelper.ReleaseMouse();
                if (SellFinished != null)
                {
                    SellFinished("VendorEngine", new EventArgs());
                }
            }
        }
Exemplo n.º 3
0
        private void DoTrain()
        {
            int clickTimes = GrindingShouldTrain.TrainCount();

            MoveHelper.MoveToUnit(_npc, 3);
            _npc.Location.Face();
            _npc.Interact(false);
            Thread.Sleep(1200);
            Logging.Write("Going to train: " + clickTimes + " new skill(s)");
            for (int i = 0; i <= clickTimes; i++)
            {
                try
                {
                    InterfaceHelper.GetFrameByName("ClassTrainerTrainButton");
                    Thread.Sleep(1000);
                }
                catch (Exception e)
                {
                    Logging.Write("Error when clicking train button: " + e);
                }
            }
        }
Exemplo n.º 4
0
        public static void DoSell(PUnit vendor)
        {
            try
            {
                ProtectedList.Load();
                MailList.Load();
                MoveHelper.MoveToUnit(vendor, 3.0);
                vendor.Location.Face();
                int num = 1;
Label_0027:
                vendor.Interact(false);
                Thread.Sleep(0x3e8);
                if (InterfaceHelper.GetFrameByName("GossipFrameCloseButton").IsVisible)
                {
                    if (InterfaceHelper.GetFrameByName("GossipTitleButton" + num).IsVisible)
                    {
                        Thread.Sleep(0x5dc);
                        InterfaceHelper.GetFrameByName("GossipTitleButton" + num).LeftClick();
                        Thread.Sleep(0x5dc);
                        if (InterfaceHelper.GetFrameByName("MerchantFrame").IsVisible || (num >= 6))
                        {
                            goto Label_00D2;
                        }
                        KeyHelper.SendKey("ESC");
                        num++;
                    }
                    else
                    {
                        KeyHelper.SendKey("ESC");
                        num++;
                    }
                    goto Label_0027;
                }
Label_00D2:
                if (LazyLib.Wow.ObjectManager.MyPlayer.Target != vendor)
                {
                    vendor.Location.Face();
                    vendor.Interact(false);
                    Thread.Sleep(0x3e8);
                }
                MouseHelper.Hook();
                MailManager.OpenAllBags();
                if (LazySettings.ShouldVendor)
                {
                    Logging.Write("[Vendor]Going to sell items", new object[0]);
                    Sell();
                }
                if (LazySettings.ShouldRepair)
                {
                    Repair();
                }
            }
            finally
            {
                MailManager.CloseAllBags();
                MouseHelper.ReleaseMouse();
                if (SellFinished != null)
                {
                    SellFinished("VendorEngine", new EventArgs());
                }
            }
        }
Exemplo n.º 5
0
 public static void DoWork(PUnit unit)
 {
     MoveHelper.ReleaseKeys();
     if (!unit.IsLootable)
     {
         return;
     }
     Logging.Write("Looting: " + unit.Name);
     if (unit.DistanceToSelf > 5)
     {
         MoveHelper.MoveToLoc(unit.Location, 4, false, true);
     }
     if (ObjectManager.ShouldDefend)
     {
         Logging.Write("Skipping loot, we got into combat");
         return;
     }
     Thread.Sleep(200);
     if (ObjectManager.MyPlayer.HasLivePet)
     {
         Thread.Sleep(700);
     }
     if (ObjectManager.MyPlayer.Target != unit)
     {
         unit.Interact(false);
     }
     else
     {
         KeyHelper.SendKey("InteractTarget");
     }
     if (ObjectManager.ShouldDefend)
     {
         return;
     }
     TimeOut.Reset();
     while (!ObjectManager.MyPlayer.LootWinOpen && !TimeOut.IsReady)
     {
         Thread.Sleep(100);
     }
     TimeOut.Reset();
     if (GrindingSettings.Skin || GrindingSettings.WaitForLoot)
     {
         while (ObjectManager.MyPlayer.LootWinOpen && !TimeOut.IsReady)
         {
             Thread.Sleep(100);
         }
         Thread.Sleep(1300);
     }
     else
     {
         Thread.Sleep(200);
     }
     GrindingEngine.UpdateStats(1, 0, 0);
     PBlackList.Blacklist(unit, 300, false);
     if (unit.IsSkinnable && GrindingSettings.Skin)
     {
         Logging.Write("Skinning");
         KeyHelper.SendKey("TargetLastTarget");
         Thread.Sleep(1000);
         if (!ObjectManager.MyPlayer.Target.IsValid)
         {
             unit.Interact(false);
         }
         else
         {
             KeyHelper.SendKey("InteractTarget");
         }
         TimeOut.Reset();
         while (!ObjectManager.MyPlayer.LootWinOpen && !TimeOut.IsReady)
         {
             Thread.Sleep(100);
         }
         if (GrindingSettings.WaitForLoot)
         {
             Thread.Sleep(500);
         }
         GrindingEngine.UpdateStats(1, 0, 0);
     }
 }
Exemplo n.º 6
0
 public static void DoWork(PUnit unit)
 {
     MoveHelper.ReleaseKeys();
     if (unit.IsLootable)
     {
         Logging.Write("Looting: " + unit.Name, new object[0]);
         if (unit.DistanceToSelf > 5.0)
         {
             MoveHelper.MoveToLoc(unit.Location, 4.0, false, true);
         }
         if (LazyLib.Wow.ObjectManager.ShouldDefend)
         {
             Logging.Write("Skipping loot, we got into combat", new object[0]);
             return;
         }
         Thread.Sleep(200);
         if (LazyLib.Wow.ObjectManager.MyPlayer.HasLivePet)
         {
             Thread.Sleep(700);
         }
         if (LazyLib.Wow.ObjectManager.MyPlayer.Target != unit)
         {
             unit.Interact(false);
         }
         else
         {
             KeyHelper.SendKey("InteractTarget");
         }
         if (LazyLib.Wow.ObjectManager.ShouldDefend)
         {
             return;
         }
         TimeOut.Reset();
         while (!LazyLib.Wow.ObjectManager.MyPlayer.LootWinOpen && !TimeOut.IsReady)
         {
             Thread.Sleep(100);
         }
         if (GrindingSettings.WaitForLoot)
         {
             Latency.Sleep(500);
         }
         GrindingEngine.UpdateStats(1, 0, 0);
         if (!GrindingSettings.Skin)
         {
             PBlackList.Blacklist(unit, 300, false);
         }
     }
     if ((unit.IsSkinnable && GrindingSettings.Skin) && (unit.GetSkinnableType() == Constants.SkinnableType.Skining))
     {
         Logging.Write("Skinning: " + unit.Name, new object[0]);
         if (unit.DistanceToSelf > 5.0)
         {
             MoveHelper.MoveToLoc(unit.Location, 4.0, false, true);
         }
         KeyHelper.SendKey("TargetLastTarget");
         Thread.Sleep(0x3e8);
         if (!LazyLib.Wow.ObjectManager.MyPlayer.Target.IsValid)
         {
             unit.Interact(false);
         }
         else
         {
             KeyHelper.SendKey("InteractTarget");
         }
         TimeOut.Reset();
         while (!LazyLib.Wow.ObjectManager.MyPlayer.LootWinOpen && !TimeOut.IsReady)
         {
             Thread.Sleep(100);
         }
         if (GrindingSettings.WaitForLoot)
         {
             Latency.Sleep(500);
         }
         GrindingEngine.UpdateStats(1, 0, 0);
         PBlackList.Blacklist(unit, 300, false);
     }
 }