Advertisement
Guest User

test

a guest
Feb 7th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("right")
  3. o = "back"
  4. rec = false
  5. m.clear()
  6.  
  7. function fillTable()
  8.   button.setTable("Red", red, 10,20,3,5)
  9.   button.setTable("Green", green, 10,20,7,9)
  10.   button.screen()
  11. end
  12.  
  13. function getClick()
  14.   event,side,x,y = os.pullEvent("monitor_touch")
  15.   button.checkxy(x,y)
  16. end
  17.  
  18. function red()
  19.   if rec then
  20.     print("red is now inactive")
  21.     rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.red))
  22.   else
  23.     print("red is now active")
  24.     rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.red))
  25.   end
  26. button.toggleButton("Red")
  27. rec = not rec
  28. end
  29.  
  30. function green()
  31.   print("green")
  32. end
  33.  
  34. fillTable()
  35. button.heading("Test Programm")
  36. button.label(1,4,"Skeleton")
  37. rs.setBundledOutput(o,0)
  38.  
  39. while true do
  40.   getClick()
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement