StarCraft

From LANCommander
Revision as of 19:38, 10 August 2023 by DoctorDalek (talk | contribs)
Developers
Blizzard Entertainment
Publishers
Blizzard Entertainment
Release Date
Windows: March 31, 1998
Genres
Real Time Strategy (RTS)

Strategy

View at PCGamingWiki

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

New-Item -ItemType Directory -Force -Path "$InstallDir\characters"
Copy-Item -Path "$InstallDir\Default.mpc" -Destination "$InstallDir\characters\$NewName.mpc"

Key Change Script

StarCraft stores the CD key in the stardat.mpq archive. This is a custom archive format used by Blizzard in some older games. Applications such as Ladik's MPQ Editor can manipulate this type of file, but there is currently no command-line-only way to change the key. This script will run an AutoHotkey script that will launch a tool called StarCraft CD-Key Changer and automate the input of the allocated key. For ease of distribution, it is recommended that you compile the AutoHotkey script to an .exe executable. This will allow you to run the script without having AutoHotkey installed on the client machine.

AutoHotkey Script

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#WinActivateForce  ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode, 2

Run, SCKeyChanger.exe
WinWait, ahk_exe SCKeyChanger.exe
WinGetActiveTitle, ChangerTitle
Sleep, 100
Send, C
Send, Player{Tab}

key = %2%

StringMid, keyPart1, key, 1, 4
StringMid, keyPart2, key, 5, 5
StringMid, keyPart3, key, 10, 4

Send, %keyPart1%{Tab}
Send, %keyPart2%{Tab}
Send, %keyPart3%{Enter}

Sleep, 500
Send, %1%{Enter}
Sleep, 500

WinActivate, %ChangerTitle%
WinWaitActive, %ChangerTitle%

Send, X

return

PowerShell Script

cd "$InstallDir\StarCraft Key Changer"

Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDir","$args[0]" -Wait