Telerabi

Lampensteuerung (smarth.)

Jul 8th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. rednet.open("right")
  2. rs.setOutput("bottom", false)
  3.  
  4. while true do
  5.     id, message = rednet.receive()
  6.     if message == "SternAn" then
  7.         while true do
  8.             if math.random(2) <= 1 then
  9.                 rs.setOutput("bottom", true)
  10.                 sleep(1)
  11.             else
  12.                 rs.setOutput("bottom", false)
  13.                 sleep(1)
  14.             end
  15.             if redstone.getInput("top") then
  16.                 rs.setOutput("bottom", false)
  17.                 break
  18.             end
  19.         end
  20.     elseif message == "LichtAn" then
  21.         rs.setOutput("bottom", true)
  22.     elseif message == "LichtAus" then
  23.         rs.setOutput("bottom", false)
  24.     end
  25. end
Add Comment
Please, Sign In to add comment