Anonymous

Module:Pets: Difference between revisions

From Melvor Idle
33 bytes removed ,  27 December 2022
Use printError function
(getPetPageTable: Re-order icon/name columns for consistency with other tables)
(Use printError function)
Line 45: Line 45:
local pet = p.getPet(petName)
local pet = p.getPet(petName)
if pet == nil then
if pet == nil then
return "ERROR: No pet named " .. petName .. " exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No pet named "' .. petName .. '" exists in the data module')
end
end
Line 189: Line 189:
local pet = p.getPet(name)
local pet = p.getPet(name)
if pet == nil then
if pet == nil then
return 'ERROR: Could not find pet with name ' .. (name or 'Unknown') .. '[[Category:Pages with script errros]]'
return Shared.printError('No pet named "' .. (name or 'Unknown') .. '" exists in the data module')
end
end
local effect = (args.effect ~= nil and args.effect ~= '') and args.effect or p._getPetEffect(pet)
local effect = (args.effect ~= nil and args.effect ~= '') and args.effect or p._getPetEffect(pet)
Line 236: Line 236:
end
end
if dung == nil then
if dung == nil then
return 'ERROR: Invalid dungeon name '..dungeonName..'[[Category:Pages with script errors]]'
return Shared.printError('No dungeon named "' .. dungeonName .. '" exists in the data module')
end
end