So im making a door into a mall with cc. I am using a i/o of redstone to make it. It checks for a redstone signal on the bottom and if it is true then it turns pistons off. My question. How do i make the program wait until there is a redstone signal.
How do i make a program wait before x == true
Started by AnDwHaT5, Mar 21 2013 12:53 PM
5 replies to this topic
#1
Posted 21 March 2013 - 12:53 PM
#2
Posted 21 March 2013 - 01:07 PM
os.pullEvent("redstone") will wait for any redstone change.
#3
Posted 21 March 2013 - 01:09 PM
Just so you know, you can do this with a "Memory Cell" in redstone logic...
Like this:
Like this:
x = false
while x == false do
input = rs.getInput("SIDE")
if input == true then
x = true
while x == true do
rs.setOutput("SIDE TO PISTON", true)
b = rs.getInput("SAME SIDE AS INPUT")
if b == true then -- have a seperate wire that connects to this side, as with the INPUT variable
shell.run("programname")
end
end
end
end
#5
Posted 21 March 2013 - 01:31 PM
No, once any redstone current is detected on ANY side, it will fire the event and return the parameters if any are specified.
#6
Posted 21 March 2013 - 03:24 PM
os.pullEvent("redstone") only waits for any redstone signal change, so you need to keep calling it, and check the signal each time, until you get the signal you want.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users












