Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --IC2:reactor--
- local r = require('robot')
- local comp = require('computer')
- local com = require('component')
- local inv = com.inventory_controller
- local db = com.database
- fuel = {}
- fuel['IC2:reactorUraniumSimple'] = true
- fuel['IC2:reactorMOXSimple'] = true
- othod = {}
- othod['IC2:reactorUraniumSimpledepleted'] = true
- othod['IC2:reactorMOXSimpledepleted'] = true
- sizeDB = 24
- mesto = {}
- q = 0
- for i = 1, sizeDB do
- if db.get(i) ~= nil then
- if fuel[db.get(i).name] then
- name = db.get(i).name
- q = q + 1
- mesto[q] = i
- end
- end
- end
- size = inv.getInventorySize(3)
- while true do
- while r.count(1)<q do
- i=1
- for i=1, size do
- if inv.getStackInSlot(3,i) ~= nil then
- if inv.getStackInSlot(3,i).name == name then
- inv.suckFromSlot(3, i, q - r.count(1))
- if r.count(1) == 12 then
- break
- end
- end
- end
- end
- i=i+1
- end
- for i = 1, q do
- inv.dropIntoSlot(0, mesto[i], 1)
- end
- while not r.back() do end
- r.useDown()
- while not r.forward() do end
- while not othod[inv.getStackInSlot(0,mesto[1]).name] do
- os.sleep(8)
- end
- os.sleep(15)
- while not r.back() do end
- r.useDown()
- while not r.forward() do end
- for i = 1, q do
- inv.suckFromSlot(0, mesto[i], 1)
- end
- r.turnRight()
- r.drop()
- r.turnLeft()
- end
Add Comment
Please, Sign In to add comment