]> jfr.im git - irc/quakenet/newserv.git/blob - lua/lib/bootstrap.lua
LUA: Add lua stdlib.
[irc/quakenet/newserv.git] / lua / lib / bootstrap.lua
1 require("lib/quakenet")
2 require("lib/missing")
3 require("lib/schedule")
4 require("lib/serialise")
5 require("lib/country")
6 require("lib/db")
7 require("lib/socket")
8 require("lib/json")
9 require("lib/class")
10
11 local LASTERROR = 0
12 local NOTREPORTING = false
13
14 function scripterror(err)
15 local cerror = os.time()
16 if cerror > LASTERROR then
17 LASTERROR = cerror
18 NOTREPORTING = false
19 end
20
21 if not NOTREPORTING then
22 chanmsgn(traceback(err, 2))
23
24 LASTERROR = LASTERROR + 1
25 if LASTERROR > cerror + 10 then
26 NOTREPORTING = true
27 chanmsg("Too many errors for this script -- no longer reporting")
28 end
29 end
30 end
31
32 math.randomseed(os.time())