Neverwinter Nights: Enhanced Edition

Neverwinter Nights: Enhanced Edition

Not enough ratings
NWN Loot Alert
By FluffyBunnyFeet
While playing NWN, have you ever missed an event, or a message from a friend, or didn't realize something occurred? With this script, you can get notified when;
. you're getting low XP?
. you've been pick-pocketed?
. someone sends you a 'tell'?
. running low on ammunition?
. a potion's effects have worn off?
. critical hit an enemy?
. weapon has no effect
. your DPS/DPP is higher than X points of damage?

Now you can with the NWN Loot Alert!

This script provides:
* Alerting on specific strings/sub-strings in that log (via audio file or TTS (text-to-speech).
* Statistics/Counters on current character's "total/lifetime" and "recent"):
* XP/GP gained (net)
* Damage dealt/taken/absorbed.
* Kills/Deaths
* Hits/misses count, (including critical hits).
* Hit/miss ratio.
* And much more [with updated releases], such as, but not limited to; spells cast, saving throws resisted/failed, most killed/favored enemy, items (potions/wands/scrolls,etc) used, healing performed (especially for healing/support classes), etc.
* Provides TTS (Text-To-Speech) feedback for recent damage/kills via hotkeys.
* Swap between multiple characters storing their statistics in configuration files, allows for 'lifetime' statistics gathering!
* Uses hotkeys to initialize counter/statistics of current character (No manual input of in-game chat strings)
* Provides a condensed recent combat log for you to easily review who hit whom, who killed whom, etc. Resets/blanks out when user selects to re-initialize the current character's statistics.
   
Award
Favorite
Favorited
Unfavorite
Purpose
Custom script (external) to scan the nwnclientlog1.txt and provide;
* Alerting on specific strings/sub-strings in that log (via audio file or TTS (text-to-speech).
* Statistics/Counters on current character's "total/lifetime" and "recent"):
* XP/GP gained (net)
* Damage dealt/taken/absorbed.
* Kills/Deaths
* Hits/misses count.
* Hit/miss ratio.
* And much more [with updated releases], such as, but not limited to; spells cast, saving throws resisted/failed, most killed/favored enemy, items (potions/wands/scrolls,etc) used, healing performed (especially for healing/support classes), etc.
* Provides TTS (Text-To-Speech) feedback for recent damage/kills via hotkeys.
* Swap between multiple characters storing their statistics in configuration files, allows for 'lifetime' statistics gathering!
* Uses hotkeys to initialize counter/statistics of current character (No manual input of in-game chat strings)
* Provides a condensed recent combat log for you to easily review who hit whom, who killed whom, etc. Resets/blanks out when user selects to re-initialize the current character's statistics.

Download
DOWNLOAD
=======================
Main Program: http://www.vanrenier.com/misc/NWN/NWN_LootAlert.zip

Addtl. AudioAlerts: http://www.vanrenier.com/misc/NWN/NWN_LootAlert_AudioAlerts.zip
(not needed if you're downloading the above current release)

Steps
1. Download (see below)
2. Extract to a folder (not on desktop)
3. Run the executable (might have to disable your AV for this folder as the compiler sometimes triggers false-positives)
4. If NWN is already running, you may need to restart it on initial execution of the script.
5. in the systray icon, click the icon then 'Show Statistics'.
6. In-game, use hotkey "CTRL+ALT+0" (Control Alt Zero) to initialize counters for the current character.
Press the hotkey, again, to reset the 'recent' statistics.
What it does...
1. Makes 2 changes in your NWNplayer.ini file, enabling verbose logging, allowing NWN to write out events such as "*You find loot*", etc.
These changes only take affect upon the start of NWN, and only need to be performed once (unless you change them, or uninstall/reinstall the game).
2. Scans your nwnclientlog1.txt file at specified intervals (default is 3 seconds) for any sub-strings in "AlertOn" section of the INI.


You have a number of options available to you in the program:



You can configure up to 200 watchers:



Edit your alert notifications to sound an audio file (wav, mp3, etc), or play a message of your choice, using TTS (text-to-speech):



And along with being notified of an unlimited array of events that may happen, you also can also get statistics on your current character, which is saved and can be restored upon next playing that character. Keep statistics on any number of characters you have, on any server, or any player name you wish.


Hotkeys
Hotkeys are enabled (will look at alternative hotkeys if needed):
Init statistics for the current player/character. . . . CTRL+ALT+0
(Once collecting statistics for the current character, pressing this hotkey again will reset the 'recent' stats (but not alter the 'lifetime' stats).

(You can show/hide the statistics window using hotkey CTRL+ALT+E -but that window does not need to be visible for the statistics to be gathered).
Show/Hide statistics window. . . . . . . . CTRL+ALT+E
Give Audible Feedback. . . . . . . . . . . CTRL+ALT+H
. Pressed twice, rapidly, to hear a TTS (text-to-speech) hotkey options.
Delete any existing PIDs from another instance. . . . . . . . CTRL+ALT+D
Exit script. . . . . . . . . . . . . . . . CTRL+ALT+X
(saving any collected statistics on the current character upon exiting).

The following Hotkeys allows user to change view of the NLA window, while in-game.
These allow changing the urrently selected tab:
Tab Left. . . . . CTRL+ALT+NUMPAD4
Tab Right. . . . CTRL+ALT+NUMPAD6

These allow scrolling of the recent combat events log.
Jump to top. . . . . . . . . . . .CTRL+ALT+NUMPAD7
Jump to bottom. . . . . . . . .CTRL+ALT+NUMPAD1
Page up. . . . . . . . . . . . . . CTRL+ALT+NUMPAD9
Page down. . . . . . . . . . . . CTRL+ALT+NUMPAD7
Scroll up (line-by-line). . . CTRL+ALT+NUMPAD8
Scroll down (line-by-line). CTRL+ALT+NUMPAD2

Revision History
REVISION HISTORY
=======================
2019-08-30 v3.6.3
! Fixed: Resetting of recent counters not occurring on subsequent INIT strings of same character (v3.6.1).
! Fixed: Intermittent clearing of Character name ($sPlayerToonName) throughout script (v3.6.1).
(Was different than the earlier issue with the "Script intermittently losing Character name and subsequently losing character stats", which was referencing the field value within the Statistics window being blanked out).
! Fixed: Script now gives proper hotkey list (via TTS) upon using CTRL+ALT+H when pressed twice quickly.

2019-08-30 v3.6.1
! Fixed: Logging values incorrectly caused the most verbose logging (if the value of the line to be written was 9/ALL, then that line was ALWAYS written even if the user selected a lesser logging level (e.g. 3, which should normally only log FATAL, ERROR, WARN events).
! Fixed: Voice Report for DPP (Damage Per Poll) wasn't resetting upon the net polling interval, menaing the DPP would just keep incrementing and the VoiceReport would continue to count the number as it grew. DPP now properly resets upon the next polling interval.
! Fixed: Script intermittently losing Character name and subsequently losing character stats. Turned out to be an improperly-formatted REGEX when attempting to get the Character name from the "Initiative Roll" lines.
! Fixed: Resolved/Prevented double-processing of INIT string lines (1 in the CHAT WINDOW TEXT, and another starting with the PlayerName. Now, we ignore the CHAT WINDOW TEXT, only processing of the 2nd line.

2019-08-29 v3.5.5
+ Added: Voice Reporting (using TTS, Text-To-Speech) of last polling interval damage dealt.
(Note: This option is still in BETA-stage, and only accessible by manually changing the INI file entry, and OFF by default)
+ Added: Random INIT Strings, changes after each use of a new hotkey that enters the values in for you. (No longer requires users to manually type them in-game (or use a valuable hotbar spot for a custom macro). Hotkey: CTRL + ALT + 0 (zero) initiates the statistics.
! Fixed: Changing to a different character, after already loading a character's statistics, now works (at least by using the hotkey, CTRL+ALT+0 ) e.g. "NOT SET" -> "Character1" -> "Character2" ("Character2" will now get set).
! Fixed: Using the in-game chat commands to assign counters/statistics works, but failed to assign the character name in GUI. (Recommend using the new HOTKEYS instead of in-game chat).
2019-08-23 v3.2.1
! Fixed: automated assigning of the Character/toon name upon using the in-game TRIGGER commands, some errant behavior with populating the GUI w the Character name. Using the in-game chat commands to assign counters/statisitcs works, but fails to assing the character name (but does properly get assigned at 1st sign of combat ('initiative roll'). NOTE: While the automated assigning of player/character name does work, it won't take affect until combat starts. It is highly recommended to usethe hotkeys to manually assign the values once you load up the character.
+ Added: REGEX pattern matching (although issues with "|" in the patterns, it gets incorrectly interpretted as a field delimiter).
! Fixed: Changing to a different character, after already loading a character's statistics, doesn't update the characters name in the statistics window. e.g. "NOT SET" -> "Character1" -> "Character2" ("Character2" will not get set). Currently, you'll need to exit/re-start the script to load up a different set of counters.
! Fixed: If someone on the same server is also running the script and they INIT COUNTERS, your script may misinterpet their command against your statistics.
! Fixed: Options to perform automated backup of NWN client log file were not yet fully implemented. Now working:
. a) On X minute Intervals.
. b) On exit/closing of NLA.
. (Manual backups, via the Systray Option "Backup NWN client log Now", do work, though)

2019-08-21 v3.2.0
+ Added automated assigning of the character name (upon events: "initiative roll", or similar telling events).
! Fixed: some errant behavior with assigning the Character name.

2019-08-17 v3.1.8

! Fixed: the Recent Combat events control, so there are no more issues (hopefully) with multiples lines being concatenated on a single line. However, I've also limited the number of events in the log to 500 lines. The closer you get to that 500, the background color of the control will change. At 500 lines, additional lines will be added to the list, but the oldest lines will start to be removed (1 old line for each new line, meaning there will never be more than 500 lines).
! Fixed: damage taken (total/recent) were sometimes going under 0 (zero) due to a incorrect operand. Total damage dealt being incorrectly calculated, when you take no damage (but have damage reduction employed).

2019-08-16 v3.1.5
+ Added a DPS counter, showing the total DPS your character is doing. (Note: This is only updated at each scanning interval, so it might not seem to accurately represent your actual damage, but it is ( TotalRecentDamageDealt / ScanningInterval ).
! Fixed total damage dealt from being incorrectly calculated
! Statistics/Counters! The following are now implemented and working fine, updated in near-real time:
. * Kills/Deaths
. * Damage:
. * DPS
. Dealt
. Taken
. Absorbed
. * Hits/Misses
. Hits
. Critical hits
. Misses
. * Hit:Miss Ratio
. * XP gained (net)
. * Gold acquired (net)

2019-08-15 v3.1.0
+ Finished the GUI for general options.
! Altered the systray icon menu items: Some items got removed entirely, while others were only moved.
! Change the behavior of the statistics window.
+ Enabled toggling (showing/hiding) the statistics window via systray icon.
! Fixed [GUI] options to automate back up of the NWN log file.
+ Statistics/Counters! The following are now implemented and working fine, updated in near-real time:
. * Kills/Deaths
. * Damage:
. Dealt
. Taken
. Absorbed
. * Hits/Misses
. Hits
. Critical hits
. Misses
. Hit:Miss Ratio
. * XP gained (net)
. * Gold acquired (net)

2019-08-10 v2.0.5
! Overhauled the debug/log file logging INI value. Now, the "Debug/Logging" will accept the following:
VALUES EXPLANATION
--------- ---------------------------
OFF, 0 With this level, nothing gets logged at all (AT ALL).
FATAL, 1 The fatal level, like ERROR, designates a problem.
ERROR, 2 The ERROR level denotes a serious problem that has to be dealt with.
WARN, 3 The WARN level designates potentially harmful occurrences.
INFO, 4 INFO logging are for messages about routine application operation.
DEBUG, 5 The debug level is not a lot of mystery.
TRACE, 6 Think of this like DEBUG, but on steroids.
ALL, 9 Any/all logging events will be logged.

+ New INI keys;
KEY VALUES EXPLANATION
WriteLogLinesToConsole Boolean (0 or 1) Allows for any line output to the log file to also by written to the editor console (really only useful when developing code).
OverwriteLogFile Boolean (0 or 1) Allows for automatically overwriting/deleting previous log files in favor of the content forthe current instance.

2019-08-08 v2.0.3
+ Added ProcessStats for application in the "About" option. Provides the following info (as collected at the time the user cliks the about option):
MEMORY
WorkingSetSize
PeakWorkingSetSize
IO
Number of read operations performed.
Number of write operations performed.
Number of I/O operations performed, other than read and write operations.
Number of bytes read.
Number of bytes write.
Number of bytes transferred during operations other than read and write operations.
4 Comments
IceLancer 13 Mar @ 3:31pm 
Thank you!
FluffyBunnyFeet  [author] 13 Mar @ 11:43am 
IceLancer, I'll look into a modification to work with nwn2player.ini for you.
IceLancer 4 Oct, 2023 @ 10:25pm 
I am mainly looking for exp count and loot notification. Which are already present as i could make it search by keyword. If only it would accept path change for nwn2
IceLancer 4 Oct, 2023 @ 10:22pm 
Hello, i tried using this for nwn2. But tool wont accept path change to nwn2player.ini and keep reverting to nwn1 ini.
Any chance to make that work for nwn2?