The Perfect Tower II

The Perfect Tower II

37 ratings
A Collection of Facility AI Scripts
By wolfram.stahl
Once unlocked in the Headquarters, you can use Scripts to automate many parts of the game or at least reduce the amount of carpal tunnel inducing clicking you have to do. These Scripts can be really powerful, but also a pain in the ass to write. That's why I decided to try and save you from that hassle and share some of the more useful Scripts I use.
Don't expect them to be clean or optimal, but they do work quite well. I might rewrite them if there's enough demand.
   
Award
Favorite
Favorited
Unfavorite
Autoclick
Let's start with the most basic automation: autoclicking at the current mouse position.

I use two variants of autoclicking script. The first one just clicks at the current cursor position as fast as possible. Useful mainly for tedious upgrading in the lab, e.g. Fire, Earth or Air experiment (also Electricity, but that one was too annoying even with an autoclicker script, so I wrote another script specifically for that), or upgrading technology in the HQ.

To use the Script, go to Headquarters / Facility AI and import the following:
CWF1dG9jbGljawEAAAAFa2V5LmMAAAAAAgAAAA1nZW5lcmljLmNsaWNrDm1vdXNlLnBvc2l0aW9uDGdlbmVyaWMuZ290bwhjb25zdGFudAIBAAAA
Press F4 to start the AI overlay and hit "C" (as in "click") to start clicking. Press F4 again to stop.

The second Script comes in 4 parts and autoclicks at a set interval, default is 10 seconds. I mainly use it on the second floor of Power Plant (constructing dyson drones) and Mine (scanning for clusters). Import these to use it:
DlNsb3dfYXV0b2NsaWNrAQAAAAVrZXkueAAAAAAJAAAAEWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BAtDbGlja190aW1lcghjb25zdGFudAMAAAAAAAAkQA1nZW5lcmljLmNsaWNrDm1vdXNlLnBvc2l0aW9uEWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BAdzZWNvbmRzCGNvbnN0YW50AwAAAAAAAAAADGdlbmVyaWMud2FpdAhjb25zdGFudAMAAAAAAADwPxFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFudAQHc2Vjb25kcxFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQHc2Vjb25kcwhjb25zdGFudAQBKwhjb25zdGFud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XA= BXJlc2V0AQAAAAVrZXkucgAAAAACAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAVyZXNldAhjb25zdGFudAIBAAAADGdlbmVyaWMuc3RvcAhjb25zdGFudAQFcmVzZXQ=

With AI overlay active (F4 to toggle that), hit "X" to start autoclicking with a default interval of 10 seconds. To increase the interval by 1 second, hit "8" and to decrease it by 1 second hit "2". Reset the running timer by hitting "R" (performs 1 click instantly). (I use 8 and 2 for that because they correspond to up and down on the num pad. If you want to change that, edit the Speed_up and Slow_down Scripts respectively and change the Impulse).
While the script is running, you can see the set interval (click_timer) and the counting timer(seconds) in the top right corner of your window:
Tower Testing - Skills
Doesn't get much more basic than this.
BnNraWxscwEAAAAFa2V5LnMAAAAABgAAABd0b3dlci5tb2R1bGUudXNlaW5zdGFudAhjb25zdGFudAIBAAAAF3Rvd2VyLm1vZHVsZS51c2VpbnN0YW50CGNvbnN0YW50AgIAAAAXdG93ZXIubW9kdWxlLnVzZWluc3RhbnQIY29uc3RhbnQCAwAAABd0b3dlci5tb2R1bGUudXNlaW5zdGFudAhjb25zdGFudAIEAAAADGdlbmVyaWMud2FpdAhjb25zdGFudAMAAAAAAAAAQAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

Start the Script by hitting "S" with the AI overlay active and it will try to use 4 tower skills every 2 seconds. Change the order of the "use module" lines in the script if you want to give priority to skills lower down in the list. If you want to use more than 4 skills, just add more of the appropriate lines to the script (should be self-explanatory).
Change the "2" in line 5 if you want it to try and fire your skills at a different interval or delete line 5 completely if you want skills to start instantly as soon as they are off cooldown.
Mining
(Edit: I re-wrote my mining script. It now fits in 1 script instead of 2, is a lot cleaner and should be as fast as it can theoretically get. )

(Edit 2: Ok I was wrong. It gets faster. Like several times faster. Make the script more stupid and it's stupid fast. Don't bother writing loops and stuff! You want 16 dig actions, write 16 lines of code. I hate that this is so much faster than any more "elegant" solution. Here is the code (v3), everything after it refers to v2 still, I'll rewrite this section on this guide when it's not 2 a.m.)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cml0aG1ldGljLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQHbWluZXRhYghjb25zdGFudAQBKwhjb25zdGFudAIBAAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AgIAAAAOY29tcGFyaXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEB21pbmV0YWIIY29uc3RhbnQEAjw9CGNvbnN0YW50AgwAAAAOZ2VuZXJpYy5nb3RvaWYIY29uc3RhbnQCAQAAABJ0b3duLndpbmRvdy5pc29wZW4IY29uc3RhbnQEBG1pbmU=
Open Mine and hit "9" to run.
_________

A simple mining script. Loops through all resource taps and keeps mining all layers continuously. It also keeps your drill fuelled and running.

Import this to run it:
B21pbmVfdjICAAAACW9wZW4ubWluZQVrZXkuMAEAAAASdG93bi53aW5kb3cuaXNvcGVuCGNvbnN0YW50BARtaW5lDgAAAA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQHbWluZXRhYghjb25zdGFudAIBAAAACG1pbmUudGFiDmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BAdtaW5ldGFiDW1pbmUubmV3bGF5ZXIQbG9jYWwuZG91YmxlLnNldAhjb25zdGFudAQGbWluZXh5CGNvbnN0YW50AwAAAAAAAAAACG1pbmUuZGlnDmFyaXRobWV0aWMuaW50A2QyaRBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAZtaW5leHkIY29uc3RhbnQEA21vZAhjb25zdGFudAIEAAAAA2QyaQxkb3VibGUuZmxvb3IRYXJpdGhtZXRpYy5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQGbWluZXh5CGNvbnN0YW50BAEvCGNvbnN0YW50AwAAAAAAABBAEGxvY2FsLmRvdWJsZS5zZXQIY29uc3RhbnQEBm1pbmV4eRFhcml0aG1ldGljLmRvdWJsZRBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAZtaW5leHkIY29uc3RhbnQEASsIY29uc3RhbnQDAAAAAAAA8D8OZ2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h0LmQOZ2VuZXJpYy5nb3RvaWYIY29uc3RhbnQCAQAAABJ0b3duLndpbmRvdy5pc29wZW4IY29uc3RhbnQEBG1pbmU=
To start the Script, simply open the mine window while AI overlay is active or press "0".
It's possible to have more than 1 instance of the same script active (active scripts are listed in the top left). If that's the case, things might not work as intended or break! Hit F4 to stop all active scripts and start over.
If you don't have the resources yet to mine on all layers, just make one little change:
Go to your Headquarters / Facility AI, edit the "Mine_v2" script and change the "12" in line 10 to the number of the highest mining resource tab you can afford. E.g. if you can afford continuous mining up to Workshop resources (blue) which is in the 4th mining tab, change the 12 to a 4 and you're good to go.


Having workers on mining duty won't interfere with the script (a bit of loss might be possible on the first cycle or if you have the workers on "slow (5 sec.)" speed; anything faster than that should work fine, depending on your bonus speed from the Power Plant. If your worker is able to mine one complete layer in the time it takes the script to cycle through all tabs once, it should be guaranteed lossless after the first cycle.)
Museum - Power Stones
If you have the Museum's Exotic Skill "Offshore Market" unlocked, you can use these to buy and combine power stones of any element.
The maximum tier for buying power stones is (arbitrarily) set to 30.

Import these to use the Scripts:

U - Universal:
D1N0b25lX1VuaXZlcnNhbAEAAAAFa2V5LnUAAAAAAwAAABBtdXNldW0uYnV5TWFya2V0CGNvbnN0YW50BAl1bml2ZXJzYWwIY29uc3RhbnQCHgAAAA5tdXNldW0uY29tYmluZQhjb25zdGFudAIAAAAADGdlbmVyaWMuZ290bwhjb25zdGFudAIBAAAA

F - Fire
ClN0b25lX0ZpcmUBAAAABWtleS5mAAAAAAMAAAAQbXVzZXVtLmJ1eU1hcmtldAhjb25zdGFudAQEZmlyZQhjb25zdGFudAIeAAAADm11c2V1bS5jb21iaW5lCGNvbnN0YW50AgAAAAAMZ2VuZXJpYy5nb3RvCGNvbnN0YW50AgEAAAA=

W - Water
C1N0b25lX3dhdGVyAQAAAAVrZXkudwAAAAADAAAAEG11c2V1bS5idXlNYXJrZXQIY29uc3RhbnQEBXdhdGVyCGNvbnN0YW50Ah4AAAAObXVzZXVtLmNvbWJpbmUIY29uc3RhbnQCAAAAAAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

E - Earth
C1N0b25lX2VhcnRoAQAAAAVrZXkuZQAAAAADAAAAEG11c2V1bS5idXlNYXJrZXQIY29uc3RhbnQEBWVhcnRoCGNvbnN0YW50Ah4AAAAObXVzZXVtLmNvbWJpbmUIY29uc3RhbnQCAAAAAAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

A - Air
CVN0b25lX2FpcgEAAAAFa2V5LmEAAAAAAwAAABBtdXNldW0uYnV5TWFya2V0CGNvbnN0YW50BANhaXIIY29uc3RhbnQCHgAAAA5tdXNldW0uY29tYmluZQhjb25zdGFudAIAAAAADGdlbmVyaWMuZ290bwhjb25zdGFudAIBAAAA

N - Nature
DFN0b25lX25hdHVyZQEAAAAFa2V5Lm4AAAAAAwAAABBtdXNldW0uYnV5TWFya2V0CGNvbnN0YW50BAZuYXR1cmUIY29uc3RhbnQCHgAAAA5tdXNldW0uY29tYmluZQhjb25zdGFudAIAAAAADGdlbmVyaWMuZ290bwhjb25zdGFudAIBAAAA

L - Light
C1N0b25lX2xpZ2h0AQAAAAVrZXkubAAAAAADAAAAEG11c2V1bS5idXlNYXJrZXQIY29uc3RhbnQEBWxpZ2h0CGNvbnN0YW50Ah4AAAAObXVzZXVtLmNvbWJpbmUIY29uc3RhbnQCAAAAAAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

D - Darkness
DlN0b25lX0RhcmtuZXNzAQAAAAVrZXkuZAAAAAADAAAAEG11c2V1bS5idXlNYXJrZXQIY29uc3RhbnQECGRhcmtuZXNzCGNvbnN0YW50Ah4AAAAObXVzZXVtLmNvbWJpbmUIY29uc3RhbnQCAAAAAAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

Y - Electricity
EVN0b25lX2VsZWN0cmljaXR5AQAAAAVrZXkueQAAAAADAAAAEG11c2V1bS5idXlNYXJrZXQIY29uc3RhbnQEC2VsZWN0cmljaXR5CGNvbnN0YW50Ah4AAAAObXVzZXVtLmNvbWJpbmUIY29uc3RhbnQCAAAAAAxnZW5lcmljLmdvdG8IY29uc3RhbnQCAQAAAA==

If there's a power stone type in the offshore market that you want to buy, hit F4 to enable the AI overlay and the first letter of the element you want (except for Electricity which uses "Y" since "E" is already used for "Earth"). To stop, just hit F4 again.
The process runs faster if you hit the "Fill Inventory" Button, and faster still if you click and hold the "Combine" Button.
Laboratory Experiment - Electricity
The perfect experiment for Carpal Tunnel Enthusiasts.
I've ignored this one for ages because it's just a pain in the butt and insanely tedious to progress little steps from one prestige to the next.
Now I have a (two-part) Script that takes care of the whole process in about 85 seconds.

Import these two and enjoy:
DkxhYmV4X2VsZWNfdXBnAQAAAAVrZXkuOQEAAAASdG93bi53aW5kb3cuaXNvcGVuCGNvbnN0YW50BApsYWJvcmF0b3J5DgAAABFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFudAQGeHBvc18xCGNvbnN0YW50A+xRuB6F6+k/EWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BAZ5cG9zXzEIY29uc3RhbnQDcT0K16NwzT8NZ2VuZXJpYy5jbGljaw52ZWMuZnJvbUNvb3JkcxFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQGeHBvc18xCGNvbnN0YW50BAEqDnNjcmVlbi53aWR0aC5kEWFyaXRobWV0aWMuZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAZ5cG9zXzEIY29uc3RhbnQEASoPc2NyZWVuLmhlaWdodC5kEWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BAZ4cG9zXzEIY29uc3RhbnQDAAAAAAAA7D8NZ2VuZXJpYy5jbGljaw52ZWMuZnJvbUNvb3JkcxFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQGeHBvc18xCGNvbnN0YW50BAEqDnNjcmVlbi53aWR0aC5kEWFy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YmxlLmdldAhjb25zdGFudAQGeXBvc180CGNvbnN0YW50BAErCGNvbnN0YW50AzvfT42XbpI/DmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AgkAAAARY29tcGFyaXNvbi5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQGeXBvc180CGNvbnN0YW50BAE8CGNvbnN0YW50AzMzMzMzM+M/DWdlbmVyaWMuY2xpY2sOdmVjLmZyb21Db29yZHMRYXJpdGhtZXRpYy5kb3VibGUIY29uc3RhbnQDAAAAAAAA7D8IY29uc3RhbnQEASoOc2NyZWVuLndpZHRoLmQRYXJpdGhtZXRpYy5kb3VibGUIY29uc3RhbnQDMzMzMzMz4z8IY29uc3RhbnQEASoPc2NyZWVuLmhlaWdodC5k

To start, go to your Lab and open the Electricity Experiment, and right after a Prestige enable the AI overlay, hit "9", get a glass of water and let the script do it's thing for the next ~1.5 minutes.
You'll be ready for the next prestige immediately, so just run it again and again until you can't afford it any longer.
If you have bought anything in the Electricity experiment after your last prestige, the script probably won't work (or at least won't work well), but I haven't tested that.
If it looks like this, you're fine and good to go:
...and a few moments later it looks like this, and you didn't have to move a muscle:
That's all, folks
All the "click somewhere" parts of the scripts are taking window height and width into account and should theoretically work regardless of your window size. But I haven't tested everything, and if positions of GUI elements change due to game updates (or in-game unlocks, maybe?), things will definitely break.
If that happens and you want to correct it, or if you want to write a script with "click somewhere" elements yourself but don't know what numbers to use to tell your script the right position to perform a click, you can easily find all you need using the "UNIVERSAL_MOUSE_DEBUG" script available here ("First scripts" section), along with more info on scripts generally:
Link [www.perfecttower2.com]

I've tried writing a few more Scripts, like autocrafting chips in the Factory.
Did it work? - Yes.
Did it work well? - Hell no!

Then military perks came along and the Factory's second floor came with an autocrafting system far superior to anything a Script could possibly do.
I guess the Factory just has to remain a hassle of manual tasks until second floor is unlocked.

If there's anything else you'd like to see automated with a Script but writing it yourself is just too confusing or annoying, feel free to tell me your idea and I might give it a try.
11 Comments
Chairburn 13 Apr @ 1:24pm 
Part 3. If it run to slow, just change execution budget, set 300 or more.
Chairburn 13 Apr @ 1:21pm 
Museum script my version
Part 1:


rVVdT8MgFP0rk1e1odNtidEXX4xvRh/d0lB2W8laaIBqlmX/XWBuri3tPrqXm8L94Jx7T2GFFJWs0Ao9DD5XiFDNBHcLNC0xDkd5qaDMA6UFhyAul++EpzCNqYnShGsbhO+dHXOiS1n3Dfcsrtha3BEhzobNOHQzQFOZCUqygHEdKNANhPKVfwPXQi6jQihvZdxS2X5Bmom4o3zyAnmkRUQlSere4TTpUVknUpjSDKQbSFgZiNtuZLAt1YvTtHZiaG7hYCCS6a8cNKM2qVEk7Wbkqx9ee2GP2mGHuK7SToH2wthLhO7kRAJEKhNaRXTj2eG3rg/r6Zjp/6z+kqjIY8bh7HFUZuodyO1JPdicCRykAZEKLVjizZ+0qBEMocLwUII7Dns9bYNf76kvZnj11KPXB/h4fnAvl9P/4APsO6+1CvGTdHDGjeqTX3/wLZdBX+2NL6O9Ywg8HtX8yvuBZoZLXM5NoHmJ7zA2SxM/Z7vH2QawvCgzBZvHegHLgLs8TnIwW+hN/ICMnMiiVJI52AYVhC5I6vx2aYT4vD0mIabYerb+BQ==

Chairburn 13 Apr @ 1:20pm 
Part 2:
The script buys nature gems (change lines 1 and 6 if you want a different type of gem) from the offshore market and upgrades them by +5 levels (to_tier variable, change line 5 if you want a different upgrade level). The script tries to craft 12 gems upgraded by +5 levels (line 3, change the gem_to_craft variable if you want a different amount). You can upgrade your old gems if their level is between the market level and +4 (market<=old gem<=market+4). Put them in your inventory, but the 1st slot of your inventory must be empty . The script uses the 1st slot to buy one gem from the market to find out its level (from_tier variable).
El Greggo 13 Apr @ 9:46am 
They still work. I did the mine one and i finished all levels in like 20 seconds. Thanks again.
zander! 15 Jan @ 4:29am 
I fixed it if someone is interested. :)
Maykko 10 Dec, 2024 @ 1:47am 
Museum scripts for buying powerstones from the offshore market doesn't work any more.
skyjay1 31 Jul, 2023 @ 12:48pm 
Here is a mining script that fits in 10 lines. Open the mining tab and enable the AI overlay to start. It mines every tile, generates a new layer, and switches to the next tab. Costs a couple million mining resources to run all 10 layers on all 12 tabs
{LINK REMOVED}
SethAnthony 16 Jul, 2023 @ 11:11am 
The script to use skills in battle still works and saves a lot of hassle, really surprised its not a worker action
wolfram.stahl  [author] 19 Sep, 2022 @ 4:51am 
The game probably updated several times since I wrote this, wouldn't be surprised if most scripts were broken by now.
Haven't come back to the game in a long time, but if I do I'll try and update the scripts.
Getting the RAM requirement below 137 PB will be challenging though. :D
KamikaziFly 18 Sep, 2022 @ 8:09pm 
I tried your mining script, but it failed to import due to requiring 137.42 PB RAM. lulz...