SHOW:
|
|
- or go back to the newest paste.
| 1 | - | red = component.proxy(component.list("redstone")()) |
| 1 | + | red = component.proxy(component.list("redstone")())
|
| 2 | - | local bottom = 0 |
| 2 | + | local bottom = 0 |
| 3 | - | local front = 3 |
| 3 | + | local front = 3 |
| 4 | - | function wait(seconds) |
| 4 | + | function wait(seconds) |
| 5 | - | local start = os.time() |
| 5 | + | local start = os.time() |
| 6 | - | repeat until os.time() > start + seconds |
| 6 | + | repeat until os.time() > start + seconds |
| 7 | - | end |
| 7 | + | end |
| 8 | - | while true do |
| 8 | + | while true do |
| 9 | - | if red.getInput(bottom) > 0 then |
| 9 | + | if red.getInput(bottom) > 0 then |
| 10 | - | wait(50) |
| 10 | + | wait(50) |
| 11 | - | red.setOutput(front, 15) |
| 11 | + | red.setOutput(front, 15) |
| 12 | - | wait(5) |
| 12 | + | wait(5) |
| 13 | - | else |
| 13 | + | else |
| 14 | - | red.setOutput(front, 0) |
| 14 | + | red.setOutput(front, 0) |
| 15 | end end |