Advertisement
Guest User

sort.l

a guest
Jun 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1.  
  2. bl=0
  3. up=false
  4.  
  5.  
  6. ---crafting petals
  7.  
  8. function petals()
  9.     while turtle.suck(32) do
  10.         local data = turtle.getItemDetail()
  11.         if data then
  12.             if data.name=="botania:flower" then
  13.                 turtle.craft()
  14.             end
  15.         end
  16.     turtle.dropUp()
  17.     end
  18. end
  19.  
  20.  
  21. ---- sortieren
  22.  
  23.  
  24. function sort()
  25.  
  26. turtle.turnRight()
  27. turtle.turnRight()
  28. turtle.forward()
  29. turtle.forward()
  30. turtle.forward()
  31. turtle.forward()
  32.  
  33. turtle.turnRight()
  34.  
  35. if bl>8 then
  36.     up=true
  37.     bl=bl-8
  38.     turtle.down()
  39. else
  40.     up=false
  41. end
  42. print(up)
  43.  
  44. for i=1,bl do
  45. turtle.forward()
  46. end
  47.  
  48. turtle.turnLeft()
  49. turtle.drop()
  50. turtle.turnLeft()
  51.  
  52. for i =1,bl do
  53. turtle.forward()
  54. end
  55.  
  56. turtle.turnLeft()
  57.  
  58. if up==true then
  59. turtle.Up()
  60. end
  61.  
  62. turtle.forward()
  63. turtle.forward()
  64. turtle.forward()
  65. turtle.forward()
  66.  
  67. end
  68. -----------------
  69.  
  70. for i=1,5 do
  71. redstone.setOutput("left", true)
  72. sleep(1)
  73. redstone.setOutput("left", false)
  74. sleep(1)
  75. end
  76.  
  77. petals()
  78. turtle.back()
  79. turtle.up()
  80.  
  81.  
  82. while turtle.suck() do
  83.         local data = turtle.getItemDetail()
  84.         if data then
  85.             bl=tonumber(data.damage)
  86.             if data.name=="botania:petal" then
  87.                 bl=bl+1
  88.                 sort()
  89.                  else
  90.                     bl=17              
  91.                 sort()
  92.             end
  93.         end
  94. end
  95. turtle.down()
  96. turtle.forward()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement