===================================================================================== Automatic Connector Actions Made by cswimr Unminified source code available at https://www.coastalcommits.com/cswimr/AutomaticConnectorActions ===================================================================================== This script will do the following things automatically whenever the host grid connects via a connector to another grid: - Disable all gyroscopes on the host grid. - Disable all thrusters on the host grid. - Set all gas tanks (Oxygen and Hydrogen) on the host grid to Stockpile. - Set the recharge mode of all batteries on the host grid to Recharge. - Check if a Nanite Control Facility is present any grid connected to the host grid. If one is present, disable all Nanite Beacons on the host grid. Additionally, whenever the host grid disconnects from a connector, the script will: - Enable all gyroscopes on the host grid. - Enable all thrusters on the host grid that are prefixed with `[MANEUVERING]`. - Set all gas tanks (Oxygen and Hydrogen) on the host grid to not Stockpile. - Set the recharge mode of all batteries on the host grid to Auto. - Check if a Nanite Control Facility is present on the host grid. If one is not present, enable all Nanite Beacons on the host grid. This allows for ships to dock with piston connectors without having to convert the other grid to a station. You can also do this with normal timer blocks and event controllers, but they are not very reliable in my personal experience. You can optionally invoke the script manually, through something like an event controller. The arguments are as follows: - `dock` - Triggers the docking process - `undock` - Triggers the undocking process If you want to use the script manually, you should disable `Polling` in the Custom Data field of the programmable block running the script. All configuration for this script is stored in the Programmable Block's Custom Data field. Please DO NOT modify anything inside of this script unless you know what you're doing! ===================================================================================== MIT LICENSE Copyright 2024 cswimr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! ===================================================================================== DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING! =====================================================================================