Commands = { cls = { fun = function(console) console.logs = {} console.scroll_to_bottom = true end, help = "Clears the log" }, help = { fun = function(console, fun) if fun then if console.command_helps[fun] then console:log(fun .. " " .. console.command_helps[fun]) elseif console.commands[fun] then console:log(fun.." doesn't have help info.") else console:log("Command not found : "..fun) end return end local res = "" for k,v in pairs(console.commands) do res = res .. k .. " " end console:log(res) end, help = "[fun] : List commands or show help of a given command." }, collectgarbage = { fun = function(console, opt, arg) collectgarbage(opt, arg) end, help = "[opt][, arg] : calls lua's collectgarbage'" }, spawn = { fun = function(console) local entity = engine.world:createEntity() console:log("Created entity id : "..entity.__eid) end, help = "Spawn a new entity" } } -- Aliases Commands.ls = Commands.help return Commands