how to get some of the variables from the warehouse or from a manager?
I need the stock limit / can sell / can buy / for each ware, with which the station can operate.
...
1. to get all tradewares i use:
this.station.tradewares.list
2. to get exact cargo wares amount i use:
this.station.cargo.{$current_ware}.count
3. how to get 'can sell' ?
4. how to get 'can buy' ?
5. how to get 'stock limit' for current ware wia xml?
(trying GetWareProductionLimit(menu.object, ware)
example:
Code: Select all
function menu.onShowMenu()
menu.object = menu.param[3]
menu.tradewares = menu.param[4]
menu.returnsection = menu.param[6]
for i=1, #menu.tradewares do
local ware = menu.tradewares[i]
table.insert(menu.stocklevel[i], GetWareProductionLimit(menu.object, ware))
end
Helper.closeMenuForSection(menu, false, menu.returnsection, { 0, 0, menu.object, menu.stocklevel, true })
menu.cleanup()
end
Code: Select all
<open_conversation_menu menu="TradeWaresGetStockLevel" param="[0,0,event.param2.{1},$tradewares,'gAMB_CloseConvo','gAMB_SelectGetStockLevelDone1']"/>