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

(Question)How to make my computer wait for a Redstone Signal?

Started by Uch1ha_Sasuke, 17 June 2012 - 02:30 PM
Uch1ha_Sasuke #1
Posted 17 June 2012 - 04:30 PM
So i want my computer to wait for a redstone input when i run the program??
how do i do it?
MysticT #2
Posted 17 June 2012 - 04:38 PM
You should use os.pullEvent to wait for a "redstone" event, and then check if the input you want is on:

while true do
  os.pullEvent("redstone") -- wait for a "redstone" event
  if rs.getInput("left") then -- check the input
    -- do something here
  end
end
Uch1ha_Sasuke #3
Posted 18 June 2012 - 12:17 AM
Thanx it works!