View Single Post
05/06/18, 04:32 PM   #6
Lunaugh
Join Date: May 2018
Posts: 8
Alright, new question:

how should I call this function?
Do I use a while loop for the index and a 'if ~= nil' break?
what is fn?

function ZO_TradingHouse_CreateItemData(index, fn)
local icon, name, quality, stackCount, sellerName, timeRemaining, purchasePrice, currencyType = fn(index)
if(name ~= "" and stackCount > 0) then
local result =
{
slotIndex = index,
icon = icon,
name = name,
quality = quality,
stackCount = stackCount,
sellerName = sellerName,
timeRemaining = timeRemaining,
purchasePrice = purchasePrice,
currencyType = currencyType or CURT_MONEY
}

return result
end
end


this is my current attempt:
ztuffedHause = {}
eggTimer =0

while eggTimer <9999999999999999
if ZO_TradingHouse_CreateItemData(eggTimer, fn) == nil and eggTimer < 1 do
eggTimer = eggTimer+1

elseif ZO_TradingHouse_CreateItemData(eggTimer, fn) ~= nil do
table.insert (ztuffedHause, ZO_TradingHouse_CreateItemData(eggTimer, fn))
eggTimer = eggTimer+1
else break
end
end
end

Last edited by Lunaugh : 05/06/18 at 05:05 PM.
  Reply With Quote