SHARE
TWEET

mining2

KingKevin23 Feb 27th, 2020 (edited) 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function mine(x)
  2.   counter = 0
  3.   repeat
  4.     turtle.dig()
  5.     moveForward(1)
  6.     turtle.digUp()
  7.     counter = counter + 1
  8.   until counter == x
  9. end
  10.  
  11. function turnAround()
  12.   turtle.turnRight()
  13.   turtle.turnRight()
  14. end
  15.  
  16. function moveForward(x)
  17.   for i = 1, x, 1 do
  18.     if turtle.forward() then
  19.       -- nichts passiert
  20.     else
  21.       if turtle.detect() then
  22.         while(turtle.detect()) do
  23.           turtle.dig()
  24.         end
  25.         moveForward(1)
  26.       else
  27.         os.shutdown()
  28.       end
  29.     end
  30.   end
  31. end
  32.  
  33. function placeTorch()
  34.   turtle.up()
  35.   turtle.select(2)
  36.   turtle.back()
  37.   turtle.place()
  38.   turtle.down()
  39. end
  40.  
  41. function stripMine(x)
  42.   for i = 1, x, 1 do
  43.     mine(3)
  44.     turtle.turnRight()
  45.     mine(5)
  46.     placeTorch()
  47.     turnAround()
  48.     moveForward(4)
  49.     mine(5)
  50.     placeTorch()
  51.     turnAround()
  52.     moveForward(4)
  53.     turtle.turnLeft()
  54.   end
  55. end
  56.  
  57. turtle.refuel()
  58. stripMine(2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top