Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local run = true
- local size = read()
- print("DA MINER BOT")
- print("ONLY SUPPORTED SIZES ARE")
- print("3x3")
- print("2x1")
- print("BOT IS FASTER AND BETTER")
- function moveLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- function moveDigUp(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.dig()
- turtle.up()
- end
- end
- function moveDigDown(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.dig()
- turtle.down()
- end
- end
- function moveDigLeft(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.dig()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- -- a
- end
- end
- function moveDigRight(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.dig()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- -- a
- end
- end
- function moveForward(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.forward()
- print(curCount)
- end
- end
- function moveDown(num)
- local curCount = 1
- while (curCount < num) do
- curCount = curCount + 1
- turtle.down()
- print(curCount)
- end
- end
- if (size == "3x3") then
- -- actual mining
- function right3x3()
- -- go up 3 and dig up
- moveDigUp(3)
- end
- function middle3x3()
- -- go left and dig down
- moveLeft()
- moveDigDown(3)
- end
- function left3x3()
- -- turn left and dig up
- moveLeft()
- moveDigUp(3)
- end
- function end3x3()
- -- go back to og spot + forward 1
- turtle.turnRight()
- moveForward(3)
- moveDown(2)
- turtle.turnLeft()
- turtle.forward()
- end
- while (true) do
- right3x3()
- middle3x3()
- left3x3()
- end3x3()
- end
- end
- if (size == "2x1") then
- function mine2x1()
- turtle.dig()
- turtle.up()
- turtle.dig()
- turtle.down()
- turtle.forward()
- end
- while (true) do
- mine2x1()
- end
- end
- if (size == "5x3") then
- function row1_5x3()
- moveDigUp(3)
- end
- function row2_5x3()
- moveLeft()
- moveDigDown(3)
- end
- function row3_5x3()
- moveLeft()
- moveDigUp(3)
- end
- function row4_5x3()
- moveLeft()
- moveDigDown(3)
- end
- function row5_5x3()
- moveLeft()
- moveDigUp(3)
- end
- function start_5x3()
- turtle.turnRight()
- moveForward(5)
- moveDown(2)
- turtle.turnLeft()
- turtle.forward()
- end
- while (true) do
- row1_5x3()
- row2_5x3()
- row3_5x3()
- row4_5x3()
- row5_5x3()
- start_5x3()
- end
- end
- if (size == "1x3") then
- function row_1x3()
- moveDigLeft(3)
- turtle.forward()
- moveDigRight(3)
- turtle.forward()
- end
- while (true) do
- row_1x3()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement