Advertisement
someone3709

turtle farm test

Feb 22nd, 2023 (edited)
877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. while true do
  2.   -- Fuel check
  3.   while true do
  4.     fuelLevel = turtle.getFuelLevel()
  5.     if fuelLevel <= 100 then
  6.       print("Fuel level is too low, stopping program")
  7.       return -- Exit the program completely
  8.     end
  9.     break -- Exit the fuel check loop and continue with the program
  10.   end
  11.  
  12.   -- Perform actions
  13.   function compFarmDown()
  14.     if turtle.detectDown() == true then
  15.       turtle.digDown()
  16.       turtle.placeDown()
  17.     end
  18.   end
  19.  
  20.   function compForward()
  21.     compFarmDown()
  22.     turtle.forward()
  23.   end
  24.  
  25.   function compBack()
  26.     compFarmDown()
  27.     turtle.back()
  28.   end
  29.  
  30.   function forwardComp()
  31.     turtle.forward()
  32.     compFarmDown()
  33.   end
  34.  
  35.   function backComp()
  36.     turtle.back()
  37.     compFarmDown()
  38.   end
  39.  
  40.   function farmStart()
  41.     compForward()
  42.     compForward()
  43.     compForward()
  44.     compForward()
  45.     compForward()
  46.     compForward()
  47.     compForward()
  48.     compFarmDown()
  49.     turtle.back()
  50.     turtle.back()
  51.     turtle.turnRight()
  52.     turtle.forward()
  53.     compForward()
  54.     compForward()
  55.     compFarmDown()
  56.     turtle.turnLeft()
  57.     turtle.forward()
  58.     turtle.forward()
  59.     compBack()
  60.     compBack()
  61.     compBack()
  62.     compBack()
  63.     compBack()
  64.     compBack()
  65.     compBack()
  66.     compFarmDown()
  67.     turtle.forward()
  68.     turtle.forward()
  69.     turtle.turnLeft()
  70.     forwardComp()
  71.     forwardComp()
  72.     turtle.turnRight()
  73.     forwardComp()
  74.     turtle.turnRight()
  75.     forwardComp()
  76.     turtle.turnLeft()
  77.     forwardComp()
  78.     turtle.turnLeft()
  79.     forwardComp()
  80.     turtle.forward()
  81.     turtle.turnLeft()
  82.     turtle.forward()
  83.     turtle.forward()
  84.     turtle.forward()
  85.     turtle.forward()
  86.     turtle.turnLeft()
  87.     turtle.turnLeft()
  88.   end
  89.  
  90.   farmStart()
  91.  
  92.   -- Add delay to prevent the program from running too quickly
  93.   os.sleep(600)
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement