Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("x:")
- local x = read()
- print("y:")
- local y = read()
- local ix = 0
- local iy = 0
- local ii = 0
- local i = true
- while i do
- print("Please, enter the direction where the turtle will go ( r / l )")
- local direction = read()
- if direction == "r" then
- ii = 0
- print("Accepted! Direction is Right")
- i = false
- elseif direction == "l" then
- ii = 1
- print("Accepted! Direction is Left")
- i = false
- else
- print("Incorrect value")
- end
- end
- local count = 0
- local slot = 1
- local block, data = turtle.inspectDown()
- print(block, data.name)
- for ix = 0, x - 1 do
- block, data = turtle.inspectDown()
- if count == 63 then
- slot = slot + 1
- count = 0
- end
- if slot <= 16 then
- turtle.select(slot)
- else
- print("Out blocks!!!")
- os.pullEventRaw()
- end
- if block == true then
- if (data.name ~= "minecraft:grass_block") and (data.name ~= "minecraft:dirt") then
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- else
- turtle.dig()
- turtle.forward()
- end
- else
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- end
- end
- for iy = 0, y - 1 do
- turtle.refuel()
- turtle.getFuelLevel()
- if ii % 2 == 0 then
- turtle.turnRight()
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- turtle.turnLeft()
- end
- ii = ii + 1
- for ix = 0, x - 1 do
- block, data = turtle.inspectDown()
- if count == 63 then
- slot = slot + 1
- count = 0
- end
- if slot <= 16 then
- turtle.select(slot)
- else
- print("Out blocks!!!")
- os.pullEventRaw()
- end
- if block == true then
- if (data.name ~= "minecraft:grass_block") and (data.name ~= "minecraft:dirt") then
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- else
- turtle.dig()
- turtle.forward()
- end
- else
- turtle.dig()
- turtle.digDown()
- turtle.placeDown()
- count = count + 1
- turtle.forward()
- end
- end
- ix = 0
- end
- turtle.digDown()
- turtle.placeDown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement