Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. -- now to handle our button clicks!
  2. os.loadAPI("redbutton")
  3. local button = redbutton.addButton(
  4. 5,5,15,2,colors.white,colors.blue,"Click Me!")
  5. -- now for a while loop for checking click events
  6.  
  7. while true do
  8. -- ok now lets check if our button is pressed
  9. ev = {os.pullEvent()} -- make sure your event is in a table
  10.  
  11. -- now to pass our event table onto our button
  12. if(redbutton:pressed(ev))then
  13. -- exit the program if our button was pressed
  14. break
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement