Advertisement
ivan52

uplotnenie

Aug 8th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. local r = require('robot')
  2. local comp = require('computer')
  3. local term = require('term')
  4. local com = require('component')
  5. local inv = require('component').inventory_controller
  6. local crafting =  require('component').crafting
  7. --======= С П И С О К   Д Л Я    У П А К  О В К И ========--
  8. small = {}
  9. small['IC2:itemDustSmall'] = true
  10. small['IC2:itemPlutoniumSmall'] = true
  11. --=================== М У С О Р ==========================--
  12. trash = {}
  13. trash['IC2:itemDust'] = false
  14. while true do
  15.   allSlot = inv.getInventorySize(3)
  16.   for slot = 1,allSlot do
  17.     if inv.getStackInSlot(3,slot) ~= nil then
  18.       if small[inv.getStackInSlot(3,slot).name] == true then
  19.         if inv.getStackInSlot(3,slot).size >= 9 then
  20.           kol = inv.getStackInSlot(3,slot).size
  21.           size = kol - (kol)%9
  22.           r.select(4)
  23.           inv.suckFromSlot(3,slot,size)
  24.           kol = r.count(4)
  25.           for i=1,11 do
  26.             if i%4 ~= 0 then
  27.               r.transferTo(i,kol/9)
  28.             end
  29.           end
  30.           os.sleep(1)
  31.           r.select(8)
  32.           os.sleep(1)
  33.           crafting.craft()
  34.           os.sleep(1)
  35.           r.drop()
  36.           r.select(4)
  37.         end
  38.       elseif trash[inv.getStackInSlot(3,slot).name] == false then
  39.         inv.suckFromSlot(3,slot)
  40.         r.dropDown()
  41.       end
  42.     end
  43.   end
  44.   if inv.getStackInSlot(3,allSlot-8) ~= nil then
  45.     while r.suck() do end
  46.   end
  47.   for i = 1 , r.inventorySize() do
  48.     if r.count(i) > 0 then
  49.       r.select(i)
  50.       if small[inv.getStackInInternalSlot(i).name] == true then
  51.         r.drop()
  52.       else
  53.         r.dropDown()
  54.       end
  55.     end
  56.   end
  57.   r.select(4)
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement