-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.lua
More file actions
33 lines (28 loc) · 1.11 KB
/
Copy pathinstall.lua
File metadata and controls
33 lines (28 loc) · 1.11 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
function cleanup(file)
if fs.exists(file) then
print("Deleting " .. file)
shell.run("delete", file)
end
end
function download(programName, fileName, url)
local fileStream = http.get(url)
local fileData = fileStream.readAll()
fileStream.close()
local file = fs.open(fileName, "w")
file.write(fileData)
file.close()
print(programName .. " program updated!")
end
cleanup("skychest.lua")
cleanup("quarry.run")
cleanup("quarry.ignoredblocks")
cleanup("quarry.enderchests")
cleanup("q.lua")
cleanup("log.lua")
cleanup("fuel.lua")
cleanup("rw.lua")
download("SkyChest", "skychest.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/SkyChestFinder.lua")
download("Quarry", "q.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/quarry.lua")
download("Logger API", "log.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/log.lua")
download("Fuel API", "fuel.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/fuel.lua")
download("Refuel Wizard", "rw.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/refuelwizard.lua")