Advertisement
ypetremann

ComputerCraft Boot sequence

Nov 28th, 2012
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. -- Script at /startup
  2.  
  3. -- Actual boot sequence
  4. bootSequence = {
  5.   {"HTTP","/boot/http"   },
  6.   {"LAN" ,"/boot/lan"    },
  7.   {"DISK","/disk/startup"},
  8.   {"HDD" ,"/hdd/startup" },
  9.   {"ROM" ,"/rom/startup" }
  10. }
  11.  
  12. -- Program
  13. term.setCursorPos(1,1)
  14. term.clear()
  15. for k,d in ipairs(bootSequence) do
  16.   name, path = d[1], d[2]
  17.   if fs.exists(path) and not fs.isDir(path) then
  18.     print("boot "..name)
  19.     sleep(1)
  20.     term.setCursorPos(1,1)
  21.     term.clear()
  22.   else
  23.     print(name.." skipped")
  24.   end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement