Module:Skills/Gathering/Sandbox: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 371: Line 371:
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Value')
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Value')
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('XP/s')
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('XP/s')
headerRow0:tag('th'):attr('rowspan', '2'):wikitext('Price/s')
headerRow0:tag('th'):attr('rowspan', '2'):wikitext(Icons.Icon({'Cooking', type='skill', notext=true}) .. ' Level')


local headerRow1 = html:tag('tr'):addClass('headerRow-1')
local headerRow1 = html:tag('tr'):addClass('headerRow-1')
Line 391: Line 389:
local XPSec = baseXP / timeSortVal
local XPSec = baseXP / timeSortVal
local sellCurrency = fish.sellsForCurrency or 'melvorD:GP'
local sellCurrency = fish.sellsForCurrency or 'melvorD:GP'
local currPerSec = Shared.round(fish.sellsFor / timeSortVal, 2, 2)
local cookRecipe = cookRecipes[recipe.productId]
local cookLevel, cookStyle, cookStr = 0, 'class="table-na" ', 'N/A'
if cookRecipe ~= nil then
cookLevel = Skills.getRecipeLevel('Cooking', cookRecipe)
cookStyle = 'style="text-align:right" '
cookStr = Skills.getRecipeRequirementText('Cooking', cookRecipe)
end


local row = html:tag('tr')
local row = html:tag('tr')
Line 431: Line 421:
:css('text-align', 'right')
:css('text-align', 'right')
:wikitext(Shared.round(XPSec, 2, 2))
:wikitext(Shared.round(XPSec, 2, 2))
row:tag('td')
:attr('data-sort-value', currPerSec)
:wikitext(Icons._Currency(sellCurrency, currPerSec))
row:tag('td')
:attr(cookStyle)
:attr('data-sort-value', cookLevel)
:wikitext(cookStr)
end
end
end
end
2,875

edits