while true do while redstone.getInput("left") do os.queueEvent("randomEvent") os.pullEvent() redstone.setOutput("right", true) sleep(0.5) redstone.setOutput("right", false) end os.pullEvent("redstone") end