So, Gaias Retaliation is probably in the top 3, if not the best warcraft map ever made. Thanks for your hard work and dedication, guys, and so should Blizzard; if it weren't for people like you, the game would've been long dead.
Anyway, I love how the load code gets written to the WC3 folder, which makes it a breeze to play short sessions without spending half the time typing the key. As I play solo a lot, I figured I could shorten the (already short) time it takes to load a hero, so I wrote a script in python to extract the key from the latest savegame and copy it to the clipboard, change focus to the Warcraft III window and Enter, paste load command, Enter.
I used pyinstaller to create a one-file executable with all the dependencies, and I've added it to the quick launch bar so I can load the map, alt+tab, click the icon and start playing.
Here's how you use it:
1. Download the zip file containing load.exe
2. Extract load.exe to your save folder (<WC3-folder>\GaiasRetaliation\<yournick>), you can make a shortcut to it for convenience.
3. Load the Gaias Retaliation ORPG map and press any key to enter game.
4. Press alt+tab and launch load.exe.
The WC3 window will be restored and your hero will get loaded.
Here's the code:
It has only been tested on Win10 x64 for now, but there shouldn't be any reasons for it not to work on other Windows releases. If you guys like it, I can spend some time improving it to make it more convenient, as this is just a quick script I threw together. The file size is due to it containing the python3.5 runtime and other modules to keep it self-sustained, the win32gui dependencies alone ramp up to 3.5MiB.
Anyway, I love how the load code gets written to the WC3 folder, which makes it a breeze to play short sessions without spending half the time typing the key. As I play solo a lot, I figured I could shorten the (already short) time it takes to load a hero, so I wrote a script in python to extract the key from the latest savegame and copy it to the clipboard, change focus to the Warcraft III window and Enter, paste load command, Enter.
I used pyinstaller to create a one-file executable with all the dependencies, and I've added it to the quick launch bar so I can load the map, alt+tab, click the icon and start playing.
Here's how you use it:
1. Download the zip file containing load.exe
2. Extract load.exe to your save folder (<WC3-folder>\GaiasRetaliation\<yournick>), you can make a shortcut to it for convenience.
3. Load the Gaias Retaliation ORPG map and press any key to enter game.
4. Press alt+tab and launch load.exe.
The WC3 window will be restored and your hero will get loaded.
Here's the code:
Code:
from os import path
from glob import iglob
from pyperclip import copy
import win32com.client
from win32gui import GetWindowText, GetForegroundWindow
# Get's most recently modified file
newest = max(iglob('*.txt'), key=path.getctime)
print("Newest savegame: ", newest)
# Extracts the load command from the file
with open (newest, "r") as myfile:
data=myfile.readlines()
length = len(data[4])
command = data[4][4:(length - 5)]
print("Save code: ", command)
# Adds the command to windows' clipboard using pyperclip
copy(command)
print("Save code copied to clipboard.")
# Uses win32com to set the focus to WC3 window, then presses
# enter key to activate it as it wasn't working when in fullscreen
shell = win32com.client.Dispatch("WScript.Shell")
test = shell.AppActivate('Warcraft III')
shell.SendKeys('{ENTER}')
# Makes sure you're in the WC3 window before pasting the command
if GetWindowText(GetForegroundWindow()) == "Warcraft III":
shell.SendKeys('^{V}')
shell.SendKeys('{ENTER}')
It has only been tested on Win10 x64 for now, but there shouldn't be any reasons for it not to work on other Windows releases. If you guys like it, I can spend some time improving it to make it more convenient, as this is just a quick script I threw together. The file size is due to it containing the python3.5 runtime and other modules to keep it self-sustained, the win32gui dependencies alone ramp up to 3.5MiB.