Advertisement
rhn

PureDaisy

rhn
Mar 24th, 2020
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. -- Startup script:
  2. --shell.run("delete","farm")
  3. --shell.run("pastebin","get","G9b13Ncx","farm")
  4. --shell.run("farm")
  5.  
  6. --   W W W
  7. -- W       W
  8. -- W   D   W
  9. -- W       W
  10. --   T W W
  11.  
  12. -- D= Pure Daisy.
  13. -- W=2 block tall wall. Must be walled in or else it wont know where it is in case of chunk/server reloads.
  14. -- T= Turtle home location(Inventory for finished items bottom, turtle middle and inventory raw ingredients on top).
  15.  
  16. --easy move function
  17. local function movePlace(steps)
  18.     for i=1,steps do
  19.         while not turtle.forward() do
  20.                     sleep(1)
  21.         end
  22.         turtle.digDown()
  23.         turtle.placeDown()
  24.     end
  25. end
  26.  
  27. local function home()
  28.     local homecount=0
  29.     while homecount<3 do
  30.         homecount=0
  31.         for i=1,3 do
  32.             if turtle.forward()==true then
  33.                 homecount=homecount+1
  34.                 --print("Homecounter: "..homecount)
  35.             end
  36.         end
  37.         turtle.turnLeft()
  38.     end
  39.     turtle.turnLeft()
  40. end
  41.  
  42. print("Pure Daisy farm: https://pastebin.com/G9b13Ncx")
  43.  
  44. turtle.forward()
  45. print("Finding home location")
  46. home()
  47. print("Home location found")
  48.  
  49. while true do
  50.     sleep(60)
  51.     turtle.select(1)
  52.     turtle.suckUp(8)
  53.     if turtle.getItemCount(1) > 0 then
  54.         while not turtle.forward() do
  55.             sleep(1)
  56.         end
  57.         movePlace(2)
  58.         turtle.turnRight()
  59.         movePlace(2)
  60.         turtle.turnRight()
  61.         movePlace(2)
  62.         turtle.turnRight()
  63.         movePlace(2)
  64.         turtle.turnRight()
  65.         turtle.back()
  66.         for i=1,16 do
  67.             turtle.select(i)
  68.             turtle.dropDown()
  69.         end
  70.     else
  71.         print("No ingredients found")
  72.     end
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement