Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = require('robot')
- local comp = require('computer')
- local term = require('term')
- local com = require('component')
- local inv = require('component').inventory_controller
- local crafting = require('component').crafting
- --========ТАБЛИЦЫ КРАФТОВ==========--
- uranFuel = {}
- uranFuel[5] = {}
- uranFuel[3] = {}
- uranFuel[5]['IC2:itemUran238'] = {kol = 6, 1,2,3,9,10,11}
- uranFuel[3]['IC2:itemUran235small'] = {kol = 3, 5,6,7}
- moxFuel = {}
- moxFuel[5] = {}
- moxFuel[3] = {}
- moxFuel[5]['IC2:itemUran238'] = {kol = 6, 1,2,3,9,10,11}
- moxFuel[3]['IC2:itemPlutonium'] = {kol = 3, 5,6,7}
- function rasstan(item,side)
- if item[side] ~= nil then
- r.select(15)
- for slot = 1 , inv.getInventorySize(0) do
- if inv.suckFromSlot(0,slot) then
- if item[side][inv.getStackInInternalSlot(15).name] ~= nil then
- if inv.getStackInInternalSlot(15).size >= item[side][inv.getStackInInternalSlot(15).name].kol then
- r.select(15)
- r.transferTo(4,item[side][inv.getStackInInternalSlot(15).name].kol)
- r.dropDown()
- r.select(4)
- for i=1,item[side][inv.getStackInInternalSlot(4).name].kol do
- r.transferTo(item[side][inv.getStackInInternalSlot(4).name][i],1)
- end
- return true
- else
- r.dropDown()
- end
- else
- r.dropDown()
- end
- end
- end
- return false
- else
- return false
- end
- end
- function sbros(side)
- if side == 5 then
- r.turnLeft()
- end
- for slot1=1, r.inventorySize() do
- if r.count(slot1) > 0 then
- r.select(slot1)
- r.drop()
- end
- end
- if side == 5 then
- r.turnRight()
- end
- end
- function craft(item)
- if item[3] ~= nil then
- if not rasstan(item,3) then
- return false
- end
- end
- if item[5] ~= nil then
- a = 0
- while not rasstan(item,5) do
- a = a + 1
- if a > 5 then
- for a=1,16 do
- if r.count(a)>0 then
- r.select(a)
- r.dropDown()
- end
- end
- return false
- end
- end
- end
- crafting.craft()
- r.dropDown()
- end
- while true do
- for i=1,4 do
- craft(uranFuel)
- craft(moxFuel)
- end
- i=1
- r.select(15)
- while inv.suckFromSlot(0,i) do
- if inv.getStackInInternalSlot(15).name == 'IC2:itemPlutoniumSmall' then
- if inv.getStackInInternalSlot(15).size >= 9 then
- kol = inv.getStackInInternalSlot(15).size
- size = kol - (kol)%9
- r.transferTo(4,size)
- r.dropDown()
- r.select(4)
- kol = r.count(4)
- for i=1,11 do
- if i%4 ~= 0 then
- r.transferTo(i,kol/9)
- end
- end
- os.sleep(1)
- r.select(8)
- os.sleep(1)
- crafting.craft()
- os.sleep(1)
- r.dropDown()
- r.select(15)
- else
- r.dropDown()
- end
- else
- r.dropDown()
- end
- i=i+1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement