mcbot/mcbot_shell.lua
author Mikael Berthe <mikael@lilotux.net>
Sat, 29 Sep 2012 12:50:48 +0200
changeset 61 5d807892b439
parent 1 cca972635e5e
child 66 d9c00a9fe9d5
permissions -rwxr-xr-x
tvcal: Work around buggy 0x0d at end of lines I always wonder how people can generate such ugly HTML code pages...

#! /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")