Advertisement
asweigart

makeanddrop

Mar 19th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. os.loadAPI('hare')
  2.  
  3. local tArgs = {...}
  4. local amount = tostring(tArgs[1])
  5. local endProg = false
  6.  
  7. while true do
  8. print('Clearing inventory...')
  9. for i = 1,16 do
  10. hare.doActions('sel ' .. i .. ' dr 64')
  11. end
  12.  
  13. print('Gathering...')
  14. for k,v in pairs({1,2,3,5,6,7,9,10,11}) do
  15. hare.doActions('sel ' .. v .. ' s ' .. amount)
  16. if turtle.getItemCount() ~= amount then
  17. print('Slot ' .. v .. ' did not have the expected ' .. amount .. ' items.')
  18. endProg = true
  19. break
  20. end
  21. end
  22. if endProg == true then break end
  23.  
  24. hare.doActions('sel 16 c 64 drd 64')
  25. print('Crafted.')
  26. end
  27.  
  28. print('Clearing inventory...')
  29. for i = 1,16 do
  30. hare.doActions('sel ' .. i .. ' dr 64')
  31. end
  32. print('Ended.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement