I won't back to old version of code (change was do 1 year ago).
Current code:
public static void BuyItem(string name, int number)
{
try
{
Lua.LuaDoString($@"
local n = '{name.Replace("'", @"\'")}';
local q = {number};
for i=1,100 do
local name, _, _, quantity = GetMerchantItemInfo(i)
if name and n==name then
if q > quantity then
q = quantity
end
BuyMerchantItem(i,q)
end
end");
}
catch (Exception e)
{
Logging.WriteError("BuyItem(string name, int number): " + e);
}
}
to get old code remove:
if q > quantity then
q = quantity
end