Advertisement
thatparadox

itemDetail

Sep 27th, 2014
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. -- Video of it in action: https://www.youtube.com/watch?v=kTzkTcCTVZg&list=PL9XabkF_A5YhxWelwj2yzjcegL9E0WLw6
  2.  
  3. for i = 1, 16 do --checks all of the turtles slots
  4.   for k, v in pairs(turtle.getItemDetail(i)) do --read the table that gets generated
  5.    if k == "damage" and v ~= 0 then -- checks if the item is damaged
  6.     turtle.select(i) --selects the slot with the damaged item
  7.     turtle.drop() --drops the item
  8.    end
  9.   end
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement