Advertisement
Guest User

gui

a guest
Jul 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.48 KB | None | 0 0
  1. --variables
  2. version = 4
  3. running = true
  4.  
  5. _dt = paintutils.loadImage("dt")
  6. _ms = 0
  7. --functions
  8. clear = function()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. end
  12. pr = function()
  13. term.setCursorPos(1,10)
  14. term.setBackgroundColor(colors.white)
  15. term.setTextColor(colors.lime)
  16. print("[notepad]")
  17. end
  18.  
  19. drawDeskTop = function()
  20. term.setBackgroundColor(colors.blue)
  21. clear()
  22. paintutils.drawImage(_dt, 1, 1)
  23. end
  24.  
  25. drawMenu = function()
  26. term.setCursorPos(1,2)
  27. term.setBackgroundColor(colors.white)
  28. term.setTextColor(colors.red)
  29. print("[afsluiten]")
  30. end
  31. drawMenu2 = function()
  32. term.setCursorPos(1,3)
  33. term.setBackgroundColor(colors.white)
  34. term.setTextColor(colors.lime)
  35. print("[cmd]")
  36. end
  37. drawMenu3 = function()
  38. term.setCursorPos(1,4)
  39. term.setBackgroundColor(colors.white)
  40. term.setTextColor(colors.lime)
  41. print("[chat]")
  42. end
  43. music = function()
  44. term.setCursorPos(1,6)
  45. term.setBackgroundColor(colors.white)
  46. term.setTextColor(colors.lime)
  47. print("[muziek]")
  48. end
  49. drawMenu4 = function()
  50. term.setCursorPos(1,7)
  51. term.setBackgroundColor(colors.white)
  52. term.setTextColor(colors.lime)
  53. print("[instellingen]")
  54. end
  55. instellingen = function()
  56. term.setCursorPos(1,8)
  57. term.setBackgroundColor(colors.white)
  58. term.setTextColor(colors.lime)
  59. print("[software update]")
  60. end
  61. drawTaskBar = function()
  62. term.setCursorPos(1, 1)
  63. term.setBackgroundColor(colors.blue)
  64. term.clearLine()
  65. term.setCursorPos(1,1)
  66. term.setBackgroundColor(colors.lime)
  67. term.setTextColor(colors.white)
  68. term.write("[menu]")
  69. end
  70. menuS = function()
  71. term.setCursorPos(1,5)
  72. term.setBackgroundColor(colors.white)
  73. term.setTextColor(colors.red)
  74. print("[menu sluiten]")
  75. end
  76. ect = function()
  77. term.setCursorPos(1,9)
  78. term.setBackgroundColor(colors.white)
  79. term.setTextColor(colors.lime)
  80. print("[achtergrond]")
  81. end
  82. stop = function()
  83. clear()
  84. running = false
  85. os.shutdown()
  86. end
  87. runtime = function()
  88. while running do
  89. event, button, x ,y = os.pullEvent("mouse_click")
  90. if _ms == 0 and button == 1 and x < 7 and y == 1 then
  91. drawMenu()
  92. drawMenu2()
  93. drawMenu3()
  94. drawMenu4()
  95. menuS()
  96. music()
  97. _ms = 1
  98. elseif _ms == 1 and button == 1 and y == 2 and x < 7 then
  99. clear()
  100. term.setBackgroundColor(colors.white)
  101. term.setTextColor(colors.blue)
  102. term.setCursorPos(5,5)
  103. print("afsluiten")
  104. sleep(5)
  105. stop()
  106. elseif _ms == 1 and button == 1 and y == 3 and x < 7 then
  107. term.setCursorPos(1,1)
  108. term.clear()
  109. running = false
  110. shell.run("cmd")
  111. elseif _ms == 1 and button == 1 and y == 4 and x < 7 then
  112. running = false
  113. print("welkom bij de shatroom typ hier je naam")
  114. id = read()
  115. print("welkom")
  116. print(id)
  117. print("als je weer terug wild typ dat eerst /logout")
  118. print("en dan reboot")
  119. sleep(7)
  120. shell.run("chat join chatroom gebruiker")
  121. elseif _ms == 1 and button == 1 and y == 7 and x < 12 then
  122. instellingen()
  123. ect()
  124. pr()
  125. elseif _ms == 1 and button == 1 and y == 8 and x < 7 then
  126. running = false
  127. clear()
  128. sleep(1)
  129. shell.run("disk/newapps")
  130. os.reboot()
  131. elseif _ms == 1 and button == 1 and y == 5 and x < 7 then
  132. shell.run("gui")
  133. elseif _ms == 1 and button == 1 and y == 9 and x < 7 then
  134. shell.run("paint dt")
  135. sleep(1)
  136. shell.run("gui")
  137. elseif _ms == 1 and button == 1 and y == 6 and x < 7 then
  138. shell.run("dj play left")
  139. sleep(1)
  140. shell.run("gui")
  141. elseif _ms == 1 and button == 1 and y == 10 and x < 7 then
  142. print("notepad starten")
  143. textutils.slowPrint("als je een printer hebt kan je alles printen")
  144. sleep(5)
  145. shell.run("edit notepad")
  146. shell.run("gui")
  147. end
  148. end
  149. end
  150.  
  151.  
  152.  
  153.  
  154. init = function()
  155. drawDeskTop()
  156. drawTaskBar()
  157. runtime()
  158. end
  159.  
  160. --mainstuff
  161. init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement