Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stop (message)
- print(message)
- exit()
- end
- function inventory (a)
- local abc = 1
- while abc <= 16 do
- turtle.select(abc)
- local item = turtle.getItemDetail()
- if item then
- if item.name == "minecraft:cobblestone" then
- turtle.drop()
- end
- if item.name == "minecraft:dirt" then
- turtle.drop()
- end
- if item.name == "minecraft:diorite" then
- turtle.drop()
- end
- end
- abc = abc + 1
- end
- end
- function reset (h,l)
- inventory()
- local i = 0
- turtle.turnLeft()
- local blockLeft = turtle.detect()
- turtle.turnRight()
- if blockLeft == true then
- turtle.turnRight()
- turtle.turnRight()
- end
- if blockLeft == false then
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- local abc = 0
- while abc < l do
- abc = abc + 1
- turtle.dig()
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.digDown()
- turtle.down()
- mine(h,l)
- end
- while i <= l - 1 do
- turtle.dig()
- turtle.forward()
- i = i + 1
- end
- i = 0
- turtle.turnLeft()
- while i <= l - 1 do
- turtle.dig()
- turtle.forward()
- i = i + 1
- end
- i = 0
- turtle.turnLeft()
- turtle.digDown()
- turtle.down()
- mine(h,l)
- end
- function mine (h,l)
- turtle.select(1)
- turtle.refuel()
- print("Commence a miné !")
- local progression = 0
- local ll = l + 1
- local slice = 0
- while progression < ll do
- turtle.dig()
- turtle.forward()
- progression = progression + 1
- if progression >= l then
- if slice >= l then
- reset(h,l)
- end
- local bba = 0
- turtle.turnLeft()
- local blockLeft = turtle.detect()
- turtle.turnRight()
- if blockLeft == false then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- if blockLeft == true then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- --stop("Testing Complete !")
- progression = 1
- slice = slice + 1
- end
- end
- end
- function mineCalculs (a)
- io.write("Taper la largeur de la mine en block!\n")
- local largeur = tonumber(io.read())
- io.write("Taper la hauteur de la mine en block!\n")
- local hauteur = tonumber(io.read())
- mine(hauteur,largeur)
- end
- function moveToCord(xx, yy, zz)
- local x, y, z = gps.locate(4)
- print('POS: ' .. x .. ' ' .. y .. ' ' .. z)
- local difX = 70 - x
- local i = 0
- if x < 70 then
- while i < difX do
- turtle.up()
- i = i + 1
- end
- end
- stop('Y Cord Complete !')
- end
- moveToCord(5, 10, 35)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement