Advertisement
machasins

Daylight Sensor indoors

Feb 11th, 2023
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. function mainLoop(input)
  2.     while true
  3.     do
  4.         time = ((os.time() + 18) % 24) * 1000
  5.         if time >= 13670 and time <= 22330 then
  6.             redstone.setOutput(input, false)
  7.         else
  8.             redstone.setOutput(input, true)
  9.         end
  10.         os.sleep(0.1)
  11.     end
  12. end
  13.  
  14. args = { ... }
  15. inputSide = args[1]
  16.  
  17. mainLoop(inputSide)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement