Module:Sandbox/User:Artoire/1: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
mNo edit summary |
mNo edit summary |
||
Line 319: | Line 319: | ||
local cost = needed_ores * lookup_price(ingot.ore)[buying_ores and 'buy' or 'sell'] |
local cost = needed_ores * lookup_price(ingot.ore)[buying_ores and 'buy' or 'sell'] |
||
local dbg = { args = args, needed_ores = needed_ores, lookup_ore = lookup_price(ingot.ore) } |
|||
if chopping_logs then |
if chopping_logs then |
||
if needed_logs then |
if needed_logs then |
||
dbg.needed_logs = needed_logs |
|||
dbg.lookup_chop_log = lookup_price(pole_info.log) |
|||
cost = cost + needed_logs * lookup_price(pole_info.log).sell |
cost = cost + needed_logs * lookup_price(pole_info.log).sell |
||
end |
end |
||
elseif buying_logs then |
elseif buying_logs then |
||
if needed_logs then |
if needed_logs then |
||
dbg.needed_logs = needed_logs |
|||
dbg.lookup_buy_log = lookup_price(pole_info.log) |
|||
cost = cost + needed_logs * lookup_price(pole_info.log).buy |
cost = cost + needed_logs * lookup_price(pole_info.log).buy |
||
end |
end |
||
else |
else |
||
if weapon.pole then |
if weapon.pole then |
||
j.needed_poles = needed_poles |
|||
j.lookup_buy_poles = lookup_price(weapon.pole.name) |
|||
cost = cost + needed_poles * lookup_price(weapon.pole.name).buy |
cost = cost + needed_poles * lookup_price(weapon.pole.name).buy |
||
end |
end |
||
end |
end |
||
if args.debug then |
|||
⚫ | |||
j.cost = cost |
|||
row |
|||
:td{ mw.text.jsonEncode(j), attr = { colspan = "10" } } |
|||
else |
|||
⚫ | |||
end |
|||
end |
end |
||
end |
end |