Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:ItemsByStat: Difference between revisions

From Deadlock Wiki
No edit summary
No edit summary
Line 34: Line 34:
colorBySlot["Tech"] = "#DE9CFF"
colorBySlot["Tech"] = "#DE9CFF"


--{{#invoke:ItemsByStat|tablefy|stat|statName|suffix}}
p.tablefy = function(frame)
p.tablefy = function(frame)
local stat = frame.args[1]
local stat = frame.args[1]
local statName = frame.args[2]
local suffix = frame.args[3]
local tableData = selectByStat(stat)
local tableData = selectByStat(stat)
local outString = '{| class="wikitable sortable"\n|-\n!Item!!Cost!!Value\n'
local outString = '{| class="wikitable sortable"\n|-\n!Item!!Cost!!'..statName..'\n'
for i=1,#tableData do
for i=1,#tableData do
outString = outString..
outString = outString..
Line 43: Line 47:
frame:expandTemplate{title="Item", args={tableData[i][1]}}.."||"..
frame:expandTemplate{title="Item", args={tableData[i][1]}}.."||"..
frame:expandTemplate{title="Souls", args={tableData[i][3]}}.."||"..
frame:expandTemplate{title="Souls", args={tableData[i][3]}}.."||"..
tableData[i][5].."\n"
"+"..tableData[i][5]..suffix.."\n"
end
end
return outString.."|}"
return outString.."|}"