$config = Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'Euro Truck Simulator 2\config.cfg' if (!(Test-Path $config)) { Write-Host "Nie znaleziono config.cfg!" -ForegroundColor Red return } function Set-ETS2Config($name, $value) { $content = [System.IO.File]::ReadAllText($config) $pattern = '(?m)^uset ' + [regex]::Escape($name) + ' "[^"]*"' if ($content -notmatch $pattern) { Write-Host "Nie znaleziono ustawienia: $name" -ForegroundColor Red return } $content = [regex]::Replace( $content, $pattern, "uset $name `"$value`"" ) [System.IO.File]::WriteAllText($config, $content) Write-Host "Zmieniono $name na $value!" -ForegroundColor Green } while ($true) { Clear-Host Write-Host "====== ETS2 CONFIG TOOL ======" -ForegroundColor Cyan Write-Host "" Write-Host "1. Wlacz kamere 0" Write-Host "2. Wlacz konsole" Write-Host "3. Zwieksz limit konwoju do 128" Write-Host "0. Wyjscie" Write-Host "" $choice = Read-Host "Wybierz opcje" switch ($choice) { "1" { Set-ETS2Config "g_developer" "1" } "2" { Set-ETS2Config "g_console" "1" } "3" { Set-ETS2Config "g_max_convoy_size" "128" } "0" { return } default { Write-Host "Nieprawidlowa opcja!" -ForegroundColor Yellow } } Write-Host "" Read-Host "Nacisnij Enter, aby wrocic do menu" }