Creeper9207

COS:desktop

Feb 21st, 2015
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. startMenu = 0
  2. RCM = 0
  3. function draw()
  4. dbfr = fs.open("/home/gui/data", "r")
  5. x, z = term.getSize()
  6. color = dbfr.readAll()
  7. if color == "orange" then
  8. paintutils.drawFilledBox(1, 1, x, z, colors.orange)
  9. else
  10. paintutils.drawFilledBox(1, 1, x, z, colors.black)
  11. end
  12. dbfr.close()
  13. --paintutils.drawFilledBox(1, 1, 6, 19, colors.orange)
  14. paintutils.drawFilledBox(x-10, 1, x, z, colors.red)
  15. paintutils.drawFilledBox(1, 1, x, 1, colors.gray )
  16. paintutils.drawFilledBox(1, 1, 7, 1, colors.lightGray )
  17. paintutils.drawFilledBox(x-8, 3, x-2, 7, colors.lightGray)
  18. term.setCursorPos(x-9, 8)
  19. term.setBackgroundColor(colors.red)
  20. term.write("customize")
  21. term.setCursorPos(1, 1)
  22. term.setBackgroundColor(colors.gray)
  23. term.setTextColor( colors.white )
  24. term.write("[Start]")
  25. term.setBackgroundColor( colors.gray )
  26. term.setCursorPos(z - 5, 1)
  27. term.write("Storage Used: " .. 1048576 - fs.getFreeSpace("/") .. "/1048576")
  28. end
  29. function drawMenu()
  30. paintutils.drawFilledBox(1, 2, 7, 6, colors.lightGray)
  31. term.setCursorPos(1, 2)
  32. term.write("[Term]")
  33. term.setCursorPos(1, 3)
  34. term.write("[Files]")
  35. term.setCursorPos(1, 4)
  36. term.write("[Quest]")
  37. term.setCursorPos(1, 5)
  38. term.write("[Text]")
  39. end
  40. function drawRCM(x, y)
  41. paintutils.drawFilledBox(x, y, x+7, y+6, colors.lightGray)
  42. end
  43. draw()
  44. while true do
  45. event, button, x, y = os.pullEvent()
  46. if event then
  47. if button == 1 then
  48. x2, y2 = term.getSize()
  49. if x < 7 and y == 1 then
  50. if startMenu == 0 then
  51. drawMenu()
  52. startMenu = 1
  53. else
  54. draw()
  55. startMenu = 0
  56. end
  57. elseif x < 7 and y == 2 and startMenu == 1 then
  58. x, y = term.getCursorPos()
  59. paintutils.drawFilledBox(1, 1, x, y, colors.black)
  60. shell.run("clear")
  61. shell.run("/home/term term")
  62. elseif x < 7 and y == 3 and startMenu == 1 then
  63. a = shell.run("/home/Files")
  64. draw()
  65. elseif x < 7 and y == 4 and startMenu == 1 then
  66. a = shell.run("/home/apps/quest")
  67. draw()
  68. elseif x < 7 and y == 5 and startMenu == 1 then
  69. a = shell.run("/home/luaide")
  70. draw()
  71. elseif x > x2-10 and y < 8 and y > 5 then
  72. a = shell.run("/home/gui/customize")
  73. end
  74. elseif button == 2 then
  75. if RCM == 0 then
  76. --drawRCM(x, y)
  77. RCM = 1
  78. else
  79. --draw()
  80. RCM = 0
  81. end
  82. end
  83. end
  84. end
  85. dbf = fs.open("/home/gui/data", "w")
Advertisement
Add Comment
Please, Sign In to add comment