Advertisement
Paragorn

Advent 09

Dec 9th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. -- Variable zum Entleeren
  2. -- "AN" = Wird entleert
  3. -- "AUS" = Bleibt im Turtle
  4.  
  5. ENTLEEREN = "AN"
  6.  
  7. --Treibstoff Check--
  8. Treibstoff = turtle.getFuelLevel() + 0
  9. if Treibstoff <= 90 then
  10.  print("Dafuer reicht mein Treibstoff nicht.")
  11.  return
  12. end
  13.  
  14. -- Funktion --
  15. function Vor( ZAHL , RICHTUNG )
  16.  for i = 1,ZAHL do
  17.   turtle.forward()
  18.   turtle.digDown()
  19.   turtle.placeDown()
  20.  end
  21.  if RICHTUNG == "L" then
  22.   turtle.turnLeft()
  23.  elseif RICHTUNG == "R" then
  24.   turtle.turnRight()
  25.  end
  26. end
  27.  
  28. -- Basisprogramm --
  29. turtle.up()
  30. turtle.select(1)
  31. Vor(4,"L")
  32. Vor(4,"L")
  33. Vor(8,"L")
  34. Vor(8,"L")
  35. Vor(8,"L")
  36. Vor(3,"L")
  37. Vor(1,"L")
  38. Vor(2,"R")
  39. Vor(6,"R")
  40. Vor(6,"R")
  41. Vor(6,"R")
  42. Vor(2,"R")
  43. Vor(1,"R")
  44. Vor(1,"L")
  45. Vor(4,"L")
  46. Vor(4,"L")
  47. Vor(4,"L")
  48. Vor(1,"L")
  49. Vor(3,"R")
  50. Vor(2,"R")
  51. Vor(2,"R")
  52. turtle.forward()
  53. turtle.turnRight()
  54. turtle.forward()
  55. turtle.turnRight()
  56. turtle.turnRight()
  57. turtle.down()
  58.  
  59. if ENTLEEREN == "AN" then
  60.  SLOT = 2
  61.  for i = 1,15 do
  62.   turtle.select(SLOT)
  63.   SLOT = SLOT + 1
  64.   turtle.dropDown()
  65.  end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement