Some scripts written for programmable blocks in SpaceEngineers.
Look into the Program.cs files in the following folders and copy the code between the comments into a programmable block. You need to configure the script with the names of the controlled block entities.
Control script for an airlock with one inner and one outer door and an air vent.
Control script for an airlock with two inner doors and one outer door and an air vent.
Control script for a patrolling attack drone.