mun/start.lua

39 lines
1.0 KiB
Lua
Raw Normal View History

require('core.hook')
2013-09-22 16:58:15 +00:00
require('core.config')
2013-09-29 16:20:12 +00:00
require('core.db')
require('core.reactor')
2013-09-22 11:54:15 +00:00
require('core.irc')
require('core.bot')
2013-09-22 12:29:54 +00:00
require('core.plugin')
2013-09-22 11:54:15 +00:00
hook.Add('info', 'repl-info', function(Message)
print('INFO: ' .. Message)
end)
hook.Add('debug', 'repl-debug', function(Message)
print('DEBUG: ' .. Message)
end)
2013-09-22 16:58:15 +00:00
hook.Add('plugin.HookCallFailed', 'repl-debug', function(Name, Message)
print(string.format("Plugin hook call failed! %s: %s", Name, Message))
end)
2013-09-22 11:54:15 +00:00
hook.Add('irc.Connected', 'repl-connected', function()
print("Joining...")
2014-01-25 11:22:58 +00:00
irc:Join('##hackerspace-pl-bottest')
2013-09-22 11:54:15 +00:00
end)
2013-09-22 16:58:15 +00:00
config:Load('moonspeak.ini')
local Server = config:Get('irc', 'server')
local Port = tonumber(config:Get('irc', 'port')) or 6667
local Nickname = config:Get('irc', 'nickname')
local Username = config:Get('irc', 'username')
local Realname = config:Get('irc', 'realname')
reactor:Initialize()
bot:Initialize(irc, '~')
2013-09-22 12:56:38 +00:00
plugin.AddRuntimeCommands()
2013-09-22 16:58:15 +00:00
plugin.Discover()
irc:Connect(Server, Port, Nickname, Username, Realname)
2013-09-22 11:54:15 +00:00
reactor:Run()