Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. os.loadAPI("touchpoint")
  2.  
  3. local t = touchpoint.new("top")
  4.  
  5. t:add("lamp", nil, 2, 2, 14, 11, colors.red, colors.lime)
  6.  
  7. t:draw()
  8.  
  9. while true do
  10. local event, p1 = t:handleEvents(os.pullEvent()), output
  11. if event == "button_click" then
  12. t:toggleButton(p1)
  13.  
  14. local color
  15. if p1 == "lamp" then
  16. color = colors.red
  17. end
  18.  
  19. local test = redstone.testBundledInput("back", color)
  20. if test then
  21. output = bit.band(bit.bnot(color), redstone.getBundledOutput("back"))
  22. else
  23. output = bit.band(color, redstone.getBundledOutput("back"))
  24. end
  25.  
  26. rs.setBundledOutput(p1, output)
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement