Advertisement
FelixBau

licht

Aug 25th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. -- Deckenbeleuchtung --
  2. local side = "top"
  3.  
  4. function drawPage()
  5. term.setTextColor(colors.black)
  6. term.setBackgroundColor(colors.blue)
  7. term.clear()
  8. term.setCursorPos(1,2)
  9. print(" ")
  10. term.setCursorPos(1,3)
  11. print("Licht an")
  12. term.setCursorPos(1,5)
  13. print("Licht aus")
  14. end
  15.  
  16. drawPage()
  17.  
  18. while true do
  19. local button,X,Y = os.pullEvent()
  20. if X >=1 and X <=10 and Y == 3 and button == 1 then
  21. redstone.setOutput(side,true)
  22. print("Licht ist an.")
  23. elseif X >=1 and X <=10 and Y == 5 and button == 1 then
  24. redstone.setOutput(side,false)
  25. print("Licht ist aus.")
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement