SHOW:
|
|
- or go back to the newest paste.
| 1 | local t = turtle | |
| 2 | local error = 0 | |
| 3 | ||
| 4 | function openDoor() | |
| 5 | t.select(2) | |
| 6 | if(t.getItemCount(2) > 0) then | |
| 7 | print("Error: ItemCount slot 2 > 0")
| |
| 8 | - | error = 5 |
| 8 | + | error = 11 |
| 9 | return | |
| 10 | end | |
| 11 | rs.setOutput("top",true)
| |
| 12 | sleep(0.05) | |
| 13 | rs.setOutput("top",false)
| |
| 14 | - | t.transferTo(3) |
| 14 | + | if(t.getItemCount(2) == 0) then |
| 15 | print("Error: ItemCount slot 2 == 0")
| |
| 16 | error = 12 | |
| 17 | return | |
| 18 | end | |
| 19 | if(not t.transferTo(3)) then | |
| 20 | print("Error: transfer to slot 3 failed")
| |
| 21 | error = 13 | |
| 22 | return | |
| 23 | end | |
| 24 | if(not t.digUp()) then | |
| 25 | print("Error: cannot break Block Breaker")
| |
| 26 | error = 21 | |
| 27 | return | |
| 28 | end | |
| 29 | t.select(1) | |
| 30 | if(not t.placeUp()) then | |
| 31 | print("Error: cannot place Auto Placer")
| |
| 32 | error = 22 | |
| 33 | return | |
| 34 | end | |
| 35 | if(t.getItemCount(1) < 1) then | |
| 36 | print("Error: less than one Auto Placer remaining")
| |
| 37 | error = 14 | |
| 38 | return | |
| 39 | end | |
| 40 | rs.setOutput("left",true)
| |
| 41 | sleep(0.1) | |
| 42 | rs.setOutput("left",false)
| |
| 43 | ||
| 44 | end | |
| 45 | ||
| 46 | function closeDoor() | |
| 47 | ||
| 48 | end |