Page 1 of 4

parselog.lua : A NWN Log to HTML Convertor

PostPosted: Fri Mar 14, 2003 7:06 am
Author: izyk
*edited sat August 16th, 2003 because I moved the files *
* edited Thu November 11th, 2003 to include changes by Marcelo Resegue *

A NWN Log to HTML Convertor

I promised this in another thread, so here it is. This is the script I use to preserve and format my Neverwinter Nights log files. I spent way to much damn time on this today :->

--
If you have no idea what I am talking about,
skip to the bottom of this message and read
the section labelled "LOGGING YOUR CONVERSATION"
--

Basically, when you run the script it reads in the last log session and reformats it in HTML. An example of the output can be seen at the following url

http://www.izyk.net/avlis/parseLog/example_log.html

You will need to download this zip file below and extract it into your main NWN directory (wherever you keep nwnmain.exe).

http://www.izyk.net/avlis/parseLog/parselog.zip

DESCRIPTION

There are two files involved, parselog.lua, and lua.exe. Lua is the script interpreter and the other file is the actual script. You can read more about Lua at http://www.lua.org. To run the script all you have to do is type the following from the command line :

Code: Select all
lua parselog.lua


The output from this command will be a file named 14Mar2003_01.38.59.html - which is nothing more than the time that the script ran at. I needed something unique, that seems to do the trick.

Personally, I run a batch file. The batch file has two lines in it, which run my log parser and also starts NWN logging on straight to Mikona :

Code: Select all
  lua parselog.lua
  nwmain.exe +connect avlis.blackdagger.net:5121 +password ***********


Obviously you will want to replace the asterixes with the Mikona password.

Heh - if you like it cool. If you dont, make your own! I am nothing more than a hack, and unworthy to even look upon a real programmer. But this just makes my life easier.

Thanks
Isaac Guenard
aka Zachar

LOGGING YOUR CONVERSATIONS
The Neverwinter Nights game engine can be configured to log everything you and other characters say while you play. This is particularily useful when playing on a persistant world, like Avlis - the world I play in. The game is not configured to write a log by default - you will have to modify one of your INI configurations files.

Locate the file nwnplayer.ini in your Neverwinter Nights game directory (mine was at C:\NeverwinterNights\NWN\nwnplayer.ini) and open it with a text editor, like notepad.exe. Do not open it with a word processor such as word, these are not plain text editors. Locate the section labeled [Game Options], and add the line ClientChatLogging=1.

It should look like this :

Code: Select all
[Game Options]
ClientChatLogging=1


You may need to add this line if it is not already there.


-----------------------------------------------------------------
REVISIONS
v1.01 - March 28th, 2003
[changes by Isaac Guenard / Zachar]
modified to allow the use of the : character in conversation
old version available at
http://www.izyk.net/avlis/parseLog/parseLog_v1.01.lua

v1.02 - July 30th, 2004
[changes by Marcelo Resegue / Drysh]
added the player name after the character name to identify PCs and NPCs;
added color coding for "Whisper", "Tell", "Party" and "Shout"
fixed bug that kept last lines in log out of output
[/url]

PostPosted: Fri Mar 14, 2003 8:21 am
Author: Starslayer_D
I remember the event logged there. About the single biggest party catastrophe I was responsible for in wich I didn't die.

(Note: Never open elemental pack on a whim and dare when half your party is under lvl 7)

PostPosted: Fri Mar 14, 2003 8:41 am
Author: JollyOrc
Starslayer_D wrote:I remember the event logged there. About the single biggest party catastrophe I was responsible for in wich I didn't die.

(Note: Never open elemental pack on a whim and dare when half your party is under lvl 7)


*grin* you seem to have bad karma with these elemental packs... ;-)

PostPosted: Fri Mar 14, 2003 4:44 pm
Author: izyk
Starslayer_D wrote:I remember the event logged there. About the single biggest party catastrophe I was responsible for in wich I didn't die.

(Note: Never open elemental pack on a whim and dare when half your party is under lvl 7)



Ack. So it is. I remember that fight well. I was certain that a DM was involved because I mean, WOW, Elder Earth Elementals usually hang out a little farther from the mine entrance.

I kept waiting for the DM to step in and show us the way to defeating these grossly overpowered creatures. Finally I just wondered why the DM hated us so badly.

Heh. When I finally realized someone in our party was responsible for this...heh! Great fun - I had a blast that night. One of the many reasons I tend to hang on to log files.

Thanks
Isaac Guenard

Update Announcement

PostPosted: Mon Apr 28, 2003 8:38 pm
Author: izyk
I updated the parselog.lua script I use for reformatting my log files. The previous version would strip the remaining text on the line if it encoutered the ":" character in the dialog.

If you are using the log convertor I suggest you update.

You will need to download this zip file below and extract it into your main NWN directory (wherever you keep nwnmain.exe).

http://www.izyk.net/nwn/parselog.zip

See the first post in this thread for details on the parselog.lua script and its use.

PostPosted: Mon Apr 28, 2003 8:44 pm
Author: JollyOrc
thanks man !

It really hurt to loose these bits behind the ":", Janur's using them all the time

PostPosted: Tue Apr 29, 2003 1:20 am
Author: Liartes
Half the time it doesn't parse the log file. When I first started using it, I didn't check to see if it actually parsed, and I lost a few very good IC events to the ravages of time and memory. Now I'm sure to check every time I use it. When it does work, it's great. Makes it so much easier to read.

Anyone else getting a 50/50 on successful parses?

PostPosted: Tue Apr 29, 2003 1:26 am
Author: Scurvy_Platypus
Actually, I'm lower than 50%. Haven't figured out what the factor is that keeps changing. So I parse it, and if it doesn't work then I do a copy, and rename the log. <shrug> I'm still gratefull for having the tool. Thaks Izyk!!

PostPosted: Tue Apr 29, 2003 1:33 am
Author: izyk
Now we have a thing in software production I like to call a bug report....

Cause when I know about bugs, i can fix em. If you could send me a copy of a clog that fails to izyk@izyk.net, I would appreciate it.

PostPosted: Tue Apr 29, 2003 1:44 am
Author: Scurvy_Platypus
*Scurvy_Platypus taps his chin thoughtfully*
*Scurvy_Platypus appears to be thinking of something*
*Thinking: Now...if I give my logs....then he tests them...reads the output to be sure it went through....*
/ooc Hey! You're just trying to fool us so you can get ooc info, aren't you?!?! :shock: Very clever you blue skinned little bastard!!!

lol, couldn't resist. :) I'll be sending a couple of them to you tonight.

PostPosted: Tue Apr 29, 2003 3:42 am
Author: Liartes
I'll send you all 30 or so :wink:

PostPosted: Wed Apr 30, 2003 8:32 pm
Author: izyk
I have found the problem in the parselog.lua utility. Consider Timon Jorina my ultimatte enemy from this point forward. (It was something specific to that merchant)

The fixed version is now available - you can download the updated script from the link in the first message above. Let me know if I screwed up or missed anything.

PostPosted: Thu May 01, 2003 2:15 am
Author: Scurvy_Platypus
Hope what I sent helps. Other problem seems to be, you always lose the last line of text. Every single time I've run the parser, it drops it. And thanks for fixing what you have. I haven't experienced whatever bug it was you fixed, but thank you for taking the time to make such a useful tool.

PostPosted: Thu May 01, 2003 2:25 am
Author: jadeia
Nice job Izyk.

Thanks for the contribution to the communtiy, it's well appreciated by all.

Lets see if Bioware now "develop" their own "version" and build it in to a future patch. :)

I know they watch Avlis with interest in many aspects.

PostPosted: Sun May 04, 2003 2:35 pm
Author: jadeia
*Bump* Made this sticky as had a few people ask about it.

Good work Izyk.

PostPosted: Thu Jun 05, 2003 4:07 am
Author: jadeia
Please excuse my ignorance, but hell, I cant get a batch file to run under XP. It just loads the command box up, executes the files, and closes in an instant.

Anyone else had this problem with XP and know how to fix?

PostPosted: Thu Jun 05, 2003 4:44 am
Author: JollyOrc
someone else had a similar problem. Try to call the batch file from the shell, so you can see the output: Often one of the paths is wrong and the nwn.exe isn't found.

If you use the batch file as Izyk made it, it has to reside in the main NWN folder. In case you moved it, you must give a path to all files.

Also make sure that the target directory in the link you created points also at the NWN folder.

I know these are the very obvious things, and you probably checked them, but just yesterday I had to walk over to the other office building to turn a monitor on...

PostPosted: Thu Jun 05, 2003 4:50 am
Author: Manuel the White
Added to the downloads webpage. Actually, it's been there for a long time now but i just wanted to acknowledge the scripts usefulness again.

PostPosted: Thu Jun 05, 2003 5:07 am
Author: jadeia
Yeh checked all that Jolly, cant figure it out. Ill try calling it from the shell like you said, just to be doubly certain. I know it will be something bery minor Ive missed, but was hoping it was something 10 people have had, and it -wasnt- my own stupidity. :)

PostPosted: Thu Jun 05, 2003 7:35 am
Author: Scurvy_Platypus
For anyone that wants to be able to do this the easy way, first follow the basic instructions provided on where to put the files, and how to acitvate the logging in NWN.

Next, create a blank Notepad (or any other simple .txt file) and put the path to the parser in it. For example, mine is:

c:\Games\NWN\lua parselog.lua

Save and close. Now, rename this something clever (mine is called "parse") and change the file extension on this to .bat

Move this .bat file (should have a sprocket sort of thing as part of the icon) to your main NWN folder, and leave it there. By "main" is mean, when you take a screenshot, and it writes it to the game folder? That's the same place to leave the .bat file.

Now, create a shortcut to the .bat file, and place on your desktop for easy use.

Hope it helps, and isn't insulting your intelligence.

PostPosted: Thu Jun 05, 2003 6:04 pm
Author: Actually
If the window is closing after the application runs:

Try right-clicking on the shortcut you made to the .BAT file, and checking the properties. Anything that runs in Window's "modified DOS" mode *should* give you a checkbox that says "Close this window upon program completion?" or something like that.

Dumb-ass Windows generally defaults that box checked. So uncheck it and the results should stay on the screen until you physically close the window.

BTW, Izyk hasn't logged in to the boards since at least the beginning of May, and his website (http://www.izyk.net) has been down the last few times I checked. Anybody heard from him?

Bye Now,
Jerry Cornelius - Another Avlis MIA.

PostPosted: Thu Jun 05, 2003 6:19 pm
Author: jadeia
Did everything you said, over and again.

Looked like the whole thing didnt work because i forgot to hit the ENTER key in the notepad AFTER the second line that loads nwn... heh.. knew it would be something minor..

PostPosted: Sat Aug 16, 2003 10:36 pm
Author: izyk
According to my web logs there are a few people with direct links to the parselog scripts. I reorganized my website and moved those files, so you may want to update your links. Use the updated links at the top message on this thread.

My life has become far to complicated to play avlis for a few months. I have a once in a lifetime opportunity right now, but it takes all my time. I am still commited to supporting the parselog script. if there are problems with the script you may still email me at izyk@izyk.net.

I will also continue to host avatar pis sent to avlis-pics@izyk.net should anyone require.

PostPosted: Sun Aug 17, 2003 12:25 am
Author: j5hale3
Izyk,

Good to hear from you. both my characters and I miss you and your great RP.

Good luck with the opportunity. Hope to see you back in game sometime. And thanks again for the log tool it helps alot.

Best regards,

j5hale3
Heldor
Vashano

PostPosted: Mon Mar 01, 2004 3:10 pm
Author: Titanium Dragon
Okay, so how do you create a batch file?

EDIT: I see, but I still don't understand. Do you just create it with the lua blah blah blah line then the nwn.exe line?