Module:Sandbox/User:Artoire/1: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 140:
local function _lookup_log_uncached(log)
local data = mw.smw.ask{
('[[%s]]'):format(orelog),
['?Profession Level A'] = '',
mainlabel = '-'
Line 239:
:tr()
:td{
'Missing XP for smelting [[' .. ingot.ingot .. ']]; Please [' .. tostring(mw.uri.fullUrl(ingot.ingot, 'action=edit&section=1')) .. ' edit the page] to add the experience earned (after |exp =)',
attr = { colspan = colspan }
}
Line 249:
:tr()
:td{
'Missing XP for creating [[' .. weapon.name .. ']]; Please ['.. tostring(mw.uri.fullUrl(weapon.name, 'action=edit&section=1')) .. ' edit the page] to add the experience earned (after |exp =)',
attr = { colspan = colspan }
}
:done()
breakelse
local xp_per = weapon.xp + ingot.xp * weapon.ingot.quantity
end
local needed = math.ceil(remaining_xp / xp_per)
local xp_per = weapon.xp + ingot.xp * weapon.ingot.quantity
local needed = math.ceil(remaining_xp / xp_per)
 
local needed_ores = needed * weapon.ingot.quantity
local row = tbl
:tag('tr')
:td(lookup_ore(ingot.ore).level):done()
:td{ needed_ores .. '×', css = { ['border-right'] = '0', ['padding-right'] = '0', ['text-align'] = 'right', ['data-sort-value'] = needed_ores } }:done()
:td{ ('[[File:%s.png|link=%s|30px]]'):format(ingot.ore, ingot.ore), css = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-image no-border' }:done()
:td{ '[[' .. ingot.ore .. ']]', addClass = 'plinkt-link no-border' }:done()
:td{ ('[[File:%s.png|link=%s|30px]]'):format(ingot.ingot, ingot.ingot), css = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-image no-border', ['data-sort-value'] = needed_ores }:done()
:td{ '[[' .. ingot.ingot .. ']]', addClass = 'plinkt-link no-border' }:done()
 
local pole_info
local needed_logs, needed_poles
 
if weapon.pole then
needed_poles = needed * weapon.pole.quantity
if chopping_logs then
pole_info = lookup_pole(weapon.pole.name)
needed_logs = math.ceil(needed_poles / 2)
row
:td(lookup_log(pole_info.log).level):done()
:td{ neededneeded_logs .. '×', css = { ['border-right'] = '0', ['padding-right'] = '0', ['text-align'] = 'right' }, attr = { ['data-sort-value'] = neededneeded_logs } }:done()
:td{ ('[[File:%s.png|link=%s|30px]]'):format(weaponpole_info.namelog, weaponpole.namelog), css = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-image no-border' }:done()
:td{ '[[' .. pole_info.log .. ']]', addClass = 'plinkt-link no-border' }:done()
end
if chopping_logs or buying_logs then
pole_info = pole_info or lookup_pole(weapon.pole.name)
row
:td(pole_info.level):done()
end
 
if weapon.pole then
needed_poles = needed * weapon.pole.quantity
if chopping_logs then
pole_info = lookup_pole(weapon.pole.name)
needed_logs = math.ceil(needed_poles / 2)
row
:td{ needed_poles .. '×', css = { ['border-right'] = '0', ['padding-right'] = '0', ['text-align'] = 'right' }, attr = { ['data-sort-value'] = needed_poles } }:done()
:td(lookup_log(pole_info.log).level):done()
:td{ needed_logs ('[[File:%s.png|link=%s|30px]]'):format(weapon.pole.name, '×'weapon.pole.name), css = { ['border-rightleft'] = '0', ['padding-rightleft'] = '0', ['text-align'] = 'right' }, attraddClass = { ['dataplinkt-sortimage no-valueborder'] = needed_logs } }:done()
:td{ ('[[File:%s' .png|link=%s|30px]]'):format(pole_info.log, weapon.pole.log),name css.. = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-imagelink no-border' }:done()
else
:td{ '[[' .. pole_info.log .. ']]', addClass = 'plinkt-link no-border' }:done()
if chopping_logs then
end
row
if chopping_logs or buying_logs then
:na()
pole_info = pole_info or lookup_pole(weapon.pole.name)
:td{ '<small>N/A</small>', addClass = 'table-na', attr = { ['data-sort-value'] = '0', colspan = '3' } }:done()
end
if chopping_logs or buying_logs then
row
:na()
end
row
:td{ '<small>N/A</small>', addClass = 'table-na', attr = { ['data-sort-value'] = '0', colspan = '3' } }:done()
:td(pole_info.level):done()
end
 
row
:td(weapon.level)
:td{ needed_poles .. '&times;', css = { ['border-right'] = '0', ['padding-right'] = '0', ['text-align'] = 'right' }, attr = { ['data-sort-value'] = needed_poles } }:done()
:td{ ('[[File:%s.png|link=%s|30px]]'):format(weapon.pole.name,needed weapon.pole.name) '&times;', css = { ['border-leftright'] = '0', ['padding-leftright'] = '0', ['text-align'] = 'right' }, addClassattr = { ['plinktdata-image nosort-bordervalue'] = needed } }:done()
:td{ ('[[' File:%s.png|link=%s|30px]]'):format(weapon.name, weapon.pole.name), ..css = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-linkimage no-border' }:done()
:td{ '[[' .. weapon.name .. ']]', addClass = 'plinkt-link no-border' }
else
 
local cost = needed_ores * lookup_price(ingot.ore)
if chopping_logs then
-- No extra cost
row
elseif buying_logs then
:na()
if needed_logs then
:td{ '<small>N/A</small>', addClass = 'table-na', attr = { ['data-sort-value'] = '0', colspan = '3' } }:done()
cost = cost + needed_logs * lookup_price(pole_info.log)
end
else
if weapon.pole then
cost = cost + needed_poles * lookup_price(weapon.pole.name)
end
end
if chopping_logs or buying_logs then
row
:na()
end
row
:td{ '<small>N/A</small>', addClass = 'table-na', attr = { ['data-sort-value'] = '0', colspan = '3' } }:done()
end
 
row:node(currency._cell(cost, { html = 'yes' }))
row
:td(weapon.level)
:td{ needed .. '&times;', css = { ['border-right'] = '0', ['padding-right'] = '0', ['text-align'] = 'right' }, attr = { ['data-sort-value'] = needed } }:done()
:td{ ('[[File:%s.png|link=%s|30px]]'):format(weapon.name, weapon.name), css = { ['border-left'] = '0', ['padding-left'] = '0' }, addClass = 'plinkt-image no-border' }:done()
:td{ '[[' .. weapon.name .. ']]', addClass = 'plinkt-link no-border' }
 
local cost = needed_ores * lookup_price(ingot.ore)
if chopping_logs then
-- No extra cost
elseif buying_logs then
if needed_logs then
cost = cost + needed_logs * lookup_price(pole_info.log)
end
else
if weapon.pole then
cost = cost + needed_poles * lookup_price(weapon.pole.name)
end
end
 
row:node(currency._cell(cost, { html = 'yes' }))
end
 
697

edits