View difference between Paste ID: TLnJZD4C and E22gJJ47
SHOW: | | - or go back to the newest paste.
1
while true do
2
while not redstone.getInput("top") do
3
  os.queueEvent("randomEvent")
4
  os.pullEvent()
5
end
6-
redstone.setOutput("right", true)
6+
redstone.setOutput("left", true)
7
os.sleep(1)
8-
redstone.setOutput("right", false)
8+
redstone.setOutput("left", false)
9-
if redstone.getInput("right") then
9+
if redstone.getInput("left") then
10-
  redstone.setOutput("left", true)
10+
  redstone.setOutput("right", true)
11
  os.sleep(10)
12-
  redstone.setOutput("left", false)
12+
  redstone.setOutput("right", false)
13
else
14
  os.sleep(10)
15
end
16
17
18
19
20
21
22
end