mcbot/mcbot_shell.lua
author Mikael Berthe <mikael@lilotux.net>
Thu, 15 Apr 2010 20:22:36 +0200
changeset 19 96e08713cb6a
parent 1 cca972635e5e
child 66 d9c00a9fe9d5
permissions -rwxr-xr-x
Add support for aliases

#! /usr/bin/env lua

require "mcbot_engine"

local function mcbot_mainloop (BotName)
    local data = { ["nickname"] = BotName }
    while true do
        local l = io.stdin:read'*l'
        if l == nil then break end
        local res, errmsg = process(l, data, false)
        if res then
            print(res)
        else
            if errmsg then print(errmsg) end
        end
    end
end

mcbot_mainloop("mcbot")