BillBodkin

Untitled

Jan 9th, 2021 (edited)
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. local rotation = 0
  2.  
  3. function Mine()
  4.     turtle.select(1)
  5.     while turtle.detect() do
  6.         turtle.dig()
  7.     end
  8. end
  9.  
  10. function MineUp()
  11.     turtle.select(1)
  12.     while turtle.detectUp() do
  13.         turtle.digUp()
  14.     end
  15. end
  16.  
  17. function MineDown()
  18.     turtle.select(1)
  19.     while turtle.detectDown() do
  20.         turtle.digDown()
  21.     end
  22. end
  23.  
  24. function Forward()
  25.     Refuel()
  26.     Mine()
  27.     while turtle.forward() == false do
  28.         turtle.attack()
  29.     end
  30. end
  31.  
  32. function Up()
  33.     Refuel()
  34.     MineUp()
  35.     while turtle.up() == false do
  36.         turtle.attackUp()
  37.     end
  38. end
  39.  
  40. function Down()
  41.     Refuel()
  42.     MineDown()
  43.     while turtle.down() == false do
  44.         turtle.attackDown()
  45.     end
  46. end
  47.  
  48. function Left()
  49.     turtle.turnLeft()
  50.     rotation = rotation - 1
  51.     if rotation == -1 then
  52.         rotation = 3
  53.     end
  54. end
  55.  
  56. function Right()
  57.     turtle.turnRight()
  58.     rotation = rotation + 1
  59.     if rotation == 4 then
  60.         rotation = 0
  61.     end
  62. end
  63.  
  64. function RotateTo(rot)
  65.     while rotation ~= rot do
  66.         Right()
  67.     end
  68. end
Add Comment
Please, Sign In to add comment