Module:Sandbox/User:Artoire/1: Difference between revisions
m
no edit summary
mNo edit summary |
mNo edit summary |
||
Line 4:
target_xp = 37,
ingot = 'Maloic Adathril Ingot',
ore_buy = 'true',
pole_buy = 'none', -- 'none'/'logs'/'pole'
})
]]
Line 10 ⟶ 12:
require('Module:Mw.html extension')
local xp = require('Module:Experience')
local currency = require('Module:Currency')
local lang = mw.language.getContentLanguage()
local _ingots
local function lookup_ingots()
if _ingots then
return _ingots
_ingots = {
recipes = {},
order = {}
}
for _, result in ipairs(mw.smw.ask{
'[[Uses facility::Goblin Smelter||Gnome Smelter]]',
Line 30 ⟶ 33:
result = mw.text.jsonDecode(result[1])
local ingot = result.output[1].name
xp = result.xp,
facility = result.facility,
Line 37 ⟶ 40:
level = result.level
}
table.insert(
end
return
end
local function lookup_weapons()
local ingots = lookup_ingots()
local weapons = {}
for _, result in ipairs(mw.smw.ask{
'[[Uses facility::Goblin Forge||Gnome Forge]]',
Line 93 ⟶ 94:
end
local _lookup_price_cache = {}
local function lookup_price(item)
return
end
Line 119 ⟶ 120:
end
local _lookup_pole_cache = {}
local function lookup_pole(pole)
return
end
Line 136 ⟶ 137:
end
local _lookup_ore_cache = {}
local function lookup_ore(ore)
return
end
Line 153 ⟶ 154:
end
local _lookup_log_cache = {}
local function lookup_log(log)
return
end
Line 170 ⟶ 171:
return p._main(frame:getParent().args)
end
function p._main(args)
Line 319 ⟶ 318:
local cost = needed_ores * lookup_price(ingot.ore)[buying_ores and 'buy' or 'sell']
if chopping_logs then
if needed_logs then
cost = cost + needed_logs * lookup_price(pole_info.log).sell
end
elseif buying_logs then
if needed_logs then
cost = cost + needed_logs * lookup_price(pole_info.log).buy
end
else
if weapon.pole then
cost = cost + needed_poles * lookup_price(weapon.pole.name).buy
end
end
▲ row:node(currency._cell(cost, { html = 'yes' }))
▲ end
end
end
|