Advertisement
Guest User

startup

a guest
Jan 9th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. shell.run("monitor top pro")
  2. mon = peripheral.wrap("top")
  3. mon.setCursorPos(1,1)
  4. mon.write("Disponibilite :")
  5. mon.setCursorPos(1,2)
  6. mon.write("patates")
  7. mon.setCursorPos(9,4)
  8. mon.write("8")
  9. mon.setCursorPos(9,5)
  10. mon.write("16")
  11. mon.setCursorPos(9,6)
  12. mon.write("32")
  13. mon.setCursorPos(9,7)
  14. mon.write("64")
  15.  
  16.  
  17. while true do
  18.     event , sides , xpos ,ypos = os.pullEvent("monitor_touch")
  19.     print("x pos ="..xpos)
  20.     print("y pos ="..ypos)
  21.    
  22.     if ((xpos>6) and (xpos<14)) and (ypos==4) then
  23.       p8()
  24.     end
  25.    
  26.     if ((xpos>6) and (xpos<14)) and (ypos==5) then
  27.       p16()
  28.     end
  29.    
  30.     if ((xpos>6) and (xpos<14)) and (ypos==6) then
  31.       p32()
  32.     end
  33.    
  34.     if ((xpos>6) and (xpos<14)) and (ypos==7) then
  35.       p64()
  36.     end
  37.    
  38.   end
  39.  
  40. function p16()
  41.         redstone.setOutput("back", true)
  42.         sleep(2)
  43.         redstone.setOutput("back", false)
  44. end
  45.  
  46. function p8()
  47.     redstone.setOutput("left", true)
  48.     sleep(2)
  49.     redstone.setOutput("left", false)
  50. end
  51.  
  52. function p32()
  53.     redstone.setOutput("right", true)
  54.     sleep(2)
  55.     redstone.setOutput("right", false)
  56. end
  57.  
  58. function p64()
  59.     redstone.setOutput("bottom", true)
  60.     sleep(2)
  61.     redstone.setOutput("bottom", false)
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement