This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Akrej's profile picture

How can I wait for Redstone

Started by Akrej, 31 March 2017 - 07:35 PM
Akrej #1
Posted 31 March 2017 - 09:35 PM
Greetings

How can I wait for a signal from Redstone

if redstone.getInput("bottom") then
sleep(3)
os.shutdown()

One part of the program
valithor #2
Posted 01 April 2017 - 02:58 AM

while true do
  os.pullEvent("redstone") --# redstone event is fired anytime redstone changes near the computer
  if rs.getInput("bottom") then --# checking if the input is on the bottom
    break --# stopping the loop so we can do stuff
  end
end