StarCraft: Difference between revisions

From LANCommander
(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...")
 
No edit summary
Line 14: Line 14:
}}
}}


{{Game.ActionBox
{{Game.Scripts.NameChange
|Actions =
|Name = Name Change Script
{{Game.ActionBox.Row|Name = Play|Path = StarCraft.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
 
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents = <syntaxhighlight lang="powershell" line>
$NewName = $args[0]
$InstallDir = $PSScriptRoot
$InstallDir = $PSScriptRoot


cd "$InstallDir\StarCraft Key Changer"
New-Item -ItemType Directory -Force -Path "$InstallDir\characters"
 
Copy-Item -Path "$InstallDir\Default.mpc" -Destination "$InstallDir\characters\$NewName.mpc"
Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDir" -Wait
</syntaxhighlight>
</syntaxhighlight>
}}
}}


{{Game.Scripts.NameChange
{{Game.Scripts.KeyChange
|Name = Name Change Script
|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="powershell" line>
|Contents =
$NewName = $args[0]
=== AutoHotkey Script ===
$InstallDir = $PSScriptRoot
<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"


New-Item -ItemType Directory -Force -Path "$InstallDir\characters"
Start-Process "Change StarCraft Key.exe" -ArgumentList "$InstallDir","$args[0]" -Wait
Copy-Item -Path "$InstallDir\Default.mpc" -Destination "$InstallDir\characters\$NewName.mpc"
</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)

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