Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if turtle then
- local blocks_between_torches = 5
- local torches = false
- local mineLength = 50
- local missingCoal = 4
- local missingTorches = 10
- turtle.select(1)
- while missingCoal > 0 do
- turtle.suckUp(4 - turtle.getItemCount())
- end
- turtle.select(2)
- while missingTorches > 0 do
- turtle.suckUp(10 - turtle.getItemCount())
- end
- turtle.select(1)
- while not turtle.forward() do
- os.sleep(0.1)
- end
- while not turtle.forward() do
- os.sleep(0.1)
- end
- local counter = 0
- while true do
- if turtle.getFuelLevel() < 5 then
- turtle.select(1)
- turtle.refuel(1)
- end
- local success, data = turtle.inspect()
- print(success, " - ", data.name)
- if success then
- print("yeet")
- if data.name == "ComputerCraft:CC-Turtle" then
- print("no")
- else
- print("yes no cringe")
- turtle.dig()
- end
- end
- if turtle.forward() then
- counter = counter + 1
- if counter == 5 then
- counter = 0
- end
- end
- if turtle.detectDown() then
- if counter == 0 then
- torches = true
- end
- turtle.digDown()
- break
- end
- end
- turtle.turnRight()
- turtle.digDown()
- turtle.digUp()
- turtle.dig()
- local blocksTraveled = 0
- counter = 0
- while true do
- if turtle.getFuelLevel() < 5 then
- turtle.select(1)
- turtle.refuel(1)
- end
- turtle.dig()
- if turtle.forward() then
- counter = counter + 1
- if counter >= blocks_between_torches then
- counter = 0
- end
- blocksTraveled = blocksTraveled + 1
- end
- turtle.digUp()
- turtle.digDown()
- if torches and counter == 0 then
- turtle.select(2)
- turtle.placeDown()
- end
- if blocksTraveled >= mineLength then
- break
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- while true do
- if turtle.getFuelLevel() < 5 then
- turtle.select(1)
- turtle.refuel(1)
- end
- if turtle.forward() then
- counter = counter + 1
- blocksTraveled = blocksTraveled - 1
- end
- if blocksTraveled <= 0 then
- break
- end
- end
- turtle.turnLeft()
- while true do
- if turtle.getFuelLevel() < 5 then
- turtle.select(1)
- turtle.refuel(1)
- end
- turtle.forward()
- success, data = turtle.inspect()
- if success then
- if data.name == "minecraft:sandstone" then
- break
- end
- end
- end
- turtle.turnLeft()
- while not turtle.forward() do
- os.sleep(0.2)
- end
- turtle.turnRight()
- while not turtle.forward() do
- os.sleep(0.2)
- end
- while not turtle.forward() do
- os.sleep(0.2)
- end
- while not turtle.down() do
- os.sleep(0.2)
- end
- for i=1, 16 do
- turtle.select(i)
- turtle.dropDown(64)
- end
- turtle.turnRight()
- while not turtle.forward() do
- os.sleep(0.1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment