Advertisement
Guest User

interface_2

a guest
Nov 17th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.42 KB | None | 0 0
  1. mon = peripheral.wrap("bottom")
  2. rednet.open("right")
  3. term.setBackgroundColor(32768)
  4. mon.setBackgroundColor(32768)
  5. mon.clear()
  6. term.redirect(mon)
  7. mon.setTextScale(0.99)
  8. mon.setTextColor(32768)
  9. paintutils.drawBox(2,22,8,23,128)
  10. paintutils.drawBox(50,22,56,23,128)
  11. paintutils.drawFilledBox(2,4,28,8.5,256)
  12. paintutils.drawBox(2,4,28,8.5,128)
  13. mon.setCursorPos(4,6)
  14. mon.setBackgroundColor(256)
  15. mon.write("Cola")
  16. paintutils.drawFilledBox(2,10,28,14,256)
  17. paintutils.drawBox(2,10,28,14,128)
  18. mon.setCursorPos(4,12)
  19. mon.setBackgroundColor(256)
  20. mon.write("Lemon")
  21. paintutils.drawFilledBox(2,16,28,20,256)
  22. paintutils.drawBox(2,16,28,20,128)
  23. mon.setCursorPos(4,18)
  24. mon.setBackgroundColor(256)
  25. mon.write("Orange")
  26. paintutils.drawFilledBox(30,4,56,8.5,256)
  27. paintutils.drawBox(30,4,56,8.5,128)
  28. mon.setCursorPos(32,6)
  29. mon.setBackgroundColor(256)
  30. mon.write("Fraise")
  31.  
  32. paintutils.drawFilledBox(30,10,56,14,256)
  33. paintutils.drawBox(30,10,56,14,128)
  34. mon.setCursorPos(32,12)
  35. mon.setBackgroundColor(256)
  36. mon.write("Cerise")
  37.  
  38. paintutils.drawFilledBox(30,16,56,20,256)
  39. paintutils.drawBox(30,16,56,20,128)
  40. mon.setCursorPos(32,18)
  41. mon.setBackgroundColor(256)
  42. mon.write("Raisin")
  43.  
  44. while true do
  45.   event, side, x, y = os.pullEvent("monitor_touch")
  46.   mon.setCursorPos(1,1)
  47.   mon.setBackgroundColor(32768)
  48.   mon.setTextColor(1)
  49.   mon.clearLine(1)
  50.    if x > 2 and x < 28 and y > 4 and y < 8.5 then
  51.      -- mon.setCursorPos(1,1)
  52.      -- mon.write("Burger")
  53.      rednet.send(1561,"Cola")
  54.    end  
  55.    if x > 2 and x < 28 and y > 10 and y < 14 then
  56.      -- mon.setCursorPos(1,1)
  57.      -- mon.write("Cheese Burger")
  58.      rednet.send(1561,"Lemon")
  59. end
  60. if x > 2 and x < 28 and y > 16 and y < 20 then
  61.  -- mon.setCursorPos(1,1)
  62.  -- mon.write("Deluxe Cheese Burger")
  63.  rednet.send(1561,"Orange")
  64. end
  65. if x > 30 and x < 56 and y > 4 and y < 8.5 then
  66.  -- mon.setCursorPos(1,1)
  67.  -- mon.write("Bacon Burger")
  68.  rednet.send(1561,"Fraise")
  69. end
  70. if x > 30 and x < 56 and y > 10 and y < 14 then
  71.  -- mon.setCursorPos(1,1)
  72.  -- mon.write("Onion Burger")
  73.  rednet.send(1561,"Cerise")
  74. end
  75. if x > 30 and x < 56 and y > 16 and y < 20 then
  76.  -- mon.setCursorPos(1,1)
  77.  -- mon.write("McPam")
  78.  rednet.send(1561,"Raisin")
  79. end  
  80. if x > 2 and x < 8 and y > 21 and y < 24 then
  81.   mon.clear()
  82.   shell.run('interface')
  83. end
  84. if x > 50 and x < 56 and y > 21 and y < 24 then
  85.   mon.clear()
  86.   shell.run('interface_3')
  87. end  
  88. end            
  89. term.redirect(term.native())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement