Module:WoodcutterList: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (spacing around images)
(correctly parses coop and solo activities separately)
Line 70: Line 70:
if string.find(json,'Log') or string.find(json,'Brambles') then
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)
local activityJSON = mw.text.jsonDecode(json)
itemNew.XP = activityJSON.xp
itemNew.lvl = activityJSON.level
itemNew.coop = activityJSON.coop
itemNew.duration = activityJSON.duration and tonumber(activityJSON.duration)
itemNew.product = activityJSON.output[1].name
table.insert(resultsScreened,itemNew)
item.XP = activityJSON.xp
item.lvl = activityJSON.level
item.duration = activityJSON.duration and tonumber(activityJSON.duration)
item.product = activityJSON.output[1].name
item.activityJSON = json
table.insert(resultsScreened,item)
end
end
end
end
Line 221: Line 225:
:addClass('plinkt-link no-border')
:addClass('plinkt-link no-border')
:wikitext('[[' .. item.product .. ']]')
:wikitext('[[' .. item.product .. ']]')
:IF(item.coop)
:wikitext(' (Co-op)')
:END()
:done()
:done()