Hello, I need to sell more quickly my items from my bag at the hv the idea seemed simple to me basically if I want create a plugin to automatically sell all the green objects at 10 gold at the hv I tested this code but This doesn't work:
using System.Threading.Tasks;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using wManager.Wow.Enums;
using wManager.Events;
public class AutoSellGreenItems : wManager.Plugin.Plugin
{
public override void Initialize()
{
LuaEvents.OnEventsLuaStringWithArgs += OnAuctionHouseShow;
}
public void OnAuctionHouseShow(string eventName, List<string> args)
{
if (eventName == "AUCTION_HOUSE_SHOW")
{
Task.Run(async () => {
await Task.Delay(5000);
SellGreenItems();
});
}
}
public void SellGreenItems()
{
foreach (WoWItem item in Bag.GetBagItems())
{
if (item.Quality == WoWItemQuality.Green)
{
Lua.LuaDoString($@"
local bag = {item.BagIndex}
local slot = {item.Slot}
PickupContainerItem(bag, slot);
StartAuction(50000, 50000, 12, 1);");
}
}
}
public override void Dispose()
{
LuaEvents.OnEventsLuaStringWithArgs -= OnAuctionHouseShow;
}
}
if you could guide me on my errors I would be grateful, thank you in advance!