Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("monitor top pro")
- mon = peripheral.wrap("top")
- mon.setCursorPos(1,1)
- mon.write("Disponibilite :")
- mon.setCursorPos(1,2)
- mon.write("patates")
- mon.setCursorPos(9,4)
- mon.write("8")
- mon.setCursorPos(9,5)
- mon.write("16")
- mon.setCursorPos(9,6)
- mon.write("32")
- mon.setCursorPos(9,7)
- mon.write("64")
- function p16()
- redstone.setOutput("back", true)
- sleep(3)
- redstone.setOutput("back", false)
- end
- function p8()
- redstone.setOutput("left", true)
- sleep(5)
- redstone.setOutput("left", false)
- end
- function p32()
- redstone.setOutput("right", true)
- sleep(4.5)
- redstone.setOutput("right", false)
- end
- function p64()
- redstone.setOutput("bottom", true)
- sleep(1.5)
- redstone.setOutput("bottom", false)
- end
- while true do
- event , sides , xpos ,ypos = os.pullEvent("monitor_touch")
- print("x pos ="..xpos)
- print("y pos ="..ypos)
- if ((xpos>6) and (xpos<14)) and (ypos==4) then
- p8()
- end
- if ((xpos>6) and (xpos<14)) and (ypos==5) then
- p16()
- end
- if ((xpos>6) and (xpos<14)) and (ypos==6) then
- p32()
- end
- if ((xpos>6) and (xpos<14)) and (ypos==7) then
- p64()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement