Computercraft/src/startup.lua

19 lines
552 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
2024-06-02 15:05:18 +00:00
file = fs.open("main/task.lua", "a")
file.writeLine("--use this file to execute programs")
file.close()
2024-06-02 15:01:56 +00:00
end
shell.run("main/task.lua")