Added new sync script
This commit is contained in:
parent
32de47253d
commit
684e0ee35f
16
src/main/programs/sync-1.0.lua
Normal file
16
src/main/programs/sync-1.0.lua
Normal file
@ -0,0 +1,16 @@
|
||||
local prefix = "https://git.brulijam.com/brulijam/Computercraft/raw/branch/main/src"
|
||||
|
||||
local copyList = {
|
||||
[0] = "/main/lib/aes.lua",
|
||||
[1] = "/main/lib/hash.lua"
|
||||
}
|
||||
|
||||
for i=0, #copyList do
|
||||
getRequest = http.get(prefix .. copyList[i])
|
||||
print("Downloaded " .. copyList[i])
|
||||
file = fs.open(copyList[i], "w")
|
||||
file.write(getRequest.readAll())
|
||||
file.close()
|
||||
end
|
||||
print("Sync complete")
|
||||
sleep(1)
|
@ -118,7 +118,7 @@ end
|
||||
|
||||
local function digUpward(length)
|
||||
for i=0, length do
|
||||
turtle.dig()
|
||||
turtle.digUp()
|
||||
turtle.up()
|
||||
end
|
||||
end
|
||||
|
10
src/startup.lua
Normal file
10
src/startup.lua
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
--fetch sync script
|
||||
local prefix = "https://git.brulijam.com/brulijam/Computercraft/raw/branch/main/src"
|
||||
getRequest = http.get(prefix .. "/main/programs/sync-1.0.lua")
|
||||
file = fs.open("/main/programs/sync-1.0.lua", "w")
|
||||
file.write(getRequest.readAll())
|
||||
file.close()
|
||||
|
||||
--execute sync script
|
||||
shell.run("/main/programs/sync-1.0.lua")
|
Loading…
Reference in New Issue
Block a user