diff --git a/turtle.lua b/turtle.lua index 6a9528b..f0c1c67 100644 --- a/turtle.lua +++ b/turtle.lua @@ -913,7 +913,13 @@ local function processMessage(message) if message.command then print(" Command: " .. message.command) - print(" Available handlers: " .. textutils.serialize(table.keys or function(t) local k={} for n in pairs(t) do table.insert(k,n) end return k end)(commands)) + -- Don't try to serialize the commands table - it contains functions! + -- Just list the command names + local availableCommands = {} + for cmdName, _ in pairs(commands) do + table.insert(availableCommands, cmdName) + end + print(" Available handlers: " .. table.concat(availableCommands, ", ")) local handler = commands[message.command] if handler then