SHOW:
|
|
- or go back to the newest paste.
| 1 | local direction = "up" | |
| 2 | local emptyflag = 0 | |
| 3 | ||
| 4 | - | if direction == "up" then |
| 4 | + | |
| 5 | - | turtle.suckDown(1) |
| 5 | + | |
| 6 | turtle.suckDown(1) | |
| 7 | - | turtle.suckUp(1) |
| 7 | + | else |
| 8 | turtle.suckUp(1) | |
| 9 | end | |
| 10 | end | |
| 11 | ||
| 12 | - | turtle.select(11) |
| 12 | + | local function move_items(pos1,pos2) |
| 13 | turtle.select(pos1) | |
| 14 | turtle.transferTo(pos2) | |
| 15 | end | |
| 16 | ||
| 17 | local function drop(side) | |
| 18 | turtle.select(1) | |
| 19 | - | turtle.select(i) |
| 19 | + | |
| 20 | - | turtle.drop() |
| 20 | + | |
| 21 | elseif side == "down" then | |
| 22 | turtle.dropDown() | |
| 23 | else | |
| 24 | for i=1,16 do | |
| 25 | if i~=6 then | |
| 26 | - | for i=1,3 do |
| 26 | + | turtle.select(i) |
| 27 | - | turtle.select(i) |
| 27 | + | turtle.drop() |
| 28 | end | |
| 29 | end | |
| 30 | - | for i=5,7 do |
| 30 | + | |
| 31 | - | turtle.select(i) |
| 31 | + | |
| 32 | ||
| 33 | local function fillCraft() | |
| 34 | - | for i=9,11 do |
| 34 | + | turtle.select(2) |
| 35 | - | turtle.select(i) |
| 35 | + | |
| 36 | turtle.select(5) | |
| 37 | suck() | |
| 38 | turtle.select(7) | |
| 39 | suck() | |
| 40 | turtle.select(10) | |
| 41 | suck() | |
| 42 | end | |
| 43 | ||
| 44 | -- Main Code | |
| 45 | ||
| 46 | turtle.select(1) | |
| 47 | turtle.turnLeft() | |
| 48 | turtle.turnLeft() | |
| 49 | while turtle.suck() == true do | |
| 50 | turtle.dropDown() | |
| 51 | end | |
| 52 | - | |
| 52 | + | turtle.turnLeft() |
| 53 | turtle.turnLeft() | |
| 54 | ||
| 55 | while true do | |
| 56 | fillCraft() | |
| 57 | turtle.select(1) | |
| 58 | if turtle.craft(1) == false then | |
| 59 | drop("forward")
| |
| 60 | emptyflag = emptyflag + 1 | |
| 61 | if direction == "up" then | |
| 62 | direction = "down" | |
| 63 | else | |
| 64 | direction = "up" | |
| 65 | end | |
| 66 | else | |
| 67 | emptyflag = 0 | |
| 68 | drop(direction) | |
| 69 | end | |
| 70 | if emptyflag > 2 then | |
| 71 | break | |
| 72 | end | |
| 73 | end |