mcbot/mcbot_shell.lua
author Mikael Berthe <mikael@lilotux.net>
Sun, 11 Apr 2010 18:13:18 +0200
changeset 0 89add07d6fe4
child 1 cca972635e5e
permissions -rwxr-xr-x
Initial revision 2010/04/11, mcabber 0.10.1-dev (1892:ea3f9b4f3558)

#! /usr/bin/env lua

require "mcbot_engine"

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

mcbot_mainloop("mcbot")