Z1maV1

beta2.startup

Aug 3rd, 2022 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. function downloadItem(pastebin, path, fileName)
  4.     tPath = "/"..path.."/"..fileName
  5.     shell.run("pastebin", "get", pastebin, tPath)
  6.     return true
  7. end
  8. function runItem(pastebin)
  9.     shell.run("pastebin", "run", pastebin)
  10.     return true
  11. end
  12. function ejectAll()
  13.     if disk.isPresent("top") then
  14.         disk.eject("top")
  15.     elseif disk.isPresent("bottom") then
  16.         disk.eject("bottom")
  17.     elseif disk.isPresent("right") then
  18.         disk.eject("right")
  19.     elseif disk.isPresent("left") then
  20.         disk.eject("left")
  21.     elseif disk.isPresent("front") then
  22.         disk.eject("front")
  23.     elseif disk.isPresent("back") then
  24.         disk.eject("back")
  25.     else
  26.         return false
  27.     end
  28.     return true
  29. end
  30.  
  31. term.clear()
  32. term.setCursorPos(1,1)
  33.  
  34. print("Welcome to Diamond OS installer.")
  35. print("Type \"install\" to install, and type \"cancel\" to cancel.")
  36. while true do
  37.     write("> ")
  38.     input = read()
  39.     if input == "install" then
  40.         break
  41.     elseif input == "cancel" then
  42.         ejectAll()
  43.         os.reboot()
  44.     end
  45. end
  46.  
Advertisement
Add Comment
Please, Sign In to add comment