Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- mon.setBackgroundColor(colors.white)
- mon.clear()
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- if(event) then
- mon.setCursorPos(x, y)
- if(x==1 and y==1) then
- mon.setTextColor(colors.green)
- else
- mon.setTextColor(colors.red)
- end
- mon.write("*")
- sleep(0.25)
- end
- if(event and x==1 and y==1) then
- mon.setCursorPos(1, 3)
- mon.setTextColor(colors.green)
- mon.write("come in")
- rs.setOutput("right", true)
- sleep(1)
- rs.setOutput("right", false)
- else
- mon.setCursorPos(1, 3)
- mon.setTextColor(colors.red)
- mon.write("go away")
- sleep(1)
- end
- mon.clear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement