-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.lua
More file actions
58 lines (56 loc) · 1.85 KB
/
installer.lua
File metadata and controls
58 lines (56 loc) · 1.85 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
print("Welcome to the SolidityPools installer!")
local repo = "afonya2/SolidityPools"
local branch = "main"
local files = {
["items/Ores.conf"] = "items/Ores.conf",
["modules/adminCommands.lua"] = "modules/adminCommands.lua",
["modules/commandHandler.lua"] = "modules/commandHandler.lua",
["modules/frontend.lua"] = "modules/frontend.lua",
["modules/itemHelper.lua"] = "modules/itemHelper.lua",
["modules/kristManager.lua"] = "modules/kristManager.lua",
["modules/sessionHandler.lua"] = "modules/sessionHandler.lua",
["modules/shopsync.lua"] = "modules/shopsync.lua",
["bigfont.lua"] = "bigfont.lua",
["BIL.lua"] = "BIL.lua",
["config.conf"] = "config.conf",
["discordWebhook.lua"] = "discordWebhook.lua",
["kristapi.lua"] = "kristapi.lua",
["main.lua"] = "main.lua"
}
print("Scanning for old config files...")
local cfgfiles = {
"config.conf",
"items/Ores.conf"
}
local cfgcache = {}
print("Do you want to keep your config files? (y/n)")
local yass = io.read()
if yass == "y" then
for k,v in ipairs(cfgfiles) do
if fs.exists(v) then
local h = fs.open(v, "rb")
cfgcache[v] = h.readAll()
h.close()
end
end
end
print("Downloading files...")
for k,v in pairs(files) do
print("Downloading file "..k)
local url = "https://raw.githubusercontent.com/"..repo.."/"..branch.."/"..k
local con = http.get({url = url, binary = true})
local h = fs.open(v, "wb")
h.write(con.readAll())
h.close()
print("done")
end
print("Loading old config files...")
for k,v in pairs(cfgcache) do
local h = fs.open(k, "wb")
h.write(v)
h.close()
end
print("Done")
print("To configure your shop edit the config.conf file")
print("To configure your items edit the items/Ores.conf file")
print("To start the shop on startup, rename the main.lua to startup.lua")