while true do
os.pullEvent("redstone")
if rs.getInput("left") then -- check the LEFT input
-- do something
end
if rs.getInput("right") then -- check the RIGHT input
-- do something
end
end
in startup, how do I prevent one from running while another one is on?
Basically, I have 2 elevators using same blocks of code, for opposite directions (when one goes up, another one goes down),
and 4 buttons with 2 rs signals. I want, when one button is clicked (one side is activated) that there is no chance that program will receive other input
for the duration of program, and possibly few seconds more, as opposite signals can mess up frames badly.
2 blocks: (breakers, deployers, motors)
term.clear()
term.setCursorPos(1,1)
--[[
for i=1,18 do
rs.setBundledOutput("back", 0)
sleep(0.1)
rs.setBundledOutput("back", 16)
sleep(0.1)
rs.setBundledOutput("back", 0)
rs.setBundledOutput("back", 2048)
sleep (0.5)
rs.setBundledOutput("back", 0)
sleep(0.3)
i=i+1
end
--]]
--[[
for i=1,18 do
rs.setBundledOutput("back", 0)
sleep(0.1)
rs.setBundledOutput("back", 32768)
sleep(0.1)
rs.setBundledOutput("back", 0) ---- idk if this is needed also, second 0 should affect both
rs.setBundledOutput("back", 8192)
sleep (0.5)
rs.setBundledOutput("back", 0)
sleep(0.3)
i=i+1 ------ idk if this is needed
end
--]]
Oh, and if possible, tell me how to change headline after posting, so i can put [closed] when needed, tY :)/>