Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------------------------------------------------------
- local function entity_settings_pasted(event)
- -- copy paste entity settings from one display to another
- local source = event.source
- local dest = event.destination
- if source and dest and source.valid and dest.valid then
- if (source.name == "SD1030" or source.name == "SD1050" or source.name == "SD1070") and (dest.name == "SD1030" or dest.name == "SD1050" or dest.name == "SD1070") then
- local display1
- local display2
- for i, display in ipairs(global.display) do
- if source == display.entity then
- display1 = display
- end
- if dest == display.entity then
- display2 = display
- end
- end
- display2.signal = display1.signal
- display2.units = display1.units
- display2.Kunits = display1.Kunits
- display2.percent = display1.percent
- display2.zero = display1.zero
- display2.scale = display1.scale
- end
- end
- end
- script.on_event(defines.events.on_entity_settings_pasted, entity_settings_pasted)
Advertisement
Add Comment
Please, Sign In to add comment