Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fuelkontrolle = 1
- local strStart = "go"
- local walkKontrolle = 1
- print("Mettre le carburant dans le premier emplacement et les torches dans l'emplacement juste à droite.")
- print("Quand le carburant a été consommé, entrer 'go'")
- while fuelkontrolle == 1 do
- turtle.select(1)
- turtle.refuel()
- if turtle.getFuelLevel() ~= 0 then
- local strEingabe = read()
- if strEingabe == strStart then
- fuelkontrolle = 2
- end
- end
- end
- print("Quelle doit être la longueur du tunnel ?")
- print("")
- local numLaenge = tonumber(read())
- print("Quelle doit être la longueur des tunnels latéraux ?")
- print("")
- local numLaengeSeitlich = tonumber(read())
- local function digOneForward()
- while turtle.detectUp() == true do
- turtle.digUp()
- end
- while turtle.detect() == true do
- turtle.dig()
- end
- turtle.forward()
- while turtle.detectUp() == true do
- turtle.digUp()
- end
- end
- local function moveForward()
- if turtle.detect() == false then
- turtle.forward()
- else
- digOneForward()
- end
- if turtle.detectUp() == true then
- turtle.digUp()
- end
- end
- local function placeTorchOnBlock()
- turtle.placeDown()
- moveForward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(2)
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- local function placeTorch()
- turtle.select(2)
- local dataSlot = turtle.getItemDetail()
- local r = 1
- if turtle.getItemCount() ~= 0 then
- if dataSlot.name == "minecraft:torch" then
- if turtle.detectDown() == false then
- while r ~= 17 do
- turtle.select(r)
- if turtle.getItemCount() ~= 0 then
- local findBlock = turtle.getItemDetail()
- if findBlock.name == "minecraft:cobblestone" then
- placeTorchOnBlock()
- r = 16
- end
- r = r + 1
- end
- end
- else
- placeTorchOnBlock()
- end
- end
- end
- turtle.select(1)
- end
- for i = 1, numLaenge do
- if walkKontrolle == 1 then
- moveForward()
- moveForward()
- else
- moveForward()
- end
- turtle.turnLeft()
- for j = 1, numLaengeSeitlich do
- moveForward()
- end
- turtle.turnRight()
- turtle.turnRight()
- for k = 1, numLaengeSeitlich * 2 do
- moveForward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- for l = 1, numLaengeSeitlich do
- turtle.forward()
- end
- turtle.turnRight()
- if i % 2 == 0 then
- placeTorch()
- walkKontrolle = 2
- else
- walkKontrolle = 1
- end
- end
- print(turtle.getFuelLevel(), "carburant restant.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement