lovecmd is a simple LÖVE interface for the console
Require library, load it and update it
local cmd = require "lovecmd"
function love.load()
cmd.load()
end
function love.update(dt)
cmd.update()
end
Register commands (and optional fallback)
cmd:on("myCommand", function()
print("it works!")
end)
cmd:on(function(name) print(name .. " doesn't exist) end)
cmd.load()
initializes thread
cmd.update()
updates internal thread
cmd:on(command, callback)
cmd:on(callback) --default callback if command isn't registered
registers a command - callback is a function which takes as many arguments as your command does (e.g. function (arg1, arg2) print(arg1, arg2) end)