Posted 27 June 2015 - 03:38 PM
I'm trying to create a program that will verify whether a specific color input is on/off and if its on/off to provide or turn off power to a specific wire. It seems to work fine by itself, but when a loop is added it stops looping after the switch gets turned on/off.
This is what I have:
also tried this which works until power turns on/off once then it doesn't work
This is what I have:
while true do
sleep(0)
if redstone.getBundledInput("left") == 512 then
redstone.setBundledOutput("left", 16384, red)
print("House 1 Lighting is On.")
sleep(2)
elseif redstone.getBundledInput("left") == 0
redstone.setBundledOutput("left, 0, red)
print("House 1 Lighting is Off.")
sleep(2)
end
end
also tried this which works until power turns on/off once then it doesn't work
while true do
event = os.pullEvent()
if event == "redstone" and rs.getBundledInput("left") == 512 then
redstone.setBundledOutput("left", 16384, red)
print("House 1 Lighting is On.")
sleep(0)
end
if event == "redstone" and rs.getBundledInput("left") == 0 then
redstone.setBundledOutput("left", 0, red)
print("House 1 Lighting is Off.")
end
sleep(0)
end