Advertisement
kEOKIX

Plot/Garden

May 7th, 2023 (edited)
870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. --Program made by Keokix_
  2. --V1.0.0.0
  3. --Copyright by Zezior
  4.  
  5. slot = 1
  6.  
  7. function Menu()
  8.     print("How many plots + garend you wanna build?")
  9.    
  10.     input = tonumber(io.read())
  11.     Build(input)
  12. end
  13.  
  14.  
  15. function Build(amount)
  16.     while(amount > 0)do
  17.         BuildPlot()
  18.         turtle.turnLeft()
  19.         for i = 0, 32 do
  20.             turtle.forward()
  21.         end
  22.         turtle.turnRight()
  23.         BuildGarden()
  24.         amount = amount - 1
  25.     end
  26. end
  27.  
  28. function BuildPlot()
  29.     turtle.select(slot)
  30.     for i = 0, 3 do
  31.         if(turtle.getItemCount() < 20) then
  32.             slot = slot + 1
  33.             turtle.select(slot)
  34.         end
  35.         for j = 0, 32 do
  36.             turtle.placeDown()
  37.             turtle.forward()
  38.         end
  39.         turtle.turnLeft()
  40.     end
  41. end
  42.  
  43. function BuildGarden()
  44.     turtle.select(slot)
  45.     long = 2
  46.     for i = 0, 3 do
  47.         if(turtle.getItemCount() < 20) then
  48.             slot = slot + 1
  49.             turtle.select(slot)
  50.         end
  51.         if(long == 1) then
  52.             for i = 0, 14 do
  53.                 turtle.placeDown()
  54.                 turtle.forward()
  55.             end
  56.             long = 2
  57.         elseif(long == 2) then
  58.             for j = 0, 32 do   
  59.                 turtle.placeDown()
  60.                 turtle.forward()
  61.             end
  62.             long = 1
  63.         end
  64.         turtle.turnLeft()
  65.     end
  66.  
  67. end
  68.  
  69. Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement