Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- taille_x = 0
- taille_y = 0
- slot = 0
- a = false
- function tourne() --ESQUIVE
- if taille_y % 2 == 0 then
- a = false
- else
- a = true
- end
- if a == false then
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- end
- if a == true then
- turtle.turnLeft()
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- end
- end
- function recherche(nom_bloc)
- while slot <16 do
- while turtle.getItemCount() == 0 do
- if slot == 16 then
- slot = 0
- end
- slot = slot +1
- turtle.select(slot)
- end
- local data = turtle.getItemDetail(slot)
- if data.name == nom_bloc then
- turtle.select(slot)
- return 0
- end
- slot = slot +1
- turtle.select(slot)
- end
- end
- function mine(x,y,nom_bloc)
- recherche(nom_bloc)
- while taille_y < y do
- while taille_x < x do
- if turtle.getItemDetail() == nil then
- recherche(nom_bloc)
- end
- turtle.placeDown()
- turtle.forward()
- taille_x = taille_x +1
- print("x = "..taille_x)
- end
- print("y = "..taille_y)
- tourne()
- taille_y = taille_y + 1
- taille_x = 0
- end
- end
- local arg = { ... }
- mine(tonumber(arg[1]), tonumber(arg[2]), tostring(arg[3]))
Advertisement
Add Comment
Please, Sign In to add comment