4,951
edits
Falterfire (talk | contribs) (Tweaked getPrayerEffect to ensure it properly forms lists) |
Falterfire (talk | contribs) (Added getBonesTable) |
||
Line 6: | Line 6: | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local Constants = require('Module:Constants') | local Constants = require('Module:Constants') | ||
local Items = require('Module:Items') | |||
local ItemSources = require('Module:Items/SourceTables') | |||
function p.getPrayerByID(id) | function p.getPrayerByID(id) | ||
Line 172: | Line 174: | ||
result = result..'\r\n|}' | result = result..'\r\n|}' | ||
return result | |||
end | |||
function p.getBonesTable(frame) | |||
local result = '{| class="wikitable sortable stickyHeader"' | |||
result = result..'\r\n|- class="headerRow-0"' | |||
result = result..'\r\n!colspan="2"|Bone!!Prayer Points!!Sources' | |||
local itemArray = Items.getItems(function(item) return item.prayerPoints ~= nil and item.prayerPoints > 0 end) | |||
table.sort(itemArray, function(a, b) return a.prayerPoints < b.prayerPoints end) | |||
for i, item in Shared.skpairs(itemArray) do | |||
result = result..'\r\n|-' | |||
result = result..'\r\n|'..Icons.Icon({item.name, type='item', notext='true', size='50'})..'||[['..item.name..']]' | |||
result = result..'||'..item.prayerPoints..'||'..ItemSources._getItemSources(item, false, false) | |||
end | |||
result = result..'\r\n|}' | |||
return result | return result | ||
end | end | ||
return p | return p |