Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Allows multiple autocast powers in City of Heroes. Uses only free tools, and probably only works on Windows (not Linux or Mac).
- This Powershell script, Automate-CoH2.ps1, allows you to have multiple keys that automatically engage when a power recharges.
- Setup instructions:
- * Install or have installed a recent version of Powershell. Anything v5 or later should work I think. See https://docs.microsoft.com/en-us/powershell/ for details.
- * Save the contents of https://pastebin.com/D8FJaMWV to a file called "Automate-CoH2.ps1".
- * Download the zip version of AutoIt from https://www.autoitscript.com/site/autoit/downloads/.
- * Extract just the AutoItX folder from the zip file and place it in the same folder you placed Automate-CoH.ps1 above. Make sure there's a folder called AutoItX there, and the files from that folder in the zip are inside that folder.
- * Change the option in City of Heroes to log all chat to a file. Launch and play CoH for a few minutes to generate the log file.
- Find the log file folder in your CoH installation folder. My installation folder is E:\Games\CityOfHeroes but yours will surely be different. My logs file folder under that folder is E:\Games\CityOfHeroes\MyLogonName\logs.
- * Create a CSV file in the logs folder call "KeysData.csv". It's contents should be something like this:
- "CharacterName", "Keys", "MinTime", "Power"
- "LordOfTheFlies", "0", "0", "Fiery Embrace"
- "LordOfTheFlies", "9", "0", "Healing Flames"
- "MemoryMan", "8", "0", "Burn"
- "MemoryMan", "7", "0", "Consume"
- The first line being the header. Subsequent lines are as the header line indicates:
- 1. Name of character in the game.
- 2. The keys to press when the power recharges. The allowed format is as documented for the "keys" parameter of the SendKeys function of AutoIt at https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm. Additionally, you can use "*" to have the script send a mouse button press to the CoH window where the cursor currently is. You can also use "+*" for a shift click, "!*" for an alt-click, or "^*" for a control-click. N.B.: The need for sending left mouse presses has decreased substantially since the introduction of the powexeclocation command to CoH.
- 3. The minimum time in seconds between key presses. So if the power recharges in 5 seconds but its effects last 30 you can put 30 here so the key isn't pressed for 30 seconds instead of immediately when the power is recharged.
- 4. The name of the power to monitor, exactly as the game spells it.
- You can put as many additional lines in the file for each of your characters. Each power to monitor is its own line in the file, and you can have as many entries for each character as you'd like.
- * Launch City Of Heroes and enter the game with your character.
- * Launch Powershell.
- * In the powershell window, type
- & "<Path to PS1 file>/Automate-CoH2.ps1"
- of course, substituting the actual folder name where you placed the PS1 file for <Path to PS1 file> above.
- This will activate the CoH window and type a self-tell into the window. This allows the script to grab the name of the current character out of the log and find the relevant entries from the CSV file to use.
- At this point you'll have to activate each power once to start with, but once each of the relevant powers are recharged the given keys should be sent and the power reactivated. Wa-la!
- Some follow up notes:
- * The script will automatically exit if it detects (the last running instance of) the game is shut down.
- * I set up binds in the game to send a self-tell, one with the word "pause" and another with the word "stop". The script watches for these and will either pause the sending of keys (with "pause"), or stop altogether if it detects a self-tell with the word "stop".
- * When starting a character I like to set up a bunch of macros, so I also included this ability into the script. Adding "-StartCharacter" after the name of the script (w/o the quotes) will send the keys to create these macros and a couple other things to the CoH window, then exit. See the script for details, and feel free to place your own commands there instead, or just ignore all this if you don't want to use it.
- * The script supports multi-boxing, so if you have multiple City Of Heroes windows running, it will work for them all.
Add Comment
Please, Sign In to add comment