Ring of Fire - The professional Lasertower solution

What this script does: it deploys 1-360 Lasertowers. Basically.
Of course there is a twist to it...
Instead of a messy heap where they end up crashing into each other they are deployed in a very accurate and orderly circle.
Also those Lasertowers have Cloaking Devices and they are not afraid to use em.
** Transporter Device required for deployment **
So... first you load up a freighter with Lasertowers.
If you want Stealth Lasertowers (you probably do =) an additional 2 Microchips are required per Lasertower.
If you do not produce these things yourself, the Fleet Support Software from the Bonus Pack can be sent shopping for you.
Then you can either fly the ship yourself or order it to deploy the LT somewhere. If a jumpdrive is installed it will be used to get to the location - even in system if that would save noticable time.
Up to 4 arguments are required to control the placement of the defensive ring but you can set defaults so you will usually be entering nothing but the destination plus 0-1 arguments.
(Due to a change in the script system you can no longer ommit Arguments)
1st argument:
The target or location to be protected by the Lasertowers.
Your ship will travel there, using a jumpdrive if available, and start deployment.
Only jump gates are special targets. Any LT Ring within 5 km of a Gate will be aligned with the gate's position and axis. Directly targeting the gate will snap the Ring to a fitting position and enforce a minimum radius of 1600m.
This default radius can support up to 60 Lasertowers although fewer
or a larger radius are preferrable.
2nd argument:
Number of Lasertowers to be deployed: 1 through 360
* Enter "?" or "0" to get the in game help page.
* Entering "all" will deploy all LT in the ship's cargo bay.
If the ship also carries any Microchips it will only deploy as many
Stealth LT as it has chips for.
* Config option: set ring : Lasertowers will deployed in a ring around the target.
* Config option: set spiral : Lasertowers will deployed in a multiple spiral around the target.
* Config option: set scan # : Entering "set scan 11000" will adjust the scanners of all your Stealth LT to 11 km. This includes already deployed ones.
Allowed values are 3000 - 20000. A cloaked Lasertower scans this range for enemies and will only uncloak if any are detected.
(The range of the Lasertower's weapon is 6600 m)
* Config option: set cloak : Stealth Lasertower cloaking is controlled by their software.
* Config option: set decloak : Disable cloaking for ALL of your S.L.T. until told otherwise.
3rd argument:
Radius of the circle in metres: -10.000 through +10.000 metres.
* Entering 0 will calculate the smallest possible radius and use it.
* Entering 1 will use the radius you saved with "set".
* Config option: set # : Entering "set 1920" as a radius will save this and always use this radius when you enter "1".
Entering a negative number for the radius will override the "sensible range" check and deploy as per your order.
4th argument:
Axis orientation. What axis the circle should be drawn around: X, Y, or Z
This argument is ignored when you select a jump gate as target.
Stealth Technology:
If the cargo bay contains 2 Units of Microchips per LT then all LT will
automatically be deployed as Stealth LT. They operate like perfectly normal Lasertowers while enemies are in range but the advantage is that they cloak completely when no hostiles are close.
And completely means that they do not show up in your sector / property list any more so even with 100 Stealth Lasertowers in the sector you will no longer have a problem with finding your ships.
Also less display lag and your ships have a much easier time navigating the sector.
Friend/Foe settings:
Stealth LT routinely update their scanners with your global settings.
Some races (Xenon) apparently can't be set to neutral to your LT but it works with pirates and other races.
A LT will remain stealthed and let a pirate pass until you set pirates to Foe.
Deployment:
The ship is stopped dead while the autopilot deploys Lasertowers and it can take a while with large numbers.
This is not very useful as an instant super-weapon and intentionally so. =)
OOS Performance:
Note that unlike "regular" Lasertowers, LT deployed by this script
(whether stealthed or not) are equally efficient in and out of sector.
Due to the mechanics of OOS combat, normal LT do well... suck.

Installation:
1. Extract the ZIP into the main X3 folder while maintaining paths.
This puts everything in the right places.
2. Enable the Script editor by
changing your PILOT name to Thereshallbewings
3. Save and load the game.
Then you can change the pilot name back.
Alternatively... use the SPK version and click your heart out.
Resources used:
447013
497013
lib.ring.of.fire
plugin.ring.of.fire.lockdown
plugin.ring.of.fire.stealth
plugin.ring.of.fire.updater
plugin.ring.of.fire
setup.ring.of.fire
COMMAND_TYPE_SPECIAL_31
Version history:
----------------------------------------------
1.01 First release.
----------------------------------------------
1.02 Speech added for completing deployment
----------------------------------------------
1.03 Another radius check since X3 has a way of BUMPING ejected cargo far out based on the maximum axis sizes of the ship/LT model.
While you CAN put a LT 500 m portside of an elephant, X3 does not allow it.
----------------------------------------------
1.04 LT actually belong to you (again) when you deploy them. Yay.
----------------------------------------------
2.01 Major update: LT are stealthy now
----------------------------------------------
2.02 Finished up things, t-files, formatting stuff mostly. No critical fix.
----------------------------------------------
2.03 Fixed "incompatibility" with "some script" somebody was running. It kept blowing up my LT. PS: Stick to your OWN ships for destroying. Thanks.
Added little lockdown script to prevent regular LT from moving around.
Edit: Not fixed. That script is still running amok with ->Destroy
----------------------------------------------
2.04 Took care of potential problem a ship being aggro on a LT while claoking.
----------------------------------------------
2.10 MUCH clean up work, proper ship limits enforced, better pathing, savable default settings, auto updating scripts, etc.
Also nifty voice message so you know your LT perform a software upgrade. =)
With the auto-updater in place an uninstall is now possible but not yet planned.
----------------------------------------------
2.12 Helluvalot of clean up. Files were sprouting left and right so I wrapped all the little helpers into 1 library file. Lots easier to keep track of everything.
The updater file will only stay around long enough to upgrade all existing LT to the new version.
Improved handling for when you have a LT targeted when it wants to cloak. Finally works as intended.
----------------------------------------------
2.13 Bugfix - Config was not saved properly so saving of config did not work and decloak commands were not readable by the cloaked LT.
----------------------------------------------
2.14 Arguably better performance OOS because LT now use COMMAND_KILL_ENEMIES. They still revert to NONE while cloaked and idle.
----------------------------------------------
2.16 COMMAND_KILL_ENEMIES alone had no discernible effect.
OOS behavior tuned so LT have the exact same firepower IS and OOS.
Fixed math bug. ROF calculated and suggested wrong minimum radius.
----------------------------------------------
2.17 Display bug fixed.
----------------------------------------------
2.18 All commands that the player can input are now found in the TFile and can be edited.
Also all default names or tags of the deployed LT are in the TFile.
Cleanup for some messages and the Readme files.
Added "deploy all you got" for number of LT.
Added "autocalculate radius" for radius value.
----------------------------------------------
2.25 LT should no longer mysteriously explode in some sectors.
Optimisation to save CPU power and fps.
----------------------------------------------
2.27 Small change to allow shared command button.
----------------------------------------------