Advertisement
Paragorn

Advent 15

Dec 15th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. -- Abfrage des Wertes bei Programmstart
  2. local tArgs = { ... }
  3. -- Funktionen --
  4. --Faellt den Baum
  5. function Hacken()
  6.  turtle.select(1)
  7.  turtle.dig()
  8.  turtle.forward()
  9.  while turtle.detectUp() == true do
  10.   turtle.digUp()
  11.   for i=1,4 do
  12.    turtle.dig()
  13.    turtle.turnLeft()
  14.   end
  15.   turtle.up()
  16.  end
  17.  while turtle.detectDown() == false do
  18.   turtle.down()
  19.  end
  20.  turtle.back()
  21. end
  22. --Pflanzt den Baum
  23. function Zucht()
  24.  turtle.select(1)
  25.  turtle.place()
  26.  turtle.select(2)
  27.  for i=1,20 do
  28.   turtle.place()
  29.  end
  30. end
  31. --Check ob genug Knochenmehl
  32. function Knochenmehl()
  33.  if turtle.getItemCount(2) <= 21 then
  34.   turtle.turnLeft()
  35.   turtle.select(2)
  36.   turtle.suck()
  37.   turtle.select(3)
  38.   turtle.drop()
  39.   turtle.turnRight()
  40.  end
  41. end
  42. --Turtle entleeren()
  43. function Leeren()
  44.  turtle.turnRight()
  45.  Leerslot = 3
  46.  for i = 1,14 do
  47.   turtle.select(Leerslot)
  48.   turtle.drop()
  49.   Leerslot = Leerslot + 1
  50.  end
  51.  turtle.turnLeft()
  52. end
  53.  
  54. --Hauptprogramm
  55. Anzahl = tArgs[1] + 0
  56. for i=1,Anzahl do
  57.  Knochenmehl()
  58.  Zucht()
  59.  Hacken()
  60.  Leeren()
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement