Added new sync script

This commit is contained in:
Julian Brammer 2024-05-31 19:45:54 +02:00
parent 32de47253d
commit 684e0ee35f
3 changed files with 27 additions and 1 deletions

View 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)

View File

@ -118,7 +118,7 @@ end
local function digUpward(length) local function digUpward(length)
for i=0, length do for i=0, length do
turtle.dig() turtle.digUp()
turtle.up() turtle.up()
end end
end end

10
src/startup.lua Normal file
View 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")