Advertisement
Wassaa

Move Items to next machine

May 25th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. p = peripheral.wrap("back")
  2. items = p.getAllStacks()
  3. Dir = "South"
  4.  
  5. function doSorting(_index)
  6.     items = p.getAllStacks()
  7.     if items[_index] ~= nil then
  8.             p.pushItem(Dir, _index)
  9.     end
  10. end
  11.  
  12. while true do
  13.     os.sleep(10)
  14.     table.foreach(items, doSorting)
  15.     print("Moving stuff")
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement