Anonymous

Module:Skills/Cartography: Difference between revisions

From Melvor Idle
Swapped output of test to a table
(adding another linebreak for readablity)
(Swapped output of test to a table)
Line 17: Line 17:
local POIs = {}
local POIs = {}
local POI_Strings = {}
local POI_Strings = {}
local tableStr = {}
table.insert(tableStr, '{| class="wikitable sortable"')
table.insert(tableStr, '\r\n|-\r\n!Name!!Type!!X!!Y!!Description')
for i, POI in pairs(SkillData.Cartography.worldMaps[1].pointsOfInterest) do
for i, POI in pairs(SkillData.Cartography.worldMaps[1].pointsOfInterest) do
Line 36: Line 38:
local X, Y = p.convertAxialToXY(POI.coords)
local X, Y = p.convertAxialToXY(POI.coords)
table.insert(POI_Strings, POI.name..' ('..X..', '..Y..')')
table.insert(POI_Strings, POI.name..' ('..X..', '..Y..')')
table.insert(tableStr,'\r\n|-\r\n|')
table.insert(tableStr, POI.name)
table.insert(tableStr, '||'..POI.type)
table.insert(tableStr, '||'..X)
table.insert(tableStr, '||'..Y)
table.insert(tableStr, '||'..POI.description)
end
end
table.insert(tableStr, '\r\n|}')
local keyset={}
local keyset={}
local n=0
local n=0
for k,v in pairs(SkillData.Cartography.worldMaps[1]) do
for k,v in pairs(POIs[1]) do
  n=n+1
  n=n+1
  keyset[n]=k
  keyset[n]=k
end
end
mw.logObject(POIs[1])
mw.logObject(POIs[1])
return table.concat(POI_Strings, '<br/>\n')
return table.concat(tableStr, '')
end
end


return p
return p