Posted 30 June 2016 - 10:52 PM
So i am creating a 2 part elevator program using frames that works but not the way i want it to. The way is it supposed to work is that when i hit the call button from a floor it should go straight to that floor in which the call button was pushed. Instead it stops at each floor. I do know that the problem is the while statement but for the life of me i cannot firgure out how to isolate each of the functions. The green wire is for going up and the rred wire is for going down. All of the other wires are just inputs and sensors.
local side = "left"
function flr1()
if redstone.testBundledInput(side,colors.black) == true then
redstone.setBundledOutput(side,colors.red)
sleep(3)
end
if redstone.testBundledInput(side,colors.white) == true then
redstone.setBundledOutput(side,0)
end
--sleep(.1)
end
function flr2()
if redstone.testBundledInput(side,colors.gray) == true and
redstone.testBundledInput(side,colors.white) == true then
redstone.setBundledOutput(side,colors.green)
sleep(3)
end
if redstone.testBundledInput(side,colors.gray) == true and
redstone.testBundledInput(side,colors.cyan) == true then
redstone.setBundledOutput(side,colors.red)
sleep(3)
end
if redstone.testBundledInput(side,colors.lightGray) == true then
redstone.setBundledOutput(side,0)
end
--sleep(1)
end
function flr3()
if redstone.testBundledInput(side,colors.blue) == true then
redstone.setBundledOutput(side,colors.green)
sleep(3)
end
if redstone.testBundledInput(side,colors.cyan) == true then
redstone.setBundledOutput(side,0)
end
--sleep(.1)
end
while true do
flr1()
flr2()
flr3()
sleep(.1)
end