Advertisement
bryceio

Computercraft Mining Sample

Oct 28th, 2018
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. --A sample way to use the mining system.
  2. --Designed to be used with Thermal Dynamics piping and a retrieval node.
  3.  
  4. function forward()
  5.     if turtle.detect() == true then
  6.         turtle.dig()
  7.     end
  8.     while turtle.attack() == true do
  9.         sleep(0.5)
  10.     end
  11.     repeat
  12.         turtle.attack()
  13.     until turtle.forward() == true
  14. end
  15.  
  16. while turtle.getFuelLevel() > 150 and turtle.getItemCount(16) >= 3 do
  17.     shell.run("mine")   --Replace this with whatever you name the main mine program
  18.     shell.run("waitforemptyinventory")    --Replace this with whatever you name the clear inventory program
  19.     turtle.select(16)       --Slot that contains your itemducts.
  20.     forward()
  21.     turtle.placeUp()
  22.     forward()
  23.     turtle.placeUp()
  24.     turtle.turnRight()
  25.     forward()
  26.     turtle.placeUp()
  27.     turtle.turnLeft()
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement