Advertisement
ecco7777

CC Desktop Redstone Control

Jul 21st, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. m=peripheral.wrap("back")
  2. a=0
  3. b=0
  4. c=0
  5.  
  6. while true do
  7. term.setBackgroundColor(colors.black)
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. term.setTextColor(colors.white)
  11.  
  12. if a==0 then
  13. rs.setOutput("right",true)
  14. term.setBackgroundColor(colors.red)
  15. term.write("Wand nach hinten")
  16. else
  17. rs.setOutput("right",false)
  18. term.setBackgroundColor(colors.green)
  19. term.write("Wand nach vorne")
  20. end
  21.  
  22. term.setCursorPos(1,3)
  23. if b==0 then
  24. rs.setOutput("top",false)
  25. term.setBackgroundColor(colors.red)
  26. term.write("Alles Anhalten")
  27. else
  28. rs.setOutput("top",true)
  29. term.setBackgroundColor(colors.green)
  30. term.write("Betriebsbereit")
  31. end
  32.  
  33. term.setCursorPos(1,5)
  34. if c==0 then
  35. rs.setOutput("left",true)
  36. term.setBackgroundColor(colors.red)
  37. term.write("Tür zu")
  38. else
  39. rs.setOutput("left",false)
  40. term.setBackgroundColor(colors.green)
  41. term.write("Tür auf")
  42. end
  43. print(1)
  44. event, side, xPos, yPos = os.pullEvent("mouse_click")
  45. print(1.5)
  46. if yPos==1 then
  47. if a==0 then
  48. a=1
  49. else
  50. a=0
  51. end
  52. end
  53. if yPos==3 then
  54. if b==0 then
  55. b=1
  56. else
  57. b=0
  58. end
  59. end
  60. if yPos==5 then
  61. if c==0 then
  62. c=1
  63. else
  64. c=0
  65. end
  66. end
  67. print(2)
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement