Advertisement
thegreatstudio

Orangeos

May 15th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.46 KB | None | 0 0
  1. function os.programs()
  2. term.setBackgroundColor(colors.cyan)
  3. term.clear()
  4. paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
  5. term.setCursorPos(1, 3)
  6. term.setBackgroundColor(colors.cyan)
  7. term.setTextColor(colors.black)
  8. print("[File Manager]")
  9. term.setCursorPos(1, 1)
  10. term.setTextColor(colors.black)
  11. term.setBackgroundColor(colors.lightGray)
  12. print("[Exit]")
  13. term.setCursorPos(1, 4)
  14. term.setTextColor(colors.black)
  15. term.setBackgroundColor(colors.cyan)
  16. print("[Taco Text Editor]")
  17. term.setCursorPos(1, 5)
  18. term.setTextColor(colors.black)
  19. term.setBackgroundColor(colors.cyan)
  20. print("[Install Software]")
  21. term.setCursorPos(1, 6)
  22. term.setTextColor(colors.black)
  23. term.setBackgroundColor(colors.cyan)
  24. print("[Update Software]")
  25. term.setCursorPos(39, 1)
  26. term.setTextColor(colors.black)
  27. term.setBackgroundColor(colors.lightGray)
  28. print("Version "..build) -- Version of the OS
  29. while true do
  30. local event, button, X, Y = os.pullEvent("mouse_click")
  31. if event == "mouse_click" then
  32. if X >= 1 and X <= 20 and Y == 3 and button == 1 then
  33. shell.run("//.orange/gfb")
  34. elseif X >= 1 and X <= 19 and Y == 1 and button == 1 then
  35. break
  36. elseif X >= 1 and X <= 18 and Y == 4 and button == 1 then
  37. shell.run("//.orange/taco")
  38. elseif X >= 1 and X <= 17 and Y == 5 and button == 1 then
  39. shell.run("//.orange/app/install.o")
  40. elseif X >= 1 and X <= 16 and Y == 6 and button == 1 then
  41. print("Updating!")
  42. while true do
  43. resp = http.get("http://pastebin.com/raw.php?i=iM6Zw0XZ")
  44. if resp then
  45. fileHandler=fs.open("//.orange/orange", "w")
  46. fileHandler.write(resp.readAll())
  47. fileHandler.close()
  48. os.sleep(1)
  49. os.reboot()
  50. else
  51. print("Update Failed! Cuase: NO internet connection")
  52. os.sleep(1)
  53. os.reboot()
  54. end
  55. end
  56. end
  57. end
  58. end
  59. end
  60.  
  61. function icon1()
  62. image = paintutils.loadImage("//.orange/icon/icon1")
  63. paintutils.drawImage(image, 1, 3)
  64. end
  65.  
  66. screenX, screenY = term.getSize()
  67.  
  68.  
  69. function main()
  70. term.clear()
  71. term.setBackgroundColor(colors.cyan)
  72. term.clear()
  73. paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
  74. term.setCursorPos(1, 1)
  75. term.setTextColor(colors.black)
  76. print("[Test]")
  77. end
  78.  
  79. Codename = "Juice"
  80. build = "1.6"
  81. osname = "Orange OS"
  82. desc = "A fruit that can change Computercraft!"
  83.  
  84. os.loadAPI("//.orange/oos")
  85.  
  86.  
  87.  
  88. while true do
  89. term.clear()
  90. term.setBackgroundColor(colors.cyan)
  91. term.clear()
  92. paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
  93. term.setCursorPos(39, 1)
  94. term.setTextColor(colors.black)
  95. print("Version "..build)
  96. term.setCursorPos(1, 1)
  97. term.setTextColor(colors.black)
  98. print("[Orange]")
  99. local event, button, X, Y = os.pullEvent("mouse_click")
  100. if event == "mouse_click" then
  101. if X >= 1 and X <= 10 and Y == 1 and button == 1 then
  102. paintutils.drawLine(1, 1, 6, 1, colors.gray)
  103. paintutils.drawLine(1, 2, 8, 2, colors.gray)
  104. paintutils.drawLine(1, 3, 8, 3, colors.gray)
  105. paintutils.drawLine(1, 4, 8, 4, colors.gray)
  106. paintutils.drawLine(1, 5, 8, 5, colors.gray)
  107. term.setCursorPos(1, 1)
  108. print("[Orange]")
  109. print("Run")
  110. print("[Programs]")
  111. print("Restart")
  112. print("Shutdown")
  113.  
  114. b = false
  115.  
  116. local event, button, X, Y = os.pullEvent("mouse_click")
  117. if event == "mouse_click" then
  118. if X >= 1 and X <= 6 then
  119. term.setBackgroundColor(colors.cyan)
  120. term.clear()
  121. paintutils.drawLine(1, 1, screenX, 1, colors.lightGray)
  122. term.setCursorPos(1, 1)
  123. term.setTextColor(colors.black)
  124. if Y == 2 then
  125. print("Run")
  126. input = read()
  127. shell.run(input)
  128. elseif Y == 3 then
  129. os.programs()
  130. elseif Y == 4 then
  131. os.reboot()
  132. elseif Y == 5 then
  133. os.shutdown()
  134. end
  135. end
  136. end
  137. end
  138. end
  139. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement