Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Constants
- RS = 'right'
- ConstSwitch = colors.red -- Silo main lights on/off from RS bundle
- ConstTone = colors.green -- Trigger note blocks
- lightSequence = {1,3,7,15,31,63,127,255,511,1023,2047,4095}
- -- Global Variables
- BLight = false -- Start with the lights off
- redstone.setBundledOutput(RS, 0)
- function doLightOn()
- for i=1,12 do
- print("lightSequence = "..lightSequence[i])
- redstone.setBundledOutput(RS, lightSequence[i]+ ConstTone)
- sleep(.75)
- redstone.setBundledOutput(RS, lightSequence[i])
- end
- end -- doLightOn
- function doLightOff()
- for i=11,1,-1 do
- print("lightSequence = "..lightSequence[i])
- redstone.setBundledOutput(RS, lightSequence[i] + ConstTone)
- sleep(.75)
- redstone.setBundledOutput(RS, lightSequence[i])
- end
- redstone.setBundledOutput(RS, ConstTone)
- sleep(.75)
- redstone.setBundledOutput(RS, 0)
- end -- doLightOff
- while true do
- if bit.band(redstone.getBundledInput(RS), ConstSwitch) == ConstSwitch then
- if BLight == false then
- doLightOn()
- BLight = true
- end -- if
- else
- if BLight == true then
- doLightOff()
- BLight = false
- end -- if
- end -- if
- print ("BLight = ", BLight)
- sleep(2)
- end -- main loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement