Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Constants
- RSFlash = 'bottom'
- ConstDoor = colors.red -- Silo door open/closed read from RSInput bundle
- lightSequence = {3,6,12,9}
- -- Global Variables
- curLight = 1
- BDoor = false -- Start with the flashing light off and silo door closed
- function doFlash()
- print("lightSequence = ", lightSequence[curLight])
- redstone.setBundledOutput(RSFlash, lightSequence[curLight])
- curLight = curLight + 1
- if curLight > 4 then
- curLight = 1
- end
- end -- doFlash
- -- Main Loop
- while true do
- print ("RSFlash = ", redstone.getBundledInput(RSFlash))
- if bit.band(redstone.getBundledInput(RSFlash), ConstDoor) == ConstDoor then
- BDoor = true
- else
- BDoor = false
- end
- print ("BDoor = ", BDoor)
- if BDoor == true then
- doFlash()
- else
- redstone.setBundledOutput(RSFlash, 0)
- end
- sleep(.4)
- end -- main loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement