From e48ad695cc4bef6490f9fa356016816d59701dea Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Thu, 16 Oct 2025 20:20:46 +0900 Subject: [PATCH] . --- PHI-CL/control.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index da330b4..237c4eb 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -350,22 +350,11 @@ script.on_nth_tick(1800, function(_) end end) -local function handle_research_queue(entity) - local combinator = entity.get_or_create_control_behavior() - - if not combinator then - return - end - - if combinator.sections_count and combinator.sections_count == 0 then - combinator.add_section() - return - end - +local function handle_research_queue(combinator) local combinator_slot_1 = combinator.get_slot(1) if not (combinator_slot_1 or (combinator_slot_1.value and combinator_slot_1.value.name and combinator_slot_1.value.name == 'signal-SA')) then - combinator.add_section() + combinator.set_slot(1, {value = {type = 'virtual', name = 'signal-SA', quality = 'normal'}, min = 0}) return end @@ -437,6 +426,9 @@ local function handle_research_queue(entity) end end +local function handle_valve_value(combinator) +end + script.on_nth_tick(10, function(_) local head = #storage.phi_cl.combinator.combinator_list local max_remove = math.floor(head / 100) + 1 @@ -450,7 +442,17 @@ script.on_nth_tick(10, function(_) if entity and entity.valid then remove_count = remove_count - 1 - handle_research_queue(entity) + local combinator = entity.get_or_create_control_behavior() + + if combinator and combinator.sections_count then + if combinator.sections_count > 0 then + handle_research_queue(combinator) + handle_valve_value(combinator) + + else + combinator.add_section() + end + end end end end)