Advertisement
Derek1017

Mining Program

Jun 20th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. function back()
  2.     if checkIfBack() == true then
  3.         -- turtle.turnLeft() -- this makes it turtle
  4.         -- turtle.turnLeft() -- also this..
  5.  
  6.         local stopblock, data = turtle.inspect()
  7.         if data.name ~= "minecraft:redstone_block" then
  8.             if turtle.forward() == false then
  9.                 turtle.attack()
  10.             -- else -- if we move forward == false then u want him to move? no need
  11.                 -- turtle.forward() -- 2nd forward move
  12.             end
  13.             return false
  14.         else
  15.             return true
  16.         end
  17.     end
  18. end
  19.  
  20. function move()
  21.     if back() == false then
  22.         fuel = turtle.getTurtleLevel()
  23.         if fuel < 10 then refuel() end
  24.         if turtle.inspect() == false then
  25.             -- turtle.forward() -- 3rd call to move forward..
  26.         else
  27.             count()
  28.             turtle.dig()
  29.             turtle.attack()
  30.         end
  31.     else
  32.         print("END OF PROGRAM")
  33.     end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement