Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
Use printError function
m (Correct item name error)
(Use printError function)
Line 200: Line 200:
local spell = Magic.getSpell(spellName, 'altMagic')
local spell = Magic.getSpell(spellName, 'altMagic')
if spell == nil then
if spell == nil then
return 'ERROR: Could not find Alt. Magic spell "' .. spellName .. '"[[Category:Pages with script errors]]'
return Shared.printError('Could not find Alt. Magic spell "' .. spellName .. '"')
else
else
return p._buildAltMagicTable(spell)
return p._buildAltMagicTable(spell)
Line 280: Line 280:
local item = Items.getItem(itemName)
local item = Items.getItem(itemName)
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end


Line 622: Line 622:
end
end
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end


Line 820: Line 820:
local item = Items.getItem(itemName)
local item = Items.getItem(itemName)
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end


Line 855: Line 855:
local item = Items.getItem(itemName)
local item = Items.getItem(itemName)
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end


Line 873: Line 873:
local smithRecipe = p._getSuperheatSmithRecipe(item)
local smithRecipe = p._getSuperheatSmithRecipe(item)
if smithRecipe == nil then
if smithRecipe == nil then
return 'ERROR: The item "' .. item.name .. '" cannot be superheated[[Category:Pages with script errors]]'
return Shared.printError('The item "' .. item.name .. '" cannot be superheated')
end
end


Line 921: Line 921:
local item = Items.getItem(itemName)
local item = Items.getItem(itemName)
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end


Line 963: Line 963:
local item = Items.getItem(itemName)
local item = Items.getItem(itemName)
if item == nil then
if item == nil then
return "ERROR: No item named "..itemName.." exists in the data module[[Category:Pages with script errors]]"
return Shared.printError('No item named "' .. itemName .. '" exists in the data module')
end
end