LostMiner

general purpose auto harvester

Nov 2nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Miner by Block Change--
  2.  
  3. --Global Var--
  4. t = turtle
  5. base = t.inspect()
  6.  
  7. --Functions--
  8. function mine()
  9.     if not (t.inspect() == base) then
  10.         t.dig()
  11.         return true
  12.     else
  13.         return false
  14.     end
  15. end
  16.  
  17. function store()
  18.     --select and place chest-
  19.     t.select(1)
  20.     t.placeUp()
  21.     --store all besides first 2 slots--
  22.     for i=16,3,-1 do
  23.         t.select(i)
  24.         t.dropUp()
  25.     end
  26.     --select chest slot, get chest--
  27.     t.select(1)
  28.     t.digUp()
  29. end
  30. function replace()
  31.     --select and place chest--
  32.     t.select(2)
  33.     t.placeUp()
  34.     --select item slot and get item--
  35.     t.select(3)
  36.     t.suckUp(1)
  37.     --replace item--
  38.     t.place()
  39.     --select chest slot--
  40.     t.select(2)
  41.     --get chest--
  42.     t.digUp()
  43. end
  44.  
  45. function cycle()
  46.     if mine() then
  47.         store()
  48.         replace()
  49.     end
  50. end
  51.  
  52. --Main--
  53. function main()
  54.     while true do
  55.         cycle()
  56.     end
  57. end
  58.  
  59. main()
Advertisement
Add Comment
Please, Sign In to add comment