SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local input = peripheral.wrap("top")
|
| 1 | + | local input = peripheral.wrap("left")
|
| 2 | local output = peripheral.wrap("bottom")
| |
| 3 | - | function craftAndTrade() |
| 3 | + | |
| 4 | - | turtle.transferTo(2, 9) |
| 4 | + | function craftAndPush() |
| 5 | - | turtle.transferTo(6, 9) |
| 5 | + | input.pushItems("front", 1, 1)
|
| 6 | - | turtle.craft() |
| 6 | + | turtle.suck(1) |
| 7 | - | turtle.drop() |
| 7 | + | turtle.transferTo(6, 1) |
| 8 | input.pushItems("front", 2, 1)
| |
| 9 | turtle.suck(1) | |
| 10 | turtle.craft() | |
| 11 | - | local item = input.getItemDetail(1) |
| 11 | + | turtle.dropDown() |
| 12 | - | if(item ~= nil and item.count > 17) then |
| 12 | + | |
| 13 | - | turtle.suckUp(18) |
| 13 | + | |
| 14 | - | craftAndTrade() |
| 14 | + | |
| 15 | local inputList = input.list() | |
| 16 | if(#inputList < 2) then | |
| 17 | os.exit() | |
| 18 | end | |
| 19 | ||
| 20 | local outputItem = output.getItemDetail(1) | |
| 21 | if(outputItem == nil) then | |
| 22 | craftAndPush() | |
| 23 | end | |
| 24 | ||
| 25 | os.sleep(2) | |
| 26 | end | |
| 27 |