bryceio

Computercraft Wait For Clear Inventory

Oct 28th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. --Part of the mining system. Waits for something (up to you) to remove all items from a mining trip.
  2. lastslot = 1    --The last slot that contains an item
  3.  
  4. --Change the 15 to whatever slot you want to be the last one you want it to check.
  5. for i = 1,15 do
  6.     if turtle.getItemCount(i) > 0 then
  7.         lastslot = i
  8.     end
  9. end
  10.  
  11. repeat
  12. sleep(0.5)
  13. until turtle.getItemCount(lastslot) == 0
Advertisement
Add Comment
Please, Sign In to add comment