--- a/mcbot/mcbot_engine.lua Thu Apr 15 18:35:13 2010 +0200
+++ b/mcbot/mcbot_engine.lua Thu Apr 15 18:57:38 2010 +0200
@@ -13,8 +13,8 @@
return string.sub(String, 1, string.len(Start)) == Start
end
-function mcbot_register_command (name, callback)
- commands[name] = callback
+function mcbot_register_command (name, object)
+ commands[name] = object
end
require "cmds.wtf"
@@ -38,9 +38,9 @@
cmd, arg = line:match("^(%w+)%s+(.*)")
end
if cmd then
- for name, f in pairs(commands) do
+ for name, obj in pairs(commands) do
if cmd and cmd:lower() == name then
- return f(arg, botdata)
+ return obj.cmd(arg, botdata)
end
end
else