Advertisement
Guest User

vierbaum5

a guest
Nov 27th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. -- Vierbaum Hacker by g4njah
  2. -- Dirt to the last slot please.
  3. -- Turtle in front of the first right
  4.  
  5. print("Turtle: " .. os.getComputerLabel() )
  6. print("-------------------------------")
  7. print("g4njah's Vierbaum Hacker v2.2")
  8. print("------------------------")
  9. print("Attention: Dirt to the last Slot.")
  10. sleep(1)
  11. print("Turtle starting in 3 seconds...")
  12. sleep(3)
  13.  
  14. -- Movement
  15. function vo()
  16.  turtle.forward()
  17. end
  18. function vo2()
  19.  vo()
  20.  vo()
  21. end
  22. function zu()
  23.  turtle.back()
  24. end
  25. function zu2()
  26.  zu()
  27.  zu()
  28. end
  29. function zu5()
  30.  zu2()
  31.  zu2()
  32.  zu()
  33. end
  34. function zu20()
  35.  zu5()
  36.  zu5()
  37.  zu5()
  38.  zu5()
  39. end
  40. function li()
  41.  turtle.turnLeft()
  42. end
  43. function re()
  44.  turtle.turnRight()
  45. end
  46. -- Positionsfunktion
  47. function getinpos()
  48.  vo()
  49.  re()
  50.  vo2()
  51.  li()
  52. end
  53. function comeback()
  54.  re()
  55.  vo()
  56.  li()
  57.  zu20()
  58.  re()
  59.  zu2()
  60.  zu()
  61.  li()
  62.  zu()
  63. end
  64. -- Hauptfunktionen
  65. function rauf()
  66.   turtle.dig()
  67.   turtle.forward()
  68.   while turtle.detectUp() == true do
  69.     turtle.digUp()
  70.     turtle.up()
  71.   end
  72. end
  73. function runter()
  74.   turtle.dig()
  75.   turtle.forward()
  76.   turtle.select(16)
  77.   while turtle.compareDown() == false do
  78.     turtle.digDown()
  79.     turtle.down()
  80.   end
  81. end  
  82. function baumreihe()
  83.  for i=1, 5, 1 do
  84.   rauf()
  85.   runter()
  86.   li()
  87.   rauf()
  88.   li()
  89.   runter()
  90.   li()
  91.   vo()
  92.   li()
  93.   vo2()
  94.   vo()
  95.  end
  96. end
  97. function dropall15()
  98.  re()
  99.  for i = 1, 15, 1 do
  100.   turtle.select(i)
  101.   turtle.drop()
  102.  end
  103.  li()
  104. end
  105.  
  106. -- Hauptprogrammteil
  107.  
  108. getinpos()
  109. baumreihe()
  110. comeback()
  111. dropall15()
  112. print("g4njahs vierbaum5 Script erfolgreich beendet.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement