-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.lua
More file actions
65 lines (58 loc) · 1.31 KB
/
Copy pathDatabase.lua
File metadata and controls
65 lines (58 loc) · 1.31 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local _, SNEK = ...
SNEK.DB = {}
local DEFAULTS = {
enabled = false,
isRecording = false,
delay = 2.8,
initialDelay = 2.5,
sequenceLimit = 7,
autoFinalizeOnLimit = true, -- start playback when the sequence limit is hit
showMinimap = true,
showKeyFeedback = true,
useSayChat = false, -- false = local print, true = /say via MessageQueue
labels = {
[1] = "left",
[2] = "right",
[3] = "forward",
[4] = "",
[5] = "",
[6] = "",
[7] = "",
[8] = "",
[9] = "",
[10] = "",
},
minimapAngle = 220,
}
function SNEK.DB.Init()
if not SNEKDB then
SNEKDB = {}
end
local db = SNEKDB
for k, v in pairs(DEFAULTS) do
if db[k] == nil then
if type(v) == "table" then
db[k] = {}
for mk, mv in pairs(v) do
db[k][mk] = mv
end
else
db[k] = v
end
end
end
if type(db.labels) ~= "table" then
db.labels = {}
end
for i = 1, 10 do
if db.labels[i] == nil then
db.labels[i] = DEFAULTS.labels[i] or ""
end
end
end
function SNEK.DB.Get()
if not SNEKDB then
SNEK.DB.Init()
end
return SNEKDB
end