Advertisement
Guest User

ButtonExample

a guest
Oct 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. os.loadAPI("touchpoint")
  2. local t = touchpoint.new("top")
  3. t:add("left", nil, 2, 2, 14, 11, colors.red, colors.lime)
  4. t:add("right", nil, 16, 2, 28, 11, colors.red, colors.lime)
  5. t:draw()
  6. while true do
  7. local event, p1 = t:handleEvents(os.pullEvent())
  8. if event == "button_click" then
  9. t:toggleButton(p1)
  10. rs.setOutput(p1, not rs.getOutput(p1))
  11. end
  12. sleep(0.1)
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement