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()); } } }
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()); } } }
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()); } } }
private static bool ShouldSell(string sellName) { try { foreach (PItem item in Inventory.GetItemsInBags) { try { string str3; if (ItemDatabase.GetItem(item.EntryId.ToString()) == null) { continue; } string str = ItemDatabase.GetItem(item.EntryId.ToString())["item_name"].ToString(); string str2 = ItemDatabase.GetItem(item.EntryId.ToString())["item_quality"].ToString(); if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str2)) { goto Label_0185; } if ((((str != sellName) && (sellName.Replace(str, "").Length == sellName.Length)) || MailList.ShouldMail(str)) || (!ProtectedList.ShouldVendor(str) || ((str3 = str2) == null))) { continue; } if (!(str3 == "Poor")) { if (str3 == "Common") { goto Label_013D; } if (str3 == "UnCommon") { goto Label_014C; } if (str3 == "Низкий") { goto Label_015B; } if (str3 == "Обычный") { goto Label_016A; } if (str3 == "Необычный") { goto Label_0179; } continue; } if (!LazySettings.SellPoor) { continue; } return(true); Label_013D: if (!LazySettings.SellCommon) { continue; } return(true); Label_014C: if (!LazySettings.SellUncommon) { continue; } return(true); Label_015B: if (!LazySettings.SellPoor) { continue; } return(true); Label_016A: if (!LazySettings.SellCommon) { continue; } return(true); Label_0179: if (!LazySettings.SellUncommon) { continue; } return(true); Label_0185: Logging.Write(string.Format("[Vendor]Could not detect the name of: {0} is wowhead down?", item.EntryId), new object[0]); } catch (Exception exception) { Logging.Debug("Exception in ShouldSell (Loop): {0}", new object[] { exception }); } } } catch (Exception exception2) { Logging.Debug("Exception in ShouldSell: {0}", new object[] { exception2 }); } return(false); }
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()); } } }
private static bool ShouldSell(string sellName) { try { foreach (PItem item in Inventory.GetItemsInBags) { try { if (ItemDatabase.GetItem(item.EntryId.ToString()) != null) { string name = ItemDatabase.GetItem(item.EntryId.ToString())["item_name"].ToString(); string quality = ItemDatabase.GetItem(item.EntryId.ToString())["item_quality"].ToString(); if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(quality)) { if (name != sellName) { continue; } if (MailList.ShouldMail(name)) { continue; } if (ProtectedList.ShouldVendor(name)) { switch (quality) { case "Poor": if (LazySettings.SellPoor) { return(true); } break; case "Common": if (LazySettings.SellCommon) { return(true); } break; case "UnCommon": if (LazySettings.SellUncommon) { return(true); } break; } } } else { Logging.Write(string.Format("[Vendor]Could not detect the name of: {0} is wowhead down?", item.EntryId)); } } } catch (Exception e) { Logging.Debug("Exception in ShouldSell (Loop): {0}", e); } } } catch (Exception e) { Logging.Debug("Exception in ShouldSell: {0}", e); } return(false); }