Guest User

Untitled

a guest
Dec 10th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. function counter()
  2. local i = 0
  3. return function() i = i + 1 return i end
  4. end
  5. function modStr(num)
  6. if num < 10 then
  7. return "0" .. num
  8. else
  9. return num
  10. end
  11. end
  12. while true do
  13. if turtle.detect() then
  14. turtle.dig()
  15. term.clear()
  16. term.setCursorPos(1,1)
  17. local total = 0
  18. for i=1,16,1 do
  19. total = total + turtle.getItemCount(i)
  20. end
  21. for i=1,16,1 do
  22. print("Row " .. i .. ": " .. turtle.getItemCount(i) .. " (" .. math.floor((turtle.getItemCount(i)/total)*100) .. "%)")
  23. end
  24. print("Total: " .. total)
  25. print("-----------------")
  26. local iterator = counter()
  27. print(" ___ ___ ___ ")
  28. print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
  29. print("|___|___|___|")
  30. print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
  31. print("|---|---|---|")
  32. print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
  33. print("|___|___|___|")
  34. print(" ")
  35. print("-----------------")
  36. print("Cobble Farmer")
  37. end
  38. totalcount = turtle.getItemCount(16)
  39. if totalcount == 64 then
  40. term.clear()
  41. term.setCursorPos(1,1)
  42. print("Dropping Stacks")
  43. print("...Please wait.")
  44. sleep(1)
  45. for i=1,16 do
  46. turtle.select(i)
  47. turtle.drop()
  48. end
  49. turtle.select(1)
  50. end
  51. end
Add Comment
Please, Sign In to add comment