Module:WoodcutterList: Difference between revisions
m
profit per xp not used
(Created page with "require('strict') require('Module:Mw.html extension') local param = require( 'Module:Paramtest' ) local currency = require('Module:Currency') local lang = mw.getContentLanguage() local p = {} -- non dynamic module, no inputs function p.main() -- returns only directly needed parameter needed for the row, -- other parameters are determined by subqueries of chained pages local query = { '|Brambles', '?Variant of #- = variant', '?Professio...") |
m (profit per xp not used) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1:
require('strict')
require('Module:Mw.html extension')
local lang = mw.getContentLanguage()
local plist = require('Module:ProfessionList')
local rts = require('Module:RecipeTreeSearch')
local p = {}
Line 10:
function p.main()
local queryString = '[[Category:Woodcutter]] AND [[Category:Pages with activities]]'
local
return not item.passive
end
local results = plist.generate_recipe_table(queryString,screenFunction)
results = p.formatResults(results)
Line 40 ⟶ 27:
end
-- do calculations and determine strings to go in cells
function p.formatResults(results)
--simple check for nil results
return nil
end
-- iterate through products
for _, item in ipairs(results) do
-- detect brambles
item.
-- profitability
item.
-- DOWNTIME VERY IMPORTANT FOR GATHERING TYPE PROFESSIONS
Line 134 ⟶ 50:
-- properties per hour
item.
item.profitPerHour = item.profit and item.productPerHour and math.floor(item.profit * item.productPerHour)
end
Line 143 ⟶ 59:
-- make the table
function p.displayTable(results)
--simple check for nil results
if results ==nil or results[1] == nil then
return 'No data found for table'
end
local out = mw.html.create('table')
:addClass('wikitable sortable')
Line 175 ⟶ 97:
:done()
:done()
for i, item in ipairs(results) do
Line 185 ⟶ 102:
--level
:IF(item.
:tag('td')
:css{ ['text-align'] = 'center' }
:wikitext(item.
:done()
:ELSE()
:node(plist.unknown_value_edit_cell(item.pageName,1))
:END()
-- gathering node
:node(plist.two_column_image_text(item.pageName,item.pageImage,item.pageName,item.pageName))
-- resource
:IF(item.
:tag('td')
:addClass('table-na')
Line 214 ⟶ 122:
:done()
:ELSE()
:
:node(plist.two_column_image_text(item.product,'File:' .. item.product .. '.png',item.product .. ' (co-op)',item.product))
:ELSE()
:node(plist.two_column_image_text(item.product,'File:' .. item.product .. '.png',item.product,item.product))
:END()
-- resource/hr
:IF(item.productPerHour)
Line 231 ⟶ 134:
:done()
:ELSE()
:node(
:END()
-- economics
:node(plist.currency_cell(item.profit))
:node(plist.currency_cell(item.profitPerHour))
:END()
-- XP
:IF(item.
:tag('td')
:wikitext(item.
:done()
:ELSE()
:node(plist.unknown_value_edit_cell(item.pageName,1))
:END()
-- XP per hour
:IF(item.
:tag('td')
:wikitext(item.
:done()
:ELSE()
:node(plist.unknown_value_cell(1))
:END()
|