Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Dodo Strip programm
- --Variablen
- torch = 0
- usetorch = 0
- counter = 0
- h = 1
- --Funktionen
- function torchthing()
- usetorch = 1
- print("Bitte Fackeln in Slot 2 legen")
- while turtle.getItemCount(2) == 0 do
- sleep(1)
- end
- inputtorch = turtle.getItemCount(2)
- inputtorch2 = inputtorch * 2
- print("")
- end
- function preparing()
- print("Sollen Fackeln verwendet werden?[Ja][Nein]")
- torchread = read()
- if torchread == "Ja" then
- torchthing()
- end
- if torchread == "ja" then
- torchthing()
- end
- print("Bitte in Slot 1 Kisten zur Lagerung legen")
- sleep(3)
- while turtle.getItemCount(1) == 0 do
- sleep(1)
- end
- print("")
- print("Wie viele Gaenge sollen gegraben werden?")
- if usetorch == 1 then
- print("")
- write("Es koennen maximal ")
- write(inputtorch2)
- write(" gaenge gegraben werden")
- print("")
- end
- x = tonumber(read())
- end
- function torchfunc()
- if usetorch == 1 then
- if torch == 0 then
- turtle.back()
- turtle.select(2)
- sleep(0.2)
- turtle.placeUp()
- turtle.forward()
- torch = torch + 1
- end
- if torch == 1 then
- torch = torch - 1
- end
- end
- end
- function checkInv()
- if turtle.getItemCount(16) > 0 then
- turtle.select(1)
- turtle.digDown()
- turtle.placeDown()
- slot = 2
- if usetorch == 1 then
- slot = slot + 1
- end
- while slot < 17 do
- turtle.select(slot)
- turtle.dropDown()
- slot = slot + 1
- end
- end
- end
- function searchSaGra()
- sleep(0.3)
- while turtle.detect() == true do
- sleep(0.3)
- turtle.dig()
- end
- end
- function searchSaGraUp()
- sleep(0.3)
- while turtle.detectUp() == true do
- sleep(0.3)
- turtle.digUp()
- end
- end
- function tunFor()
- turtle.dig()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- torchfunc()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- sleep(0.5)
- checkInv()
- end
- function tunFor2()
- turtle.dig()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- turtle.dig()
- searchSaGra()
- searchSaGraUp()
- turtle.forward()
- turtle.digUp()
- sleep(0.5)
- checkInv()
- end
- function forward6()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- sleep(0.5)
- checkInv()
- end
- function sideTun()
- turtle.turnLeft()
- tunFor2()
- tunFor2()
- turtle.turnLeft()
- turtle.turnLeft()
- forward6()
- sleep(0.5)
- checkInv()
- end
- function sideTun2()
- tunFor2()
- tunFor2()
- turtle.turnLeft()
- turtle.turnLeft()
- forward6()
- turtle.turnRight()
- sleep(0.5)
- checkInv()
- end
- --Main
- preparing()
- while h > 0 do
- while x > 0 do
- print("")
- write("Es werden noch ")
- write(x)
- write(" gaenge gegraben")
- tunFor()
- sideTun()
- sideTun2()
- x = x - 1
- counter = counter + 1
- if x == 0 then
- j = 0
- end
- end
- if j == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- j = j + 1
- end
- if counter == 0 then
- h = h - 1
- end
- turtle.forward()
- turtle.forward()
- turtle.forward()
- counter = counter - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement