Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- monitor=peripheral.wrap("top")
- function numberOnScreen()
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write("[0]|[1]")
- monitor.setCursorPos(1,2)
- monitor.write("[2]|[3]")
- monitor.setCursorPos(1,3)
- --monitor.write("[4]|[5]")
- monitor.setCursorPos(1,4)
- --monitor.write("[6]|[7]")
- monitor.setCursorPos(1,5)
- --monitor.write("[8]|[9]")
- end
- function touchPosScanner()
- t=2
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- --[0] pushed
- if(y==1 and (x==1 or x==2 or x==3)) then
- rs.setBundledOutput("back",colors.white)
- sleep(t)
- rs.setBundledOutput("back",0)
- end
- --[1] pushed
- if(y==1 and (x==4 or x==5 or x==6)) then
- rs.setBundledOutput("back",colors.green)
- sleep(t)
- rs.setBundledOutput("back",0)
- end
- --[2] pushed
- if(y==2 and (x==1 or x==2 or x==3)) then
- rs.setBundledOutput("back",colors.red)
- sleep(t)
- rs.setBundledOutput("back",0)
- end
- --[3] pushed
- if(y==2 and (x==4 or x==5 or x==6)) then
- rs.setBundledOutput("back",colors.pink)
- sleep(t)
- rs.setBundledOutput("back",0)
- end
- end
- end
- numberOnScreen()
- touchPosScanner()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement