示例#1
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());
                }
            }
        }
示例#2
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);
     }
 }