Advertisement
HeatedDZN

Cobble Gen Grabber

May 19th, 2024 (edited)
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. -- Function to move the turtle forward by a specified number of blocks
  2. function moveForward(blocks)
  3.     for i = 1, blocks do
  4.         while not turtle.forward() do
  5.             turtle.dig()
  6.             turtle.attack()
  7.         end
  8.     end
  9. end
  10.  
  11. -- Function to turn the turtle right
  12. function turnRight()
  13.     turtle.turnRight()
  14. end
  15.  
  16. -- Function to turn the turtle left
  17. function turnLeft()
  18.     turtle.turnLeft()
  19. end
  20.  
  21. -- Function to suck items from below
  22. function suckFromBelow()
  23.     turtle.suckDown()
  24. end
  25.  
  26. -- Function to make the turtle rest for a specified number of seconds
  27. function rest(seconds)
  28.     os.sleep(seconds)
  29. end
  30.  
  31. -- Main function
  32. function main()
  33.     while true do
  34.         -- Move forward 28 blocks
  35.         moveForward(28)
  36.        
  37.         -- Turn right
  38.         turnRight()
  39.        
  40.         -- Move forward 14 blocks
  41.         moveForward(14)
  42.        
  43.         -- Suck items from below
  44.         suckFromBelow()
  45.        
  46.         -- Turn right twice
  47.         turnRight()
  48.         turnRight()
  49.        
  50.         -- Move forward 14 blocks
  51.         moveForward(14)
  52.        
  53.         -- Turn left
  54.         turnLeft()
  55.        
  56.         -- Move forward 28 blocks
  57.         moveForward(28)
  58.        
  59.         -- Turn left twice
  60.         turnLeft()
  61.         turnLeft()
  62.        
  63.         -- Rest for 1 minute (60 seconds)
  64.         rest(40)
  65.     end
  66. end
  67.  
  68. -- Start the process
  69. main()
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement