Module:WoodcutterList: Difference between revisions
correctly parses coop and solo activities separately
(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...") |
(correctly parses coop and solo activities separately) |
||
(One intermediate revision by the same user not shown) | |||
Line 70:
if string.find(json,'Log') or string.find(json,'Brambles') then
local itemNew = {}
itemNew.name = item.name
itemNew.Image = item.Image
local activityJSON = mw.text.jsonDecode(json)
itemNew.product = activityJSON.output[1].name
▲ item.XP = activityJSON.xp
▲ item.lvl = activityJSON.level
▲ item.duration = activityJSON.duration and tonumber(activityJSON.duration)
▲ item.product = activityJSON.output[1].name
▲ table.insert(resultsScreened,item)
end
end
Line 197 ⟶ 201:
:tag('td')
:css{ ['border-right'] = '0', ['text-align'] = 'right', ['max-width'] = '100px' }
:attr{ ['data-sort-value'] = item.name }
:wikitext(' [[' .. item.Image .. '|link=' .. item.name .. '|30x30px]]')
Line 216 ⟶ 219:
:tag('td')
:css{ ['border-right'] = '0', ['text-align'] = 'right', ['max-width'] = '100px' }
:attr{ ['data-sort-value'] = item.product }
:wikitext('[[File:' .. item.product .. '.png|link=' .. item.product .. '|30x30px]]')
Line 223 ⟶ 225:
:addClass('plinkt-link no-border')
:wikitext('[[' .. item.product .. ']]')
:IF(item.coop)
:wikitext(' (Co-op)')
:END()
:done()
|