Advertisement
camarajohnny

SpeedsOXCOmpress

Mar 10th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. canChest = peripheral.wrap("left")
  2. oxComp = {{p = peripheral.wrap("front"),d = "south"},{p = peripheral.wrap("top"),d = "down"}}
  3.  
  4. function getCan()
  5. local found = 0
  6. while found == 0 do
  7. canChest.condenseItems()
  8. found = canChest.pushItem("east",1,1)
  9. end
  10. end
  11.  
  12. function startUp()
  13. local item = turtle.getItemDetail()
  14. if item ~= nil then
  15. if item.damage > 0 then
  16. if oxComp[1].getStackInSlot(1) == nil then
  17. turtle.drop()
  18. end
  19. if oxComp[2].getStackInSlot(1) == nil then
  20. turtle.dropUp()
  21. end
  22. end
  23. end
  24. if oxComp[1].p.getStackInSlot(1) == nil then
  25. getCan()
  26. turtle.drop()
  27. end
  28. if oxComp[2].p.getStackInSlot(1) == nil then
  29. getCan()
  30. turtle.dropUp()
  31. end
  32. turtle.dropDown()
  33. end
  34.  
  35. turtle.select(1)
  36. startUp()
  37.  
  38. while true do
  39. if turtle.suck() == true then
  40.  
  41. while turtle.dropDown() == false do
  42. print("OutPut chest problem")
  43. sleep(0.5)
  44. end
  45. getCan()
  46. while turtle.drop() == false do
  47. print("frontal bloackage")
  48. sleep(0.5)
  49. end
  50. end
  51. if turtle.suckUp() == true then
  52.  
  53. while turtle.dropDown() == false do
  54. print("OutPut chest problem")
  55. sleep(0.5)
  56. end
  57. getCan()
  58. while turtle.dropUp() == false do
  59. print("frontal bloackage")
  60. sleep(0.5)
  61. end
  62. end
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement