Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Coal()
- if turtle.getFuelLevel() < 40 and turtle.getItemCount(1) <2 then
- print "Bitte Treibstoff in den 1. Slot geben"
- end
- end
- function Refuel()
- if turtle.getFuelLevel() < 100 then
- turtle.select(1)
- turtle.refuel(turtle.getItemCount()-1)
- end
- end
- x=0
- y=0
- function Mv()
- Coal()
- Refuel()
- while not turtle.forward() do
- turtle.attack()
- end
- end
- function Startup()
- while turtle.forward() do
- x=x+1
- end
- turtle.turnRight()
- while turtle.forward() do
- y=y+1
- end
- turtle.turnRight()
- for l=1, x, 1 do
- Mv()
- end
- turtle.turnRight()
- for m=1, y, 1 do
- Mv()
- end
- turtle.turnRight()
- end
- function CheckBelow()
- success, data = turtle.inspectDown()
- if data.metadata == 7 then
- turtle.digDown()
- if data.name == "minecraft:carrots" then
- turtle.select(3)
- turtle.placeDown()
- elseif data.name == "minecraft:potatoes" then
- turtle.select(2)
- turtle.placeDown()
- end
- end
- end
- function CheckField()
- for j=1, y, 1 do
- for k=1, x, 1 do
- CheckBelow()
- Mv()
- end
- CheckBelow()
- if j%2 == 1 then
- turtle.turnRight()
- Mv()
- turtle.turnRight()
- elseif not j==y then
- turtle.turnLeft()
- Mv()
- turtle.turnLeft()
- end
- end
- if y%2 == 0 then
- TurnAround()
- for k=0, x, 1 do
- Mv()
- end
- end
- turtle.turnRight()
- for j=0, y+1, 1 do
- Mv()
- end
- turtle.turnRight()
- end
- function TurnAround()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function Chest()
- TurnAround()
- for n=5, 16, 1 do
- turtle.select(n)
- turtle.drop()
- end
- TurnAround()
- end
- Startup()
- while true do
- CheckField()
- Chest()
- os.sleep(900)
- end
Add Comment
Please, Sign In to add comment