CnCTA Xenn0X AutoSIM v1 - how to load it
========================================

This is an unpacked Chrome extension. It works in Chrome, Edge, Brave and other Chromium browsers.

1. Unzip this archive somewhere permanent (for example Documents). Chrome loads the extension from that
   folder every time it starts, so don't delete or move the folder afterwards.

2. Remove (or switch off) any older script pack: "CnCTA SoO SCRIPT PACK" from the Web Store and the earlier
   "CnCTA SoO SCRIPT PACK (updated)". Otherwise every script is loaded twice.

3. Open chrome://extensions (Edge: edge://extensions).

4. Turn on "Developer mode" (top right).

5. Click "Load unpacked" and choose the unzipped folder: the one that contains manifest.json.
   "CnCTA Xenn0X AutoSIM v1" appears in the list. Make sure it is switched on.

6. 21 of the 22 scripts are switched on by default; TACS (a second battle simulator) is off. You can switch any of them on or off in the options
   (click the extension's icon in the toolbar -> OPTIONS; you may need to pin it via the puzzle-piece menu).

7. Reload the game tab.

Checking that it works
----------------------
- Open an attack on a base. Under the TABS button box there is an "Optimize" button.
- Open the browser console (F12 -> Console) and run:   SOO_SHIM.report()
  On the current game version every lookup should be "ok", with none "via fallback" or "failed".

Using the Auto Optimizer
------------------------
Set up your attack, press "Optimize", pick a priority and a budget, press Start.
The window opens on "CY" with 20 sims: a quick test for a CY kill, start with that. If it finds none, switch to
"CY (else DF) + low repair" for a DF-first run.
About "CY (else DF) + low repair" (first ~20 sims go for the CY like the CY priority; if none destroys it: destroy the CY; if no formation can, destroy the Defense Facility,
leave as little defense standing as possible and push on the CY for your next attack; then the lowest repair
time wins). It tries, in order: matchup placement, focus strikes (Vertigos + cloaked Commando, also carried in
a Reckoner), lane shifts, and once the CY falls it leaves expensive units at home. As soon as the CY or the DF is
down (on a second attack: right away) it also tries an "air strike": only your air units down the CY lane.
Each simulation takes about 3 seconds (the game's own limit). Don't move units or leave the screen while it runs.
At the end the best formation found is placed on the board (or yours is restored if nothing was better).

Tools in the Optimizer window
-----------------------------
- Remembered best: the best formation for each base is saved and tried first next time.
- Report check: after an attack a small window compares the raid report with the simulation. If the CY survived,
  opening the attack on that base again opens the optimizer ready to re-simulate for the CY.
- "Repair this formation": repairs only the units that are switched on.
- "Rank targets...": run the Basescanner first, then press "Rank" in its window (or "Rank targets..." here): it ranks
  the bases by CY kill, DF kill and loot per repair hour. Quick: 1 sim per base. Deep: up to 5 per base
  (focus strikes and matchup formations), slower but closer to what the Optimizer finds.
- "Notifications": switch on and allow them when the browser asks.

Updating later
--------------
Replace the files in the folder, then click the reload arrow on the extension in chrome://extensions.
