Advertisement
M0n5t3r

Untitled

Jun 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. function empty_all()
  2. if turtle.drop() then
  3. for q=1,16 do
  4. turtle.select(q)
  5. turtle.drop()
  6. end
  7. else
  8. local one_up = 0
  9. local cannot_drop = 0
  10. local could_drop = 0
  11. print("chest is full!")
  12. repeat
  13. repeat
  14. turtle.up()
  15. sleep(1)
  16. if turtle.drop() then
  17. could_drop = 1
  18. print("Could drop?")
  19. end
  20. one_up = one_up + 1
  21. print(one_up)
  22. until could_drop == 1 or one_up == 5
  23. until could_drop == 1 or one_up == 5
  24. if one_up ~= 5 then
  25. for q=1,16 do
  26. turtle.select(q)
  27. turtle.drop()
  28. end
  29. else
  30. cannot_drop = 1
  31. end
  32. repeat
  33. turtle.down()
  34. one_up = one_up - 1
  35. until one_up == 0
  36. if cannot_drop == 1 then
  37. print("no storage!")
  38. term.write("Enter something if it's fixed")
  39. read()
  40. print("gonna try again")
  41. empty_all()
  42. end
  43. end
  44. end
  45. empty_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement