Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function MoveForward()
- while(turtle.forward() == false) do
- turtle.dig()
- end
- end
- function MoveDown()
- while(turtle.down() == false) do
- turtle.digDown()
- end
- end
- function MoveUp()
- while(turtle.up() == false) do
- turtle.digUp()
- end
- end
- function PlaceUp()
- turtle.placeUp()
- end
- function TurnRight()
- turtle.turnRight()
- end
- function TurnLeft()
- turtle.turnLeft()
- end
- function Place1stChunk()
- MoveDown()
- turtle.select(1)
- PlaceUp()
- TurnRight()
- MoveForward()
- MoveUp()
- TurnRight()
- Dig()
- TurnRight()
- TurnRight()
- MoveForward()
- TurnLeft()
- MoveForward()
- TurnRight()
- end
- function Go()
- for i = 1 , 14 do
- MoveForward()
- end
- end
- function Place()
- turtle.place()
- end
- function Dig()
- turtle.dig()
- end
- function Place2ndChunk()
- TurnRight()
- MoveForward()
- TurnLeft()
- Dig()
- turtle.select(1)
- Place()
- TurnLeft()
- MoveForward()
- TurnLeft()
- TurnLeft()
- Place()
- TurnRight()
- end
- function RetrieveChunk()
- Go()
- Dig()
- TurnLeft()
- TurnLeft()
- MoveForward()
- Go()
- end
- function DigUp()
- while(turtle.detectUp() == true) do
- turtle.digUp()
- end
- end
- function DumpInv()
- DigUp()
- turtle.select(2)
- turtle.placeUp()
- for i = 3,15 do
- turtle.select(i)
- turtle.dropUp()
- end
- turtle.select(2)
- turtle.digUp()
- turtle.suckUp()
- end
- function GetFuelFromChest()
- turtle.select(2)
- DigUp()
- turtle.placeUp()
- turtle.select(16)
- turtle.dropUp()
- turtle.suckUp()
- turtle.select(2)
- turtle.digUp()
- turtle.suckUp()
- end
- function CheckFuel()
- if turtle.getFuelLevel() <= 20 then
- turtle.select(16)
- turtle.refuel(5)
- end
- if turtle.getFuelLevel() <= 1 then
- GetFuelFromChest()
- CheckFuel()
- end
- return true
- end
- function main()
- while(true) do
- CheckFuel()
- Place1stChunk()
- Go()
- Place2ndChunk()
- RetrieveChunk()
- DumpInv()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement