Advertisement
BanditDragon

Find Item and stack

Jul 20th, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local robot = require("robot")
  4.  
  5. for i =1,16 do
  6. local slot = i
  7. local item = component.inventory_controller.getStackInInternalSlot(slot)
  8.  
  9. if item then
  10. if item.name==("minecraft:wheat_seeds")then
  11. print("slot "..slot.. " Found It" )
  12. robot.select(i)
  13. if i<16 then
  14. robot.transferTo(i+1)
  15. end
  16. component.inventory_controller.equip()
  17. else
  18. print("slot "..slot.."Not Correct Item")
  19.  
  20. end
  21.  
  22. else print ("slot"..slot.. " is empty")
  23. end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement