In a nutshell the code is:
Code: Select all
local combinator = entity.surface.create_entity({ name = "decider-combinator",
position = { entity.position.x + 1, entity.position.y } , force = entity.force })
log("controlBehavior before: "..inspect(combinator.get_or_create_control_behavior().parameters))
combinator.get_or_create_control_behavior().parameters =
{ first_signal = { type="item", name="iron-plate"}, constant = 100, comparator = "<",
output_signal = { type="item", name="copper-plate"}, copy_count_from_input = false }
log("controlBehavior after: "..inspect(combinator.get_or_create_control_behavior().parameters))
The log output is:
I would be very grateful for tips on what I am doing wrong.30.370 Script control.lua:46: controlBehavior before: {
parameters = { comparator = ">", constant = 0, copy_count_from_input = true,
first_signal = { type = "item" },
output_signal = { type = "item" }
}
}
30.370 Script control.lua:54: controlBehavior after: {
parameters = { comparator = ">", constant = 0, copy_count_from_input = true,
first_signal = { type = "item" },
output_signal = { type = "item" }
}
}