Hello,
Your code can't work it doesn't have the good structure.
Here is some code with a correct structure (although I don't think it works, it would need to be debugged):
using System.Collections.Generic;
using System.Threading;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using wManager.Wow.Enums;
public class Main : wManager.Plugin.IPlugin
{
public void Initialize()
{
EventsLuaWithArgs.OnEventsLuaStringWithArgs += OnAuctionHouseShow;
}
private void OnAuctionHouseShow(string eventName, List<string> args)
{
if (eventName == "AUCTION_HOUSE_SHOW")
{
Logging.WriteDebug("Auction House is open");
Thread.Sleep(5000);
SellGreenItems();
}
}
public void SellGreenItems()
{
foreach (WoWItem item in Bag.GetBagItem())
{
if (item.GetItemInfo.ItemRarity == (int)WoWItemQuality.Uncommon)
{
Logging.WriteDebug($"Selling {item.Name}");
Bag.PickupContainerItem(item.Name);
Thread.Sleep(1500);
AuctionHelpers.StartAuction(50000, 50000, AuctionHelpers.Duration._12H, 1, 1); //Lua.LuaDoString($@"StartAuction(50000, 50000, 12, 1);");
}
}
}
public void Dispose()
{
EventsLuaWithArgs.OnEventsLuaStringWithArgs -= OnAuctionHouseShow;
}
public void Settings()
{
}
}