Module:Sandbox/User:The Gaffer/Modules/Infobox Recipe: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 90: Line 90:
table.insert(out, '|}')
table.insert(out, '|}')


-- Add debug information to the output using mw.messageBox
-- Add debug information to the output as a simple paragraph
local debugMessage = 'Debug Info:\n' ..
local debugMessage = 'Debug Info:<br>' ..
'rawmat1query: ' .. (rawmat1query or 'nil') .. '\n' ..
'rawmat1query: ' .. (rawmat1query or 'nil') .. '<br>' ..
'rawmat1cost: ' .. tostring(rawmat1cost) .. '\n' ..
'rawmat1cost: ' .. tostring(rawmat1cost) .. '<br>' ..
'rawmat2query: ' .. (rawmat2query or 'nil') .. '\n' ..
'rawmat2query: ' .. (rawmat2query or 'nil') .. '<br>' ..
'rawmat2cost: ' .. tostring(rawmat2cost) .. '\n' ..
'rawmat2cost: ' .. tostring(rawmat2cost) .. '<br>' ..
'rawmat3query: ' .. (rawmat3query or 'nil') .. '\n' ..
'rawmat3query: ' .. (rawmat3query or 'nil') .. '<br>' ..
'rawmat3cost: ' .. tostring(rawmat3cost) .. '\n' ..
'rawmat3cost: ' .. tostring(rawmat3cost) .. '<br>' ..
'totalCost: ' .. tostring(totalCost) .. '\n' ..
'totalCost: ' .. tostring(totalCost) .. '<br>' ..
'output1query: ' .. (output1query or 'nil') .. '\n' ..
'output1query: ' .. (output1query or 'nil') .. '<br>' ..
'output1cost: ' .. tostring(output1cost) .. '\n' ..
'output1cost: ' .. tostring(output1cost) .. '<br>' ..
'output1costTotal: ' .. tostring(output1costTotal) .. '\n' ..
'output1costTotal: ' .. tostring(output1costTotal) .. '<br>' ..
'profit: ' .. tostring(profit)
'profit: ' .. tostring(profit)


table.insert(out, frame:preprocess('{{#invoke:Message box|mbox|text=' .. debugMessage .. '}}'))
table.insert(out, debugMessage)


return table.concat(out, '\n')
return table.concat(out, '\n')