Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Written by Jacob Christensen, 11/26/2022
- --Program Description: This program will mine out a 16x16 chunk starting from (0,16).
- --Program Start--
- print("Mmm I'm so hungry, let my feast begin!")
- --Function Definition--
- --LeftProcess - Turn Left: When the turtle is at the end of a line and needs to turn left. Turtle will turn left, mine, move forward, turn left again.
- function LeftProcess()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- --RightProcess - Turn Right: When the turtle is at the end of a line and needs to turn right. Turtle will turn right, mine, move forward, turn right again.
- function RightProcess()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- --MineLineProcess - Mine 15 blocks: This is where the turtle will mine out the line in front of it. Looping through mine, move forward 15 times.
- function MineLineProcess()
- for i=15,1,-1 do
- turtle.dig()
- turtle.forward()
- end
- end
- --EndOfLayerProcess - 180 and mine: This is where the turtle is at the end of the layer, it will turn around, mine down one block and be ready for next layer start.
- function EndOfLayerProcess()
- turtle.turnRight()
- turtle.turnRight()
- turtle.digDown()
- turtle.down()
- end
- --StartingProcess - Mine/Move Down turn left: This is where the turtle starts. It will mine one block down and move there it will then turn left and be ready to begin.
- function StartingProcess()
- turtle.digDown()
- turtle.down()
- turtle.turnLeft()
- end
- --LayerOneProcess: This process will have the turtle make it's first turn right & last turn right.
- function LayerOneProcess()
- MineLineProcess()
- for i=7,1,-1 do
- RightProcess()
- MineLineProcess()
- LeftProcess()
- MineLineProcess()
- end
- RightProcess()
- MineLineProcess()
- EndOfLayerProcess()
- end
- --LayerTwoProcess: This process will have the turtle make it's first turn left & last turn left.
- function LayerTwoProcess()
- MineLineProcess()
- for i=7,1,-1 do
- LeftProcess()
- MineLineProcess()
- RightProcess()
- MineLineProcess()
- end
- LeftProcess()
- MineLineProcess()
- EndOfLayerProcess()
- end
- --End of function defintions--
- --Starting Sequence--
- StartingProcess()
- --Turtle will go down 128 blocks with current i value, feel free to change. (Future program upgrade, prompt turtle to ask for i value.)
- for i=64,1,-1 do
- LayerOneProcess()
- LayerTwoProcess()
- end
- --End of program--
Advertisement
Comments
-
- It would be smart to load the turtle's inventory with materials that you'd like to keep. IE if you want only to pickup Iron, fill all slots with iron ore. If this is not done the turtle's inventory will fill up with random blocks and not pick up ores.
Add Comment
Please, Sign In to add comment
Advertisement