SHOW:
|
|
- or go back to the newest paste.
| 1 | - | --Sugarcane and optionally cactus farmer |
| 1 | + | --Push mobs |
| 2 | --They'll have to use stairs as their refference mark. | |
| 3 | --Go up to the ceiling, and move back to find the start. | |
| 4 | - | curX = 0 --current X position relative to the start |
| 4 | + | --Go down to 2 above the floor (head height), then move forward until you detect stairs beneath. |
| 5 | - | curY = 0 --current Y position relative to the start |
| 5 | + | --Go up to ceiling and return |
| 6 | - | curZ = 0 --current Z position relative to the start |
| 6 | + | |
| 7 | - | facing = 0 --what direction is the turtle facing (0,1,2,3) |
| 7 | + | Travel = 5 --The distance to travel |
| 8 | - | --0 is toward positive Z |
| 8 | + | First = 0 --set to 1 if this is the outermost turtle |
| 9 | - | waterLevel = -1000 --the highest location that water has been found |
| 9 | + | |
| 10 | - | SleepTime = 10 |
| 10 | + | |
| 11 | --set redstone signal | |
| 12 | rs.setOutput("left",true)
| |
| 13 | - | --It should now be on the track |
| 13 | + | rs.setOutput("right",true)
|
| 14 | - | -- local successDown, dataDown = turtle.inspectDown() |
| 14 | + | while (1) do |
| 15 | - | -- while not (successDown and string.find(dataDown.name, "dirt") or |
| 15 | + | local success, data = turtle.inspect() |
| 16 | - | -- successDown and string.find(dataDown.name, "grass")) do |
| 16 | + | if success and string.find(data.name,"barrel") then |
| 17 | - | -- turtle.digDown() |
| 17 | + | while turtle.getFuelLevel() < 1 do |
| 18 | - | -- turtle.down() |
| 18 | + | turtle.suck() |
| 19 | - | -- successDown, dataDown = turtle.inspectDown() |
| 19 | + | turtle.refuel() |
| 20 | - | -- end |
| 20 | + | |
| 21 | - | --we're now over dirt. |
| 21 | + | turtle.turnLeft() |
| 22 | - | -- turtle.up() |
| 22 | + | local waitTime = 0 |
| 23 | - | -- turtle.select(1) |
| 23 | + | while waitTime < 30 and not rs.getInput("right") and not rs.getInput("left")
|
| 24 | - | -- turtle.placeDown() |
| 24 | + | sleep(0.2) |
| 25 | - | -- turtle.up() |
| 25 | + | waitTime = waitTime + 0.2 |
| 26 | - | while (1) do |
| 26 | + | |
| 27 | - | local success, data = turtle.inspect() |
| 27 | + | |
| 28 | - | if success and (string.find(data.name,"sugar") or string.find(data.name,"bamboo")) then |
| 28 | + | if not rs.getInput("right") and not rs.getInput("left") then
|
| 29 | - | turtle.dig() |
| 29 | + | sleep(2) |
| 30 | - | turtle.forward() |
| 30 | + | else |
| 31 | - | turtle.digDown() |
| 31 | + | sleep(1) |
| 32 | - | elseif success and string.find(data.name,"chest") then |
| 32 | + | |
| 33 | - | --empty the inventory |
| 33 | + | turtle.forward() |
| 34 | - | for s=16,1,-1 do |
| 34 | + | --refuel if necessary |
| 35 | - | turtle.select(s) |
| 35 | + | |
| 36 | - | turtle.drop() |
| 36 | + | end |
| 37 | - | if turtle.getItemCount() > 0 then SleepTime = SleepTime * 2 |
| 37 | + |