Advertisement
hevohevo

ComputerCraft Tutorial: stone_generator_0_1

Mar 4th, 2014
1,832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. -- ################################
  2. -- Stone Generator with a SilkTouch Turtle
  3. -- version 0.1
  4. -- http://hevohevo.hatenablog.com/
  5. -- This Program requires a SilkTouch Mining Turtle by "More Turtles" mod
  6. --  See CC forum.
  7. --  http://www.computercraft.info/forums2/index.php?/topic/16465-mc164152-more-turtles-v112/
  8.  
  9. local p = peripheral.wrap("right")
  10. assert((p and p.digSilkTouch), "required: SilkTouch Turtle")
  11.  
  12. for i=1,16 do
  13.   turtle.select(i)
  14.   turtle.refuel()
  15. end
  16.  
  17. local fuel = turtle.getFuelLevel()
  18.  
  19. while fuel > 0 do
  20.   if turtle.detect() then
  21.     p.digSilkTouch()
  22.     turtle.dropDown()
  23.     fuel = fuel - 1
  24.     print(fuel)
  25.   else
  26.     turtle.dig()
  27.     turtle.dropDown()
  28.   end
  29.   os.sleep(1.5)
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement