Module:Skills/Gathering: Difference between revisions

Fix incorrect opening/closing of html tags
m (Fix syntax)
(Fix incorrect opening/closing of html tags)
Line 545: Line 545:
end
end


local tbl = mw.html.create("table")
local tbl = mw.html.create()
local html = tbl:tag("table")
         :addClass("wikitable sortable stickyHeader")
         :addClass("wikitable sortable stickyHeader")
        :tag('tr'):addClass("headerRow-0")
    :tag('tr'):addClass("headerRow-0")
         :tag('td'):attr("colspan", 2):wikitext("Seeds")
         :tag('th'):attr("colspan", 2):wikitext("Seeds")
         :tag('td'):wikitext(Icons.Icon({'Farming', type='skill', notext=true}) .. " Level")
         :tag('th'):wikitext(Icons.Icon({'Farming', type='skill', notext=true}) .. " Level")
         :tag('td'):wikitext('XP')
         :tag('th'):wikitext('XP')
         :tag('td'):wikitext('Growth Time')
         :tag('th'):wikitext('Growth Time')
         :tag('td'):wikitext('Seed Value')
         :tag('th'):wikitext('Seed Value')
        :done()


if category.id == 'melvorD:Allotment' then
if category.id == 'melvorD:Allotment' then
tbl :tag('td'):attr("colspan", 2):wikitext("Crop")
html:tag('th'):attr("colspan", 2):wikitext("Crop")
:tag('td'):wikitext('Crop Healing')
:tag('th'):wikitext('Crop Healing')
:tag('td'):wikitext('Crop Value')
:tag('th'):wikitext('Crop Value')
elseif category.id == 'melvorD:Herb' then
elseif category.id == 'melvorD:Herb' then
tbl :tag('td'):attr("colspan", 2):wikitext("Herb")
html:tag('th'):attr("colspan", 2):wikitext("Herb")
:tag('td'):wikitext('Herb Value')
:tag('th'):wikitext('Herb Value')
elseif category.id == 'melvorD:Tree' then
elseif category.id == 'melvorD:Tree' then
tbl :tag('td'):attr("colspan", 2):wikitext("Logs")
html:tag('th'):attr("colspan", 2):wikitext("Logs")
:tag('td'):wikitext('Log Value')
:tag('th'):wikitext('Log Value')
end
end
tbl = tbl
html = html:tag('th'):wikitext('Seed Sources')
tbl:tag('td'):wikitext('Seed Sources')


table.sort(seedList, function(a, b) return a.level < b.level end)
table.sort(seedList, function(a, b) return a.level < b.level end)
Line 575: Line 574:
local productItem = Items.getItemByID(seed.productId)
local productItem = Items.getItemByID(seed.productId)
if seedItem ~= nil and productItem ~= nil then
if seedItem ~= nil and productItem ~= nil then
tbl :tag('tr')
html =
:tag('td'):wikitext(Icons.Icon({seedItem.name, type='item', size='50', notext=true}))
html:tag('tr')
:tag('td'):wikitext(Icons.getExpansionIcon(seedItem.id) .. Icons.Icon({seedItem.name, type='item', noicon=true}))
:tag('td'):wikitext(Icons.Icon({seedItem.name, type='item', size='50', notext=true}))
:tag('td'):wikitext(seed.level)
:tag('td'):wikitext(Icons.getExpansionIcon(seedItem.id) .. Icons.Icon({seedItem.name, type='item', noicon=true}))
:tag('td'):wikitext(Shared.formatnum(seed.baseExperience))
:tag('td'):wikitext(seed.level)
:tag('td'):attr('data-sort-value', (seed.baseInterval / 1000))
:tag('td'):wikitext(Shared.formatnum(seed.baseExperience))
  :wikitext(Shared.timeString(seed.baseInterval / 1000, true))
:tag('td'):attr('data-sort-value', (seed.baseInterval / 1000))
:tag('td'):attr('data-sort-value', seedItem.sellsFor)
  :wikitext(Shared.timeString(seed.baseInterval / 1000, true))
      :wikitext(Icons.GP(seedItem.sellsFor))
:tag('td'):attr('data-sort-value', seedItem.sellsFor)
:tag('td'):wikitext(Icons.Icon({productItem.name, type='item', size='50', notext=true}))
      :wikitext(Icons.GP(seedItem.sellsFor))
:tag('td'):wikitext(Icons.getExpansionIcon(productItem.id) .. Icons.Icon({productItem.name, type='item', noicon=true}))
:tag('td'):wikitext(Icons.Icon({productItem.name, type='item', size='50', notext=true}))
:tag('td'):wikitext(Icons.getExpansionIcon(productItem.id) .. Icons.Icon({productItem.name, type='item', noicon=true}))


if category.id == 'melvorD:Allotment' then
if category.id == 'melvorD:Allotment' then
tbl :tag('td'):wikitext(Icons.Icon({'Hitpoints', type='skill', notext=true}))
html:tag('td'):wikitext(Icons.Icon({'Hitpoints', type='skill', notext=true}))
  :wikitext(' ')
  :wikitext(' ')
  :wikitext(((productItem.healsFor or 0) * 10))
  :wikitext(((productItem.healsFor or 0) * 10))
end
end
tbl = tbl
html =
tbl :tag('td'):attr('data-sort-value', productItem.sellsFor)
html:tag('td'):attr('data-sort-value', productItem.sellsFor)
  :wikitext(Icons.GP(productItem.sellsFor))
  :wikitext(Icons.GP(productItem.sellsFor))
:tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem))
:tag('td'):wikitext(ItemSourceTables._getItemSources(seedItem))
:done()
end
end
end
end
913

edits