Space Engineers

Space Engineers

Not enough ratings
Multipurpose Filter and Control Block
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
2.255 KB
2 Jun, 2015 @ 11:05am
9 Sep, 2016 @ 12:42am
12 Change Notes ( view )

Subscribe to download
Multipurpose Filter and Control Block

Description
Easily filter blocks and apply actions on them or change their properties using the argument string of the programmable block!

UPDATE 22. Jul. 2015
Fixed: Compatibility with new PB API

UPDATE 16. Jun. 2015
Added: option -g has now an optional parameter -g <BlockGroup> that selects all blocks of the given block group

UPDATE 15. Jun. 2015
Added: support for new Boolean properties. (e.g. "-value OnOff=0/1" or "-value OnOff=true/false")
Added: new option -text: set the text for lcd panels (see below for more details)
Added: new option -line: updates a single line for lcd panels (see below for more details)
Added: new option -info: displays available actions and properties for selected blocks

Don't forget to rate this workshop item if you find it useful.

If you need help to use the script or have some suggestions to improve it, let me know.

Use the -info option to get a list of available properties and actions printed in the terminal of the programmable block.

EXAMPLES
Example 1 - Display properties and values for all blocks / a block named "TestBlock"
-info
-withName "TestBlock" -info
Example 2 - Turn off all interior lights
-ofType InteriorLight -action OnOff_Off
Example 3 - Set color of lights
-ofType Light -withName Red -value Color=255:0:0
Example 4 - Turn off all blocks but the reactors
-!ofType Reactor -action OnOff_Off
Example 5 - Turn on red lights, set intensity to 5 and turn off green lights
-ofType Light -withName Red -action OnOff_On -value Intensity=5 -g -ofType Light -withName Green -action OnOff_Off
Example 6 - Set a battery to recharge/discharge mode and display a line of text on a LCD panel
-ofType Battery -value Recharge=true -g -withName "LCD Panel" -line "0=Battery is recharging"
-ofType Battery -value Recharge=false -g -withName "LCD Panel" -line "0=Battery is discharging"

OPTIONS
-info - Displays available actions and properties for selected blocks
-g - Reset block list/Slect all blocks (i.e. start a new command chain)
-g <BlockGroup> - Starts a new command chain and selects all blocks of the given block group
-ofType <TypeName> - Select blocks of given type. You can use shortcuts like "InteriorLight" instead of "MyInteriorLight" or use "Light" for all types of Light
-!ofType <TypeName> - same as -ofType but selects blocks that are NOT of the given type
-withName <Name> (-!withName <Name>) - Selects blocks that (do not) include the given name
-action <ActionName> - Applies the given action on all blocks of the previous filter chain.
-value <ValueName>═<Value> - Sets the given value for all blocks of the previous filter chain
Encodings for different values:
> Numbers: 1 / 1.5
> Color: R:G:B
> Boolean: true/1/false/0
-local - Selects blocks that are on the same grid as the programmable block
-text <text> - Sets the text for all text panels contained in the filter chain
-line "<linenum>═<text>" - Updates the text of a single line for all text panels contained in the filter chain
26 Comments
TheTownWitchDoctor 10 Feb, 2019 @ 11:27am 
I should've just tried it, yes it seems to work fine but I don't think I can do what I want with it. It doesn't like the complex LCD names I have and I can't see an option for font size/type.
d4rky1989  [author] 10 Feb, 2019 @ 10:23am 
Hello, haven't installed SE right now. Maybe you can try if the script is still working. If it is not working I can fix it.
TheTownWitchDoctor 10 Feb, 2019 @ 9:20am 
Does this still work? I need a script to change font size and font between Monospace/debug on some LCD screens when I run it with an argument for boot screens.
d4rky1989  [author] 9 Sep, 2016 @ 12:43am 
Updated script to work with the new game version
d4rky1989  [author] 21 Nov, 2015 @ 2:07pm 
I'm sorry, but I'm not extending this script any more. Just keeping it running in case of API changes. Hopefully, when having enough time, I am able to finish implementation of the successor script that is more flexible to extend with new functions and that has a shorter syntax
mmille14 21 Nov, 2015 @ 12:32pm 
Wow, nice work. Is it possible to redirect the -info to a LCD panel? I am speciffically looking for a way to rename LCD panels so I can use the same panel for several different scripts. Of, course finding your script has also given me many more ideas. AT this rate my ship is never getting out of drydock :))
d4rky1989  [author] 8 Nov, 2015 @ 12:46am 
I've just tested it and it worked for me. Have you ensured to set the ownership of all blocks?
Tearin 7 Nov, 2015 @ 1:48pm 
Well... It's not working for me. It is a small ship. I'm using the rotor trick to connect a small ship to a large one. Would that make a difference?
d4rky1989  [author] 7 Nov, 2015 @ 12:53am 
Yes, as soon as the target block appears in the 'K'-menu it is also accessible for the programmable block.
Tearin 6 Nov, 2015 @ 5:02pm 
Dose this work with blocks on the other end of a rotor?