Anonymous

Module:Skills/Gathering: Difference between revisions

From Melvor Idle
no edit summary
(Add slim farming table variant)
No edit summary
Line 703: Line 703:
end
end


function p._getFarmingTable(realmID, categoryName)
function p._getFarmingTable(realmID, category)
local category = GameData.getEntityByName(SkillData.Farming.categories, categoryName)
if category == nil then
return Shared.printError('Invalid farming category. Please choose Allotments, Herbs, Trees or Special')
end
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 category = GameData.getEntityByName(SkillData.Farming.categories, categoryName)
if category == nil then
return Shared.printError('Invalid farming category. Please choose Allotments, Herbs, Trees or Special')
end
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 category = args[1]
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  
2,875

edits