Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("LUA: initialization")
- __commands = {}
- function register_command(rule, fun)
- __commands[rule] = fun
- end
- function eval_event(channel, user, message)
- print("EVAL: ", channel, user, message)
- for rule, fun in pairs(__commands) do
- print("CHECKING RULE", rule)
- if string.match(message, rule) == message then
- print("MATCHING.")
- return fun(channel, user, message)
- end
- end
- end
- register_command(".*", function(c, u, m) print("you said", c, u, m) end)
- print("LUA: initialized.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement