Computercraft/src/startup.lua

17 lines
533 B
Lua
Raw Normal View History

2024-05-31 17:45:54 +00:00
--fetch sync script
2024-06-01 17:37:50 +00:00
local repo = "https://git.brulijam.com/brulijam/Computercraft/raw/branch/main/src"
getRequest = http.get(repo .. "/main/programs/sync.lua")
2024-05-31 21:50:44 +00:00
file = fs.open("/main/programs/sync.lua", "w")
2024-05-31 17:45:54 +00:00
file.write(getRequest.readAll())
file.close()
--execute sync script
2024-05-31 21:50:44 +00:00
shell.run("/main/programs/sync.lua")
2024-06-02 15:01:56 +00:00
--task.lua contains stuff that should be done after boot
if not (fs.exists("main/task.lua")) then
basic_functions.append_to_file("main/task.lua", "--use this file to execute programs")
end
shell.run("main/task.lua")