ScoutMaester

Untitled

Jan 4th, 2021 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. facing = 1
  2. checked = 0
  3.  
  4. function left()
  5.     turtle.turnLeft()
  6.     facing = facing - 1
  7.     if facing == 0 then
  8.         facing = 4
  9.     else
  10.         facing = facing
  11.     end
  12. end
  13.  
  14. function right()
  15.     turtle.turnRight()
  16.     facing = facing + 1
  17.     if facing == 5 then
  18.         facing = 1
  19.     else
  20.         facing = facing
  21.     end
  22. end
  23.  
  24. function turnAround()
  25.     right()
  26.     right()
  27. end
  28.  
  29. function clearBack()
  30.     turnAround()
  31.     turtle.dig()
  32.     turnAround()
  33. end
  34.  
  35. function clearFront()
  36.     turtle.dig()
  37. end
  38.  
  39. local success, findCoal = 1
  40.  
  41. function refuel()
  42.     if turtle.getFuelLevel() < 200 then
  43.         print("refueling now... I can only move ", turtle.getFuelLevel(), "more blocks...")
  44.         turtle.select(1)
  45.         while turtle.select("minecraft:coal") == false do
  46.             findCoal = findCoal + 1
  47.             turtle.select(findCoal)
  48.         end
  49.         print("I found coal in slot ", turtle.select(), ". Eating it now!")
  50.         turtle.refuel()
  51.         print("done! I can now move ", turtle.getFuelLevel(), "more blocks!")
  52.     else
  53.         print("I dont need fuel right now! I can still move ", turtle.getFuelLevel(), " more blocks!")
  54.     end
  55. end
  56.  
  57. while true do
  58.     turtle.back()
  59.     right()
  60.     turtle.forward()
  61.     turtle.forward()
  62.     left()
  63.     turtle.forward()
  64.     checked = 1
  65.     turtle.back()
  66.     left()
  67.     turtle.forward()
  68.     turtle.forward()
  69.     right()
  70.     turtle.forward()
  71.     checked = 0
  72.     refuel()
  73. end
Add Comment
Please, Sign In to add comment