Module:Skills/Gathering: Difference between revisions
From Melvor Idle
(Add slim farming table variant) |
No edit summary |
||
Line 703: | Line 703: | ||
end | end | ||
function p._getFarmingTable(realmID, | function p._getFarmingTable(realmID, category) | ||
local seedList = GameData.getEntities(SkillData.Farming.recipes, | local seedList = GameData.getEntities(SkillData.Farming.recipes, | ||
function(recipe) | function(recipe) | ||
Line 785: | Line 781: | ||
function p._getSlimFarmingTable(realmID, category) | function p._getSlimFarmingTable(realmID, category) | ||
local seedList = GameData.getEntities(SkillData.Farming.recipes, | local seedList = GameData.getEntities(SkillData.Farming.recipes, | ||
function(recipe) | function(recipe) | ||
Line 842: | Line 834: | ||
return Shared.printError('Failed to find a realm with name ' .. (realmName or 'nil')) | return Shared.printError('Failed to find a realm with name ' .. (realmName or 'nil')) | ||
end | end | ||
local | local categoryName = args[1] | ||
local category = GameData.getEntityByName(SkillData.Farming.categories, categoryName) | |||
if category == nil then | |||
return Shared.printError('Invalid farming category: ' .. categoryName .. '. Please choose Allotments, Herbs, Trees or Special') | |||
end | |||
if slim == true then | if slim == true then |