Advertisement
babulm

Untitled

Dec 14th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. rednet.open("right")
  2. atmid = 13210
  3. while true do
  4. id, anzahl = rednet.receive()
  5. item = 0
  6. slot = 1
  7. slot2 = 1
  8. if id == atmid then
  9. for i = 1,15 do
  10. turtle.select(i)
  11. plus = turtle.getItemCount(i)
  12. item = item + plus
  13. end
  14. if item >= tonumber(anzahl) then
  15. while tonumber(anzahl) > 0 do
  16. if tonumber(anzahl) > 64 then
  17. turtle.select(slot)
  18. turtle.dropUp(64)
  19. anzahl = anzahl - 64
  20. slot = slot + 1
  21. end
  22.  
  23. if tonumber(anzahl) <= 64 then
  24. turtle.select(slot)
  25. turtle.dropUp(tonumber(anzahl))
  26. anzahl = 0
  27. end
  28. end
  29. rednet.send(atmid,"5")
  30. end
  31. for i = 1,15 do
  32. turtle.select(i)
  33. turtle.drop()
  34. end
  35.  
  36. rednet.send(1,"5")
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement