Ejemplo n.º 1
0
 public static void DoSell(string unit_name)
 {
     try
     {
         ProtectedList.Load();
         MailList.Load();
         KeyHelper.ChatboxSendText("/target " + unit_name);
         Thread.Sleep(0xbb8);
         if (LazyLib.Wow.ObjectManager.MyPlayer.Target.Name != unit_name)
         {
             Logging.Write("Could not target vendor: " + unit_name, new object[0]);
         }
         else
         {
             KeyHelper.SendKey("InteractTarget");
             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());
         }
     }
 }
Ejemplo n.º 2
0
 public static void DoSell(String unit_name)
 {
     try
     {
         ProtectedList.Load();
         MailList.Load();
         //Target vendor TODO: Looking for a better solution
         LazyLib.Helpers.KeyHelper.ChatboxSendText("/target " + unit_name);
         Thread.Sleep(3000);
         if (LazyLib.Wow.ObjectManager.MyPlayer.Target.Name != unit_name)
         {
             Logging.Write("Could not target vendor: " + unit_name);
             return;
         }
         //Interact vendor
         LazyLib.Helpers.KeyHelper.SendKey("InteractTarget");
         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());
         }
     }
 }
Ejemplo n.º 3
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());
                }
            }
        }
Ejemplo 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());
                }
            }
        }