Logs: Difference between revisions
Sorrowkitten (talk | contribs) Added Linux rotator |
Sorrowkitten (talk | contribs) mNo edit summary |
||
Line 104: | Line 104: | ||
This is a very rudimentary script that will rotate logs automatically. The way this works is by renaming and filing away the client log each time the game runs. This has an advantage of being very lean, as it doesn't wait for a process to complete. | This is a very rudimentary script that will rotate logs automatically. The way this works is by renaming and filing away the client log each time the game runs. This has an advantage of being very lean, as it doesn't wait for a process to complete. | ||
It will sort all the files by year and month, so you'll see /2024/02/<LogFile> in your directories. This is preferable as it makes it less of a blob compared to other log rotators who will save all logs in the same folder. | |||
The top 4 variables need to point in the right directions: | The top 4 variables need to point in the right directions: |
Revision as of 21:51, 26 February 2024
Arelith Wiki | |
Character Creation | |
---|---|
Creation (New Players Guide) Race - Deity - Class Gifts - Backgrounds - Alignment Marks - Epic Sacrifice Customization - Head List - Builds | |
Character Systems | |
Description - Disguise / Covered Languages - Experience - Quests Pickpocket - Rest - Role Play Bonus Death - Lycanthropy - Investigate Sequencers - Runic Sequencers | |
World Systems | |
Settlements - Factions Quarters - Shops - Taverns - Banks Riding - Sailing - Boons Communication - Portals Time - Containers/Bags Radiant Heart - Assassin's Guild Sencliff's Pirates | |
Item Creation Systems | |
Alchemy - Art Craft - Carpentry Herb - Smith - Tailor Dweomercraft - Runes | |
Armor Weapons - Melee / Ranged / Siege Resources - Poison | |
Arelith Changes | |
Classes - Skills - Feats - Trap Summons - Familiar Reskins Spells (list) - Misc | |
Help | |
Rules - Roleplay - Maps Console Commands Common Bugs - Staff Support Tickets - Character Remake [The Astrolabe] |
Chat logs are a great way to preserve RP, study combat, and have logs for peace of mind in case of report-able issues.
Turn on logging in NWN EE
How to turn on logging in NWN EE.
Batch files for Windows
Details for making .bat files.
Using steam install, not running through steam
Has the advantage of automatic log re-naming after quitting, but doesn't use Steam Workshop subscriptions
@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\<Your Username Here>\Documents\Neverwinter Nights" ::Your EE nwmain.exe install directory on the next line set EEInstallDir="C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights\bin\win32" echo Select a Server echo 1. NWN: EE Distant Shores echo 2. NWN: EE Cordor and Planes echo 3. NWN: EE Surface echo 4. NWN: EE Underdark echo 5. NWN: EE Guldorand echo 6. NWN: Main echo 7. NWN: PGCC set /p servervar= Server Number: if %servervar% lss 8 ( set logdir=%EEDocDir% cd /D %EEInstallDir% if %servervar% == 1 start /wait nwmain.exe +connect game.nwnarelith.com:5121 if %servervar% == 2 start /wait nwmain.exe +connect game.nwnarelith.com:5122 if %servervar% == 3 start /wait nwmain.exe +connect game.nwnarelith.com:5123 if %servervar% == 4 start /wait nwmain.exe +connect game.nwnarelith.com:5124 if %servervar% == 5 start /wait nwmain.exe +connect game.nwnarelith.com:5125 if %servervar% == 6 start /wait nwmain.exe if %servervar% == 7 start /wait nwmain.exe +connect arena.arelith.com:5123 ) 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
Using Steam install running through steam
Advantage of using Steam Workshop subscriptions and Steam overlay, but sludgy implementation of automatic chat logging
@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\Matta\Documents\Neverwinter Nights" ::Your EE nwmain.exe install directory on the next line set EEInstallDir="C:\Users\Matta\Desktop" set logdir=%EEDocDir% cd /D %EEInstallDir% ".\Neverwinter Nights Enhanced Edition.url" /wait 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
Explaining the commands
- @echo off
- That turns off the unsightly file path.
- cd C:\Program Files (x86)\Steam\steamapps\common\Neverwinter Nights\bin\win32
- Make sure you have this, the batch doesn't seem to work right unless you set the path before.
- echo
- This is the text that you see.
- set /p servervar= Server Number:
- This is the multiple choice script.
- server is the variable a variable and has to be set before anything can be done.
- if %servervar% == 1 start nwmain.exe +connect game.arelith.com:5121
- This called on the servervar variable (HAS to have % on either sides I believe)
- And if servervar is set to 1 then it automatically connects to the server.
Bash files for Linux (and possibly macOS)
Details for making .bash files that rotate logs.
Using steam install, not running through steam
This is a very rudimentary script that will rotate logs automatically. The way this works is by renaming and filing away the client log each time the game runs. This has an advantage of being very lean, as it doesn't wait for a process to complete.
It will sort all the files by year and month, so you'll see /2024/02/<LogFile> in your directories. This is preferable as it makes it less of a blob compared to other log rotators who will save all logs in the same folder.
The top 4 variables need to point in the right directions:
- NWN_LAUNCH
- Point this to where your game process launches out of. Don't edit anything past /steamapps as that should be correct.
- LOG_INPUT_FOLDER
- Point this to where your logs are first created.
- LOG_OUTPUT_FOLDER
- Point this where you want the log files to dump.
- LOG_MIN_LINES
- Set this the minimum number of lines the log needs to be before it will create a dump. I keep this at 100 so it doesn't copy logs for things like quick login-logout scenarios. You could increase this or lower this as you prefer.
NWN_LAUNCH=~/.local/share/Steam/steamapps/common/Neverwinter\ Nights/bin/linux-x86 LOG_INPUT_FOLDER=~/.local/share/Neverwinter\ Nights/logs LOG_OUTPUT_FOLDER=~/Documents/parsedNWNLogs LOG_MIN_LINES=100 input=$LOG_INPUT_FOLDER/nwclientLog1.txt line_count=$(wc -l < "$input") if [ "$line_count" -ge "$LOG_MIN_LINES" ]; then year=$(date -r $input +"%Y") month=$(date -r $input +"%m") outputfolder=$LOG_OUTPUT_FOLDER/$year/$month/ outputname=$(date -r $input +"%Y-%m-%d_%H:%M").txt echo -e "Copying $input to $outputfolder as $outputname" mkdir -p $outputfolder && cp $input $outputfolder$outputname else echo "Skipping log copy. Lines in log are fewer than $LOG_MIN_LINES." fi cd "$NWN_LAUNCH" nohup ./nwmain-linux & disown exit