Advertisement
Piorjade

ComputerCraft DoorOS-Installer (v0.3Alpha)

Oct 28th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. --INFO
  2. --(only for advanced computers)
  3.  
  4. --How to use: Just type "pastebin run hdH9umHF"
  5.  
  6. --Sry this is in GERMAN and I won't update it (maybe for some extra last things),
  7. --because I was just testing things out and learn how they work.
  8. --But I pretty much wanted to somehow make it useful for newbies in CC
  9.  
  10.  
  11. --Notice if you go on +Programm (add a program) the last box is "Extra Sett." ! This is necessary, if your program uses fullscreen.
  12. --If it DOES just type "true"
  13. --Now, if you boot your program and want to exit it, press STRG / CTRL!
  14. --(This is one of the main things I wanted to test in CC. It just opens the program, adds some lines so that you can exit to
  15. --the desktop with STRG / CTRL)
  16.  
  17. --And no, i won't add things like multitasking (multiple windows) or clickable icons on your desktop
  18.  
  19. --And yes, my english is bad ... I'm german.
  20.  
  21.  
  22.  
  23. --DoorOS Installer
  24. --Geschrieben von Piorjade
  25. --Do not copy and claim it as your own.
  26.  
  27. --Variablen
  28. running = false
  29.  
  30.  
  31.  
  32.  
  33. --Funktionen
  34. button = function()
  35. term.setBackgroundColor(colors.gray)
  36. term.setTextColor(colors.white)
  37. end
  38.  
  39. clear = function()
  40. term.setBackgroundColor(colors.blue)
  41. term.setTextColor(colors.white)
  42. term.setCursorPos(1, 1)
  43. term.clear()
  44. end
  45.  
  46. clickEvent = function()
  47. while running do
  48.  
  49. local event, button, X, Y = os.pullEventRaw()
  50. if event == "mouse_click" then
  51. if X >=1 and X <= 31 and Y == 6 and button == 1 then
  52. shell.run("pastebin get dJd0B0V8 compilr")
  53. shell.run("pastebin get aE3Gh5j2 build")
  54. shell.run("build --extract")
  55. shell.run("delete compilr")
  56. shell.run("delete build")
  57. os.reboot()
  58. elseif X >=1 and X <= 31 and Y == 8 and button == 1 then
  59. shell.run("delete /doorOS")
  60. shell.run("delete /startup")
  61. os.reboot()
  62. elseif X >=1 and X <= 31 and Y == 10 and button == 1 then
  63. os.reboot()
  64. end
  65. end
  66. end
  67. end
  68.  
  69. drawMenu = function()
  70. clear()
  71. term.setCursorPos(17,2)
  72. print("DoorOS installer")
  73. term.setCursorPos(1, 4)
  74. print("Waehle die Aktion")
  75. print("")
  76. button()
  77. print("Auf die Festplatte installieren")
  78. print("")
  79. print("Betriebssystem entfernen ")
  80. print("")
  81. print("Exit ")
  82. running = true
  83. clickEvent()
  84. end
  85.  
  86. --CODE
  87. drawMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement