StarCraft: Difference between revisions
DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Blizzard Entertainment}} |Publishers = {{Game.InfoBox.Publisher|Blizzard Entertainment}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|March 31, 1998}} |Genres = {{Game.InfoBox.Genre|Real Time Strategy (RTS)}} {{Game.InfoBox.Genre|Strategy}} | PCGamingWiki = StarCraft }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = StarCraft.exe|Arguments = |WorkingDi...") |
DoctorDalek (talk | contribs) No edit summary |
||
Line 14: | Line 14: | ||
}} | }} | ||
{{Game.Scripts.NameChange | |||
|Name = Name Change Script | |||
{{Game.Scripts. | |||
|Name = | |||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = <syntaxhighlight lang="powershell" line> | ||
$NewName = $args[0] | |||
$InstallDir = $PSScriptRoot | $InstallDir = $PSScriptRoot | ||
New-Item -ItemType Directory -Force -Path "$InstallDir\characters" | |||
Copy-Item -Path "$InstallDir\Default.mpc" -Destination "$InstallDir\characters\$NewName.mpc" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{Game.Scripts. | {{Game.Scripts.KeyChange | ||
|Name = | |Name = Key Change Script | ||
|Description = | |Description = 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 [https://www.hiveworkshop.com/threads/ladiks-mpq-editor.249562/ 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 [https://www.autohotkey.com/ AutoHotkey] script that will launch a tool called [http://www.icyhell.net/2008/04/05/starcraft-cd-key-changer/ 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. | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang=" | |Contents = | ||
=== AutoHotkey Script === | |||
$InstallDir | <syntaxhighlight lang="ahk" line> | ||
#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 | |||
</syntaxhighlight> | |||
=== PowerShell Script === | |||
<syntaxhighlight lang="powershell" line> | |||
cd "$InstallDir\StarCraft Key Changer" | |||
Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDir","$args[0]" -Wait | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Revision as of 19:38, 10 August 2023
Developers | |
---|---|
Blizzard Entertainment | |
Publishers | |
Blizzard Entertainment | |
Release Date | |
Windows: March 31, 1998 | |
Genres | |
Real Time Strategy (RTS) | |
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