Advertisement
Mackan90096

gghd

Mar 29th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. bar1 = paintutils.loadImage(".bar1")
  2. logo = paintutils.loadImage(".logo")
  3. icon = paintutils.loadImage(".icon")
  4. scrollbar = paintutils.loadImage(".scrollbar")
  5. scrollpoint1 = paintutils.loadImage(".scrollpoint1")
  6. scrollpoint2 = paintutils.loadImage(".scrollpoint2")
  7. tBarC = 8
  8. tBartC = 1
  9. backColor = 1
  10. scroll = 0
  11. --Desktop
  12. term.setBackgroundColor(backColor)
  13. term.clear()
  14.  
  15. slc = 0
  16.  
  17. function titleBar()
  18. term.setCursorPos(1,1)
  19. term.setBackgroundColor(tBarC)
  20. term.setTextColor(tBartC)
  21. term.clearLine()
  22. term.setCursorPos(3,1)
  23. print("[Begin]")
  24. end
  25.  
  26. function drawDesktop()
  27. term.setBackgroundColor(backColor)
  28. term.clear()
  29. paintutils.drawImage(logo,1,1)
  30. paintutils.drawImage(icon,2,3)
  31. titleBar()
  32. end
  33.  
  34. function drawMenu1()
  35. term.setTextColor(256)
  36. term.setBackgroundColor(128)
  37. term.setCursorPos(1,2)
  38. print(" ")
  39. term.setCursorPos(1,3)
  40. print(" Shop ")
  41. term.setCursorPos(1,4)
  42. print(" Reboot ")
  43. term.setCursorPos(1,5)
  44. print(" Desktop ")
  45. term.setCursorPos(1,6)
  46. print(" ")
  47. end
  48.  
  49. function shop()
  50. slc = 2
  51. term.setCursorPos(1,1)
  52. term.setBackgroundColor(tBarC)
  53. term.setTextColor(tBartC)
  54. term.clearLine()
  55. term.setCursorPos(3,1)
  56. print("[List]")
  57.  
  58.  
  59.  
  60. end
  61.  
  62. function shoplist()
  63. slc = 3
  64. term.clear()
  65. term.setCursorPos(1,1)
  66. print("Item1")
  67. term.setCursorPos(1,2)
  68. print("Item2")
  69. end
  70.  
  71.  
  72.  
  73. drawDesktop()
  74.  
  75. while true do
  76. local event, button, X, Y = os.pullEventRaw()
  77. if slc == 0 then
  78. if event == "mouse_click" then
  79. if X >= 2 and X <= 8 and Y == 1 and button == 1 then
  80. drawMenu1()
  81. slc = 1
  82. elseif X >= 2 and X <= 5 and Y >= 3 and Y <= 9 and button == 1 then
  83. shell.run("file")
  84. elseif X >= 1 and Y >= 2 and button == 2 then slc = 2
  85.  
  86. else
  87. drawDesktop()
  88. end
  89. end
  90. elseif slc == 1 then
  91. if X >= 1 and X <= 11 and button == 1 and Y == 3 then slc = 0
  92. shop()
  93. elseif X >= 1 and X <= 11 and Y == 4 and button == 1 then slc = 0
  94. os.reboot()
  95. elseif X >= 1 and X <= 11 and Y == 5 and button == 1 then slc = 0
  96. drawDesktop()
  97. else slc = 0
  98. drawDesktop()
  99.  
  100. end
  101. elseif slc == 2 then
  102. if X >= 1 and X <= 11 and Y == 1 and button == 1 then slc = 1
  103. shoplist()
  104. else slc = 0
  105. drawDesktop()
  106. end
  107. elseif slc == 3 then
  108. if X >= 1 and X <= 15 and Y == 1 and button == 1 then slc = 3
  109. rednet.send(13, "1")
  110. elseif X >= 48 and X <= 49 and Y == 18 and button == 1 then slc = 3
  111. end
  112. end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement