nintendowfi

Untitled

Mar 21st, 2021 (edited)
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.65 KB | None | 0 0
  1. --[[
  2.         12 X 12 farm
  3. ]]--
  4. local function move()
  5.     turtle.digDown()
  6.     while not turtle.forward() do
  7.         sleep(1)
  8.     end
  9. end
  10.  
  11. local function place()
  12.     turtle.placeDown()
  13.     while not turtle.forward() do
  14.         sleep(1)
  15.     end
  16. end
  17.  
  18. local function back()
  19.     while not turtle.up() do
  20.         sleep(1)
  21.     end
  22.     turtle.turnRight()
  23.     sleep(1)
  24.     turtle.turnRight()
  25.     place()
  26.     for o = 1,3 do
  27.  
  28.         for i = 1,12 do
  29.             place()
  30.         end
  31.         turtle.turnRight()
  32.         place()
  33.         sleep(1)
  34.         place()
  35.         turtle.turnRight()
  36.         place()
  37.         for i = 1,12 do
  38.             place()
  39.         end
  40.         turtle.turnLeft()
  41.         place()
  42.         sleep(1)
  43.         place()
  44.         turtle.turnLeft()
  45.         place()
  46.     end
  47.     for i = 1,12 do
  48.         place()
  49.     end
  50.     move()
  51.     while not turtle.down() do
  52.         sleep(1)
  53.     end
  54.     turtle.suck()
  55.     sleep(1)
  56.     turtle.turnRight()
  57.     sleep(1)
  58.     turtle.turnRight()
  59.    
  60. end
  61.    
  62.    
  63.  
  64.  
  65.  
  66. local function move2()
  67.     while not turtle.forward() do
  68.         sleep(1)
  69.     end
  70. end
  71. local function plow()
  72.     while not turtle.up() do
  73.         sleep(1)
  74.     end
  75.     move2()
  76.     for o = 1,3 do
  77.  
  78.         for i = 1,12 do
  79.             move()
  80.         end
  81.         turtle.turnRight()
  82.         move()
  83.         sleep(1)
  84.         move()
  85.         turtle.turnRight()
  86.         move()
  87.         for i = 1,12 do
  88.             move()
  89.         end
  90.         turtle.turnLeft()
  91.         move2()
  92.         sleep(1)
  93.         move(2)
  94.         turtle.turnLeft()
  95.         move2()
  96.     end
  97.     for i = 1,12 do
  98.         move()
  99.     end
  100.     move()
  101.     while not turtle.down() do
  102.         sleep(1)
  103.     end
  104.    
  105. end
  106.  
  107.  
  108. local iRepeat = 0
  109. local iMin = 40
  110. local iCount = 0
  111. local spacer = ""
  112. while true do
  113.     term.clear()
  114.     term.setCursorPos(1,4)
  115.     print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
  116.     term.setCursorPos(1,1)
  117.     iRepeat = iRepeat+1
  118.     print("plowing   :"..iRepeat)
  119.     plow()
  120.     sleep(1)
  121.     back()
  122.     print("moving back :...idk")
  123.    
  124.    
  125.     term.setCursorPos(1,4)
  126.     print("Fuel Remaning : "..tostring(turtle.getFuelLevel()))
  127.     iCount = iMin
  128.     while true do
  129.         iCount = iCount-1
  130.         term.setCursorPos(1,2)
  131.         term.clearLine()
  132.         print("sleeping "..iMin.." minuites")
  133.         for i = 59,0,-1 do
  134.             sleep(1)
  135.             term.setCursorPos(1,3)
  136.             term.clearLine()
  137.             if i < 10 then
  138.                 spacer = "0"
  139.             else
  140.                 spacer = ""
  141.             end
  142.             write("To go    "..iCount..":"..spacer..i)
  143.         end
  144.         if iCount == 0 then
  145.             break
  146.         end
  147.     end
  148. end
Add Comment
Please, Sign In to add comment