-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.lua
More file actions
42 lines (32 loc) · 955 Bytes
/
Copy pathinit.lua
File metadata and controls
42 lines (32 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/lua
---------------------------------------------------
--------------- INIT.lua --------------------------
--- This file loads all required resources --------
--- that the bot needs. --------
---------------------------------------------------
print("Loading LuaSocket...")
socket = require("socket")
http = require("socket.http")
print("Loading LuaFileSystem...")
require("lfs")
print("Loading LuaGetpid...")
require("LuaGetpid")
print("Loading lua utility libraries...")
for name in lfs.dir("./lualibs") do
if name ~= "." and name ~= ".." then
dofile("./lualibs/"..name)
end
end
print("Loading IRC library...")
dofile("irc.lua")
print("Creating PID file...")
local pidfile, error = io.open("radiobot.pid", "w+")
if not pidfile then
print("Unable to create pid file! "..error)
return
end
PID = getpid()
pidfile:write(tostring(PID))
pidfile:close()
print("Starting bot from bot.lua:")
dofile("bot.lua")