author | Mikael Berthe <mikael@lilotux.net> |
Sun, 11 Apr 2010 18:13:18 +0200 | |
changeset 0 | 89add07d6fe4 |
child 1 | cca972635e5e |
permissions | -rwxr-xr-x |
0 | 1 |
#! /usr/bin/env lua |
2 |
||
3 |
require "mcbot_engine" |
|
4 |
||
5 |
local function mcbot_mainloop (BotName) |
|
6 |
while true do |
|
7 |
local l = io.stdin:read'*l' |
|
8 |
if l == nil then break end |
|
9 |
local res, errmsg = process(l, BotName, false) |
|
10 |
if res then |
|
11 |
print(res) |
|
12 |
else |
|
13 |
if errmsg then print(errmsg) end |
|
14 |
end |
|
15 |
end |
|
16 |
end |
|
17 |
||
18 |
mcbot_mainloop("mcbot") |