Disclamer: Make a backup copy of your nwnplayer.ini player before using this.
Since it does a find and replace method, it might mess something up. Haven't had problems, but good to be safe.
Most people use a batch file to direct connect to their NWN servers. You can slot this into your current setup:
Code: Select all
:start
cls
@echo off
C:
cd %~dp0
if not exist nwnvar.cmd (set expacc=blank
goto varset)
call nwnvar.cmd
echo.
echo Current Account: %preacc%
echo.
rem ^ Goes at the very start of the file. The rest can be put anywhere and called with "goto Account"
:Account
cls
echo.
echo 1. blank
echo 0. Back
set /p accvar= Account:
if %accvar% == 1 set expacc=blank
if %accvar% == 0 goto start
call :setaccount
goto start
exit
:setaccount
setLocal EnableDelayedExpansion
if exist nwnplayer.tmp del nwnplayer.tmp
for /f "tokens=* delims= " %%a in (nwnplayer.ini) do (
set str=%%a
set str=!str:%preacc%=%expacc%!
echo !str! >> nwnplayer.tmp
)
del nwnplayer.ini
rename nwnplayer.tmp nwnplayer.ini
call :varset
goto start
exit
:varset
(echo set preacc=%expacc%) > nwnvar.tmp
del nwnvar.cmd
rename nwnvar.tmp nwnvar.cmd
goto start
exit
And to add more accounts you just add in "if %accvar% == 2 set expacc=wew" and a corresponding echo up above.
For anyone who doesn't use batch files right now, I made a cleaned up version of what I have should you like.
Set it in your nwn folder and set up a shortcut.
Code: Select all
:start
cls
@echo off
C:
cd %~dp0
if not exist nwnvar.cmd (set expacc=blank
goto varset)
call nwnvar.cmd
echo.
echo Current Account: %preacc%
echo.
echo Select a Thing
echo 1. Servers
echo 2. Accounts
echo 3. NWN
echo 4. Toolset
echo 5. DMClient
echo 6. NWServer
set /p menu= What do:
if %menu% == 1 goto Menuserv
if %menu% == 2 goto Account
if %menu% == 3 start nwmain.exe
if %menu% == 4 start nwtoolset.exe
if %menu% == 5 start nwmain.exe -dmc
if %menu% == 6 start nwserver.exe
exit
:Menuserv
cls
echo.
echo 1. Cordor
echo 2. Surface
echo 3. Fixed Level
echo.
set /p servervar= Server Number:
if %servervar% == 11 start nwmain.exe +connect 138.201.20.77:5123
if %servervar% == 12 start nwmain.exe +connect 138.201.20.77:5124
if %servervar% == 13 start nwmain.exe +connect 138.201.20.77:5126
exit
:IPs
set /p ipvar= Enter the IP:
start nwmain.exe +connect %ipvar%
exit
:Account
cls
echo.
echo 1. blank
echo 0. Back 00. New Account
set /p accvar= Account:
if %accvar% == 1 set expacc=blank
if %accvar% == 00 goto Names
if %accvar% == 0 goto start
call :setaccount
goto start
exit
:Names
echo.
echo This will not be saved to your list of accounts.
set /p expacc= Enter the Account:
call :setaccount
goto start
:setaccount
setLocal EnableDelayedExpansion
if exist nwnplayer.tmp del nwnplayer.tmp
for /f "tokens=* delims= " %%a in (nwnplayer.ini) do (
set str=%%a
set str=!str:%preacc%=%expacc%!
echo !str! >> nwnplayer.tmp
)
del nwnplayer.ini
rename nwnplayer.tmp nwnplayer.ini
call :varset
goto start
exit
:varset
(echo set preacc=%expacc%) > nwnvar.tmp
del nwnvar.cmd
rename nwnvar.tmp nwnvar.cmd
goto start
exit