Re: NWN:EE bat files
Posted: Tue Jun 05, 2018 8:33 am
*worked amazingly untill the update a fiew days ago; now gets "Could not translate error"*
A Neverwinter Nights Persistent World -- Register using the -forum_pwd command in-game.
https://forum.nwnarelith.com/
It's working, thank you. Also, I think (I know it is obvious, but...) you should mention separately that you have to launch the fourth option in the .bat file, "NWN: Main", and not the other three, which connect directly to the specified server.triaddraykin wrote: ↑Tue Jun 05, 2018 6:19 pmSee previous post. Which version are you using? If you post yours (remove and personal information if you want) I can adapt it so that it just launches the main NWN file without using the currently-broken +connect feature, so that it still produces logs.
Code: Select all
@echo off
::Your NWNL:EE log directory location on the next line.
set EEDocDir="C:\Users\user\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Users\user\Desktop"
::The location of your logs folder of your 1.69 install on the next line
set NWN169Dir="E:\GalaxyClient\Games\NWN Diamond"
:: Your 1.69 nwmain.exe install directory on the next line, only modify if it's different location from your logs folder
set NWN169GameDir=%NWN169Dir%
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: 1.69 PGCC Arena
echo 5. NWN: 1.69 FL
set /p servervar= Server Number:
if %servervar% lss 4 (
set logdir=%EEDocDir%
cd /D %EEInstallDir%
if %servervar% == 1 start /wait steam://rungameid/704450 +connect game.arelith.com:5121
if %servervar% == 2 start /wait steam://rungameid/704450 +connect game.arelith.com:5122
if %servervar% == 3 start /wait steam://rungameid/704450 +connect game.arelith.com:5123
)
if %servervar% gtr 3 (
set logdir=%NWN169Dir%
cd /D %NWN169GameDir%
if %servervar% == 4 start /wait steam://rungameid/704450 +connect arena.arelith.com:5121
if %servervar% == 5 start /wait steam://rungameid/704450 +connect fl.arelith.com:5121
)
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt
Code: Select all
@echo off
::Your NWNL:EE log directory location on the next line.
set EEDocDir="C:\Users\Triaddraykin\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="C:\Users\Triaddraykin\Desktop"
::The location of your logs folder of your 1.69 install on the next line
set NWN169Dir="E:\GalaxyClient\Games\NWN Diamond"
:: Your 1.69 nwmain.exe install directory on the next line, only modify if it's different location from your logs folder
set NWN169GameDir=%NWN169Dir%
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: 1.69 PGCC Arena
echo 5. NWN: 1.69 FL
set /p servervar= Server Number:
if %servervar% lss 4 (
set logdir=%EEDocDir%
cd /D %EEInstallDir%
if %servervar% == 1 start /wait steam://rungameid/704450 +connect game.arelith.com:5121
if %servervar% == 2 start /wait steam://rungameid/704450 +connect game.arelith.com:5122
if %servervar% == 3 start /wait steam://rungameid/704450 +connect game.arelith.com:5123
)
if %servervar% gtr 3 (
set logdir=%NWN169Dir%
cd /D %NWN169GameDir%
if %servervar% == 4 start /wait steam://rungameid/704450 +connect arena.arelith.com:5121
if %servervar% == 5 start /wait steam://rungameid/704450 +connect fl.arelith.com:5121
)
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt
Code: Select all
@setlocal enableextensions enabledelayedexpansion
@echo off
::Your NWNL:EE docoument directory on the next line, the location of your logs directory and nwnplayer.ini
set EEDocDir="C:\Users\Triaddraykin\Documents\Neverwinter Nights"
::Your EE nwmain.exe install directory on the next line
set EEInstallDir="D:\SteamLibrary\steamapps\common\Neverwinter Nights\bin\win32"
echo Select a Server
echo 1. NWN: EE Distant Shores
echo 2. NWN: EE Cities and Planes
echo 3. NWN: EE Surface
echo 4. NWN: Main
set /p servervar= Server Number:
if %servervar% lss 5 (
set logdir=%EEDocDir%
cd /D %EEInstallDir%
if %servervar% == 1 start /wait nwmain.exe +connect game.arelith.com:5121
if %servervar% == 2 start /wait nwmain.exe +connect game.arelith.com:5122
if %servervar% == 3 start /wait nwmain.exe +connect game.arelith.com:5123
if %servervar% == 4 start /wait nwmain.exe
)
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set TODAY=%YYYY%-%MM%-%DD%
set NOW=%HH%-%Min%-%Sec%
move %logdir%\logs\nwclientLog1.txt %logdir%\logs\log-%TODAY%-%NOW%.txt
Code: Select all
#Your NWNL:EE docoument directory on the next line, the location of your logs directory and nwnplayer.ini
$EEDocDir = Get-Item "$env:HOMEDRIVE$env:HOMEPATH\Documents\Neverwinter Nights"
$EELogDir = "$EEDocDir\logs"
#Your EE nwmain.exe install directory on the next line
$EEInstallDir = Get-Item "D:\SteamLibrary\steamapps\common\Neverwinter Nights\bin\win32"
$nwmain = Get-Item "$EEInstallDir\nwmain.exe"
#set nwnplayer.ini & player name
$playerIni = 'nwnplayer.ini'
$playerBak = 'nwnplayer.bak'
Push-Location $EEDocDir
$playerName = (Get-Item $playerIni | Select-String '^Player Name=.*').Matches.Value.Split('=')[-1]
$newPlayerName = Read-Host -Prompt "Enter new player name (Enter to keep $playerName)"
if ($newPlayerName -eq '') {$newPlayerName = $playerName}
Pop-Location
#update player name
if($newPlayerName -ne $playerName){
Rename-Item $playerIni $playerBak -ErrorAction Stop
Get-Content $playerBak |%{
if ($_ -match '^Player Name=.*'){
Write-Output "Player Name=$newPlayerName"
} else {
Write-Output $_
}
} | Out-File -Encoding ascii -Append $playerIni
if(Test-Path $playerIni) {Remove-Item $playerBak}
}
#backup logs
$numberToKeep = 50
$dateStamp = Get-Date -Format 'yyyyMMddHHmmss'
Push-Location $EELogDir
Rename-Item nwclientLog1.txt "nwclientLog_$dateStamp.txt"
$logs = (Get-ChildItem nwclientLog_*.txt)
if ($logs.Count -gt $numberToKeep){
$numberToDelete = $logs.Count - $numberToKeep
(0..(--$numberToDelete))|%{$logs[$_].Delete()}
}
Pop-Location
#select a server
$prompt = @"
Select a Server
1. NWN: EE Distant Shores
2. NWN: EE Cities and Planes
3. NWN: EE Surface
"@
$server = Read-Host -Prompt $prompt
#launch NWN
if ($server -lt 4) {
Push-Location $nwmain.DirectoryName
Start-Process -FilePath $nwmain.FullName -ArgumentList "+connect game.arelith.com:512$server"
}