Advertisement
Guest User

cobblejack

a guest
Apr 19th, 2014
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local cobblecount = 0
  2. local stackcount = 0
  3. local chestcount = 0
  4. local failed = false
  5.  
  6. digblock = function()
  7.  if turtle.dig() then
  8.   cobblecount = cobblecount + 1
  9.  else
  10.   failed = true
  11.  end
  12. end
  13.  
  14. chestcheck = function()
  15.  if stackcount >= 27 then
  16.   chestcount = chestcount + 1
  17.   stackcount = 0
  18.  end
  19. end
  20.  
  21. stackcheck = function()
  22.  if cobblecount >= 64 then
  23.   turtle.dropDown()
  24.   stackcount = stackcount + 1
  25.   cobblecount = 0
  26.  end
  27. end
  28.  
  29. printdata = function()
  30.  clearterminal()
  31.  print("Cobble jacked this session: ", newline)
  32.  printchestcount()
  33.  printstackcount()
  34.  printblockcount()
  35. end
  36.  
  37. clearterminal = function()
  38.  term.clear()
  39.  term.setCursorPos(1,1)
  40. end
  41.  
  42. printchestcount = function()
  43.  if chestcount > 1 then
  44.   print(chestcount, " Full Chests", newline)
  45.  elseif chestcount == 1 then
  46.   print("1 Full Chest")
  47.  end
  48. end
  49.  
  50. printstackcount = function()
  51.  if stackcount > 1 then
  52.   print(stackcount, " Stacks", newline)
  53.  elseif stackcount == 1 then
  54.   print("1 Stack")
  55.  end
  56. end
  57.  
  58. printblockcount = function()
  59.  if cobblecount > 1 then
  60.   print(cobblecount, " Blocks", newline)
  61.  elseif cobblecount == 1 then
  62.   print("1 Block")
  63.  end
  64. end
  65.  
  66. jacksomecobble = function()
  67.  while not failed do
  68.   chestcheck()
  69.   stackcheck()
  70.   digblock()
  71.   printdata()
  72.   sleep(2)
  73.  end
  74. end
  75.  
  76. jacksomecobble()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement