Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------
- --IC2:reactorVentDiamond - Алмазный теплоотвод (27)
- --IC2:reactorHeatSwitchSpread - Компонентный теплообменник (8)
- --IC2:reactorVentSpread - Компонентный теплоотвод (4)
- --IC2:reactorUraniumDual - Сдвоенный топливный стержень (Уран) (15)
- --------------------------------------------------------------------
- local sides = require "sides"
- local robot = require "robot"
- local component = require "component"
- local inv = component.inventory_controller -- Контроллер инвентаря
- -- Массивы для хранения слотов с предметами
- local VentDiamondArray = {}
- local HeatSwitchDiamondArray = {}
- local VentSpreadArray = {}
- local UraniumDualArray = {}
- -- Счётчики
- local VentDiamondCount = 1
- local HeatSwitchDiamondCount = 1
- local VentSpreadCount = 1
- local UraniumDualCount = 1
- -- Сортировка предметов в инвентаре
- for i = 1, 64 do
- robot.select(i)
- local ActiveItem = inv.getStackInInternalSlot()
- if ActiveItem ~= nil then
- if ActiveItem.name == "IC2:reactorVentDiamond" then
- VentDiamondArray[VentDiamondCount] = i
- VentDiamondCount = VentDiamondCount + 1
- elseif ActiveItem.name == "IC2:reactorHeatSwitchSpread" then
- HeatSwitchDiamondArray[HeatSwitchDiamondCount] = i
- HeatSwitchDiamondCount = HeatSwitchDiamondCount + 1
- elseif ActiveItem.name == "IC2:reactorVentSpread" then
- VentSpreadArray[VentSpreadCount] = i
- VentSpreadCount = VentSpreadCount + 1
- elseif ActiveItem.name == "IC2:reactorUraniumDual" then
- UraniumDualArray[UraniumDualCount] = i
- UraniumDualCount = UraniumDualCount + 1
- end
- end
- end
- -- Размещение компонентов в нужных слотах
- VentDiamondCount = 1
- HeatSwitchDiamondCount = 1
- VentSpreadCount = 1
- UraniumDualCount = 1
- for BeginSlot = 1, 54 do
- if BeginSlot % 2 == 0 then
- -- Установка алмазных теплоотводов
- if VentDiamondArray[VentDiamondCount] then
- robot.select(VentDiamondArray[VentDiamondCount])
- robot.drop(1)
- VentDiamondCount = VentDiamondCount + 1
- end
- end
- if BeginSlot == 11 or BeginSlot == 17 or BeginSlot == 29 or BeginSlot == 31 or BeginSlot == 33 or BeginSlot == 35 or BeginSlot == 47 or BeginSlot == 53 then
- -- Установка продвинутых теплообменников
- if HeatSwitchDiamondArray[HeatSwitchDiamondCount] then
- robot.select(HeatSwitchDiamondArray[HeatSwitchDiamondCount])
- robot.drop(1)
- HeatSwitchDiamondCount = HeatSwitchDiamondCount + 1
- end
- end
- if BeginSlot == 13 or BeginSlot == 15 or BeginSlot == 49 or BeginSlot == 51 then
- -- Установка компонентных теплоотводов
- if VentSpreadArray[VentSpreadCount] then
- robot.select(VentSpreadArray[VentSpreadCount])
- robot.drop(1)
- VentSpreadCount = VentSpreadCount + 1
- end
- end
- if BeginSlot == 1 or BeginSlot == 3 or BeginSlot == 5 or BeginSlot == 7 or BeginSlot == 9 or BeginSlot == 19 or BeginSlot == 21 or BeginSlot == 23 or BeginSlot == 25 or BeginSlot == 27 or BeginSlot == 37 or BeginSlot == 39 or BeginSlot == 41 or BeginSlot == 43 or BeginSlot == 45 then
- -- Установка урановых стержней
- if UraniumDualArray[UraniumDualCount] then
- robot.select(UraniumDualArray[UraniumDualCount])
- robot.drop(1)
- UraniumDualCount = UraniumDualCount + 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement