According to what I understood from the conversation, using the framelock would be the safe way to execute multiple LUA asap is that right?
PHP:
using (StyxWoW.Memory.AcquireFrame())
{
int total = BuyItemCount < item.Quantity ? 1 : BuyItemCount % item.Quantity == 0 ? BuyItemCount / item.Quantity : (int)Math.Round((decimal)(BuyItemCount / item.Quantity));
for (int i = total; i > 0; i--)
{
Lua.DoString(string.Format("RunMacroText(\"/script BuyMerchantItem({0},{1})\")", item.Index, item.Quantity), 0);
}
}
If that is right, what would be the correct way to run the above? I mean its interacting with a in game merchant window to buy items and I would think that the above way would simple smash the game with consecutive buy requests without respecting the game limits is that right?
Given that I could simple run that without the frame lock and the API would take care of handling it by it self applying the locks where needed? Or do I still need to lock myself and base the amount of buy on frames available + interval between running it etc?
Keep in mind this NPC does not sell the total amount in 1 command you need to keep interacting.
So perhaps:
PHP:
using (StyxWoW.Memory.AcquireFrame())
{
int total = BuyItemCount < item.Quantity ? 1 : BuyItemCount % item.Quantity == 0 ? BuyItemCount / item.Quantity : (int)Math.Round((decimal)(BuyItemCount / item.Quantity));
for (int i = total; i > 0; i--)
{
Lua.DoString(string.Format("RunMacroText(\"/script BuyMerchantItem({0},{1})\")", item.Index, item.Quantity), 0);
Thread.Sleep(1000);
}
}