Daikatana

From LANCommander
Revision as of 00:23, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|May 23, 2000}} | PCGamingWiki = Daikatana }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = daikatana.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.NameChange |Name = Name Change Script |Description = |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> $NewName = $args[0] $InstallDir = $PSScript...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: May 23, 2000
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play daikatana.exe True

Name Change Script

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

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

Write-ReplaceContentInFile -Regex '^set name \"(.+)\"' -Replacement "set name ""$NewName""" -FilePath "$InstallDir\data\current.cfg"