Nike622000

Tür Sensor

May 28th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. --    Piston Geheimtuer Standard Edition
  2. --           made by Nike622000
  3.  
  4. --weitergabe nicht gestattet
  5.  
  6. os.loadAPI("ocs/apis/sensor")
  7. sen = sensor.wrap("top")
  8.  
  9. local name1 = "Im_Skajo"
  10. local name2 = "korbi11"
  11. local name3 = "Andi467"
  12. local name4 = "Melonekopp"
  13. local name5 = "IVrogrez"
  14.  
  15. -- Output 1   = green wire
  16. -- Output 2   = yellow wire
  17.  
  18. -- Computer Input "front"
  19. term.clear()
  20. term.setTextColor(colors.white)
  21. term.setCursorPos(1,1)
  22. print("Piston Geheimtuer made by Nike622000")
  23. term.setCursorPos(1,2)
  24. print("+----------------------------------+")
  25. term.setCursorPos(1,6)
  26. print("+----------------------------------+")
  27. term.setCursorPos(11,7)
  28. term.setTextColor(colors.gray)
  29. print("Standard Edition")
  30.  
  31.     x=2
  32. while true do
  33.     i=0
  34. ziele = sen.getTargets()
  35. redstone.setOutput("back", false)
  36. for k,v in pairs(ziele) do
  37.   if v.Name == "Player" then
  38.     if k == name1 or k == name2 or k == name3 or k == name4 or k == name5 then
  39.     i=1
  40.     end
  41.   end
  42. end
  43.  
  44. if i == 1 and x == 2 then
  45. term.setTextColor(colors.lime)
  46. term.setCursorPos(15,4)
  47. print("Tuer auf")
  48. rs.setBundledOutput("front", colors.green)
  49. sleep(1)
  50. rs.setBundledOutput("front", 0)
  51. x=1
  52. end
  53.  
  54. if i == 1 and x == 1 then
  55. term.setTextColor(colors.lime)
  56. term.setCursorPos(15,4)
  57. print("Tuer auf")
  58. rs.setBundledOutput("front", 0)
  59. end
  60.  
  61. if i == 0 and x == 2 then
  62. term.setTextColor(colors.red)
  63. term.setCursorPos(15,4)
  64. print("Tuer zu ")
  65. rs.setBundledOutput("front", colors.combine(colors.green,colors.yellow))
  66. end
  67.  
  68. if i == 0 and x == 1 then
  69. term.setTextColor(colors.red)
  70. term.setCursorPos(15,4)
  71. print("Tuer zu ")
  72. rs.setBundledOutput("front", colors.green)
  73. sleep(1)
  74. rs.setBundledOutput("front", colors.combine(colors.green,colors.yellow))
  75. x=2
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment