Knito

cobble

Sep 23rd, 2019
150
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- pastebin get 9iJeSQ91 cobble
  2.  
  3. -- compatible with 1.14.4 cc_tweaked (computercraft fork)
  4. -- 2019-09-24 Konitor
  5.  
  6. -- This is meant to harvest the cobblestone
  7. -- which is generated from a cobble generator
  8. -- a redstone signal turns harvesting off
  9. -- (put a lever on any side and switch it on)
  10. -- mining turtle needed!!!! (= turtle + diamond pickaxe)
  11.  
  12. -- L = Lava Source
  13. -- W = Water Source
  14. -- O = some block (cobble, dirt)
  15. -- X = generated block to be mined
  16.  
  17. -- OW   LO
  18. -- OO  XOO
  19. -- OO OOOO
  20. -- OOOOOOO
  21.  
  22. -- Block to be harvested is in front of turtle
  23. -- A chest below the turtle collects
  24. -- No fuel needed ever as turtle won't move
  25.  
  26. -- label your turtle ie "label set Cobbler"
  27.  
  28. if os.getComputerLabel() == nil then
  29.   os.setComputerLabel("Cobbler")
  30. end
  31.  
  32. -- copy this program to startup when its not "startup"
  33. -- to make it resistant against chunk reloads (ie return from nether)
  34.  
  35. me = fs.getName( shell.getRunningProgram() )
  36.  
  37. if( me ~=  "startup") then
  38.     print( "Overwriting startup with "..me )
  39.     if( fs.exists("startup") ) then
  40.         fs.delete("startup")
  41.     end
  42.     fs.copy( me, "startup" )
  43. end
  44.  
  45. while true do
  46.  
  47. signal = false
  48.  
  49. -- prevent "Too long without yielding error" by sleeping
  50.  
  51. sleep( 0.5 )
  52.  
  53. if signal == false then signal = rs.getInput("top") end
  54. if signal == false then signal = rs.getInput("front") end
  55. if signal == false then signal = rs.getInput("left") end
  56. if signal == false then signal = rs.getInput("right") end
  57. if signal == false then signal = rs.getInput("back") end
  58. if signal == false then signal = rs.getInput("bottom") end
  59.  
  60.  
  61. if signal == false then
  62.    
  63. if turtle.detect() then
  64.  
  65.  turtle.dig()
  66.  turtle.dropDown()
  67.  
  68. else
  69.  
  70. -- prevent "Too long without yielding error" by sleeping
  71.  
  72.  sleep(0.5)
  73.  
  74. end
  75. end
  76. end
RAW Paste Data