Advertisement
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=0, x, 1 do
- Mv()
- end
- turtle.turnRight()
- for m=0, y, 1 do
- Mv()
- end
- turtle.turnRight()
- end
- function CheckBelow()
- success, data = turtle.inspectDown()
- if data.metadata == 7 then
- turtle.digDown()
- for i=0, 15, 1 do
- slotData = turtle.getItemDetail(i)
- if data.name == slotData.name then
- turtle.select(i)
- turtle.placeDown()
- break
- end
- end
- end
- end
- function CheckField()
- for j=0, y, 1 do
- for k=0, x, 1 do
- CheckBelow()
- Mv()
- end
- if j%2 == 0 then
- turtle.turnRight()
- Mv()
- turtle.turnRight()
- else
- turle.turnLeft()
- Mv()
- turle.turnLeft()
- end
- end
- end
- function TurnAround()
- turtle.trunLeft()
- turtle.turnLeft()
- end
- function Chest()
- TurnAround()
- for n=5, 15, 1 do
- turtle.select(n)
- turtle.drop()
- end
- TurnAround()
- end
- Startup()
- while true do
- CheckField()
- Chest()
- os.sleep(300)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement