Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Kompatibel mit TurtleOS 1.5
- -- Standardtunnel 1x2
- 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()
- if turtle.detectUp() then
- print ("UP")
- turtle.digUp()
- end
- end
- function down()
- if turtle.detect() then
- print ("FRONT")
- turtle.dig()
- end
- end
- function tunnel(tunnelentf)
- while tunnelentf>TunnelZurueckgelegt do
- print ("StartSchleife")
- -- nachfuellen
- refuel()
- -- oben abbauen
- up()
- --vorne abbauen
- down()
- --1 vorgehen
- turtle.forward()
- TunnelZurueckgelegt= TunnelZurueckgelegt + 1 --boah was 'ne kacksprache die kein ++ increment zulaesst
- -- Fackeln platzieren
- placeTorch()
- end
- up()
- 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)
- print ("Programmende")
Add Comment
Please, Sign In to add comment