Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Kompatibel mit TurtleOS 1.5
- -- Standardtunnel 1x2 mit Return und Quergang
- TunnelLaenge=50
- QuerTunnelLaenge=2
- FackelEntfernung=8
- TunnelZurueckgelegt=0
- --############################
- function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function placeTorch()
- if TunnelZurueckgelegt%FackelEntfernung==2 then
- turnAround()
- if turtle.getItemCount(16)>0 then
- turtle.select(16)
- turtle.place(X)
- end
- turnAround()
- end
- end
- function refuel()
- turtle.select(15)
- if turtle.getItemCount(15) == 0 then
- print ("Kein Treibstoff! (Slot 15)")
- end
- if turtle.getFuelLevel()<=50 then
- turtle.refuel(1)
- end
- end
- function up()
- print ("UP")
- turtle.digUp()
- end
- function front()
- print ("FRONT")
- turtle.dig()
- end
- function checkMiningUp()
- if turtle.detectUp() then
- return true
- end
- return false
- end
- function checkMiningFront()
- if turtle.detect() then
- return true
- end
- return false
- end
- function checkMining()
- if turtle.detect() or turtle.detectUp() then
- return true
- end
- return false
- end
- function tunnel(tunnelentf)
- while tunnelentf>TunnelZurueckgelegt do
- print ("StartSchleife")
- -- nachfuellen
- refuel()
- while checkMining() do
- -- oben abbauen
- if checkMiningUp() then
- up()
- end
- --vorne abbauen
- if checkMiningFront() then
- front()
- end
- end
- --1 vorgehen
- turtle.forward()
- TunnelZurueckgelegt= TunnelZurueckgelegt + 1 --boah was 'ne kacksprache die kein ++ increment zulaesst
- -- Fackeln platzieren
- placeTorch()
- end
- up()
- TunnelZurueckgelegt=0
- end
- function querTunnel(tunnelentf)
- turtle.turnRight()
- tunnel(tunnelentf)
- turtle.turnRight()
- end
- function go(entf)
- x=0
- while entf>x do
- turtle.forward()
- x=x+1
- end
- end
- --############################
- print ("Anfang")
- tunnel(TunnelLaenge)
- querTunnel(5)
- turtle.turnRight()
- go(2)
- turtle.turnLeft()
- tunnel(TunnelLaenge)
- turnAround()
- print ("Programmende")
Add Comment
Please, Sign In to add comment