Server Totals
Deglos - (1)
Mikona - (1)
Le'Or - (1)
Ferrell - (0)
Elysia - (0)
M'Chek - (0)
Underdark - (0)
Wilderness - (0)
Visimontium - (0)
Total players: 3
Gallery
  • Winter Ball 2015
    Album name: DM Events
    Uploaded by: Ronan
    Uploaded: Sat Jan 03, 2015 4:41 pm

Links Menu

parselog.lua : A NWN Log to HTML Convertor

General discussion about Avlis

Moderators: Nighthawk4, Dungeon Masters

PostAuthor: Jeriel Fist » Fri Jul 30, 2004 1:29 pm

Aradan Kir wrote:Alternatively, take the text logging part out completely, and run it manually as it's own batch file whenever you log out of the game.


That worked. I guess that's good enough for me I will just run it after NWN and convert my log file. Thanks.
"If trees could scream, would we be so cavalier about cutting them down? We might, if they screamed all the time, for no good reason."
--Jack Handy
User avatar
Jeriel Fist
Prince of Bloated Discourse
 
Posts: 218
Joined: Thu Jul 18, 2002 10:26 pm
Location: CO (GMT -6)

PostAuthor: Morgoth » Fri Jul 30, 2004 3:02 pm

it seems i have to wait for the next time to log in to the game before it writes the log for the previous session... i would like to know if i can change the order in the bat file so that it writes the log up for the session after i log out of it.
When the sun goes down the shadows come out to play.
User avatar
Morgoth
Prince of Bloated Discourse
 
Posts: 270
Joined: Fri Jan 16, 2004 4:46 pm
Location: Toronto Ont. Canada

PostAuthor: Kareth » Fri Jul 30, 2004 3:07 pm

Morgoth wrote:it seems i have to wait for the next time to log in to the game before it writes the log for the previous session... i would like to know if i can change the order in the bat file so that it writes the log up for the session after i log out of it.


Yes, all you have to do is put the parselog call AFTER the NWN call, that is how it is set-up on my machine and it works fine. :)

Only problem is if the system bombs or hangs the log save script is not run and need to be run manually. :(

Kareth
Sage
 
Posts: 2633
Joined: Tue Jul 13, 2004 10:18 am
Location: Windsor, UK

PostAuthor: Morgoth » Fri Jul 30, 2004 3:26 pm

Ok got it working but I still notice that the last line or two of conversation is not logged even when I sat in game for 5 min to give it a chance to do so. I guess that is only a small thing better then not getting any of the chat.. Pause did not seem to work for me (in regards to getting that last bit of conversation).

nwmain.exe +connect avlis.blackdagger.net:5123 +password *******
pause
lua parselog.lua


this one worked the way i would think its intended minus the last two lines of conversation

Thanks for all your help
When the sun goes down the shadows come out to play.
User avatar
Morgoth
Prince of Bloated Discourse
 
Posts: 270
Joined: Fri Jan 16, 2004 4:46 pm
Location: Toronto Ont. Canada

PostAuthor: Drysh » Fri Jul 30, 2004 7:11 pm

The problem with the last lines is not the NWN. They are in the txt file, but the parser forgets them.
After reading this posts, I've made some changes in the parseLog to add some extra functions:
- Add the player name after the character name to identify PCs and NPCs;
- Color the "Whisper" (gray), "Tell" (blue), "Party" (dark green) and "Shout" (red);
- Write the last lines (this is new);

I've posted another version somewhere in the forums, but it didn't include the last lines fix.
This hasn't been tested (except by me), so post any problems you find.
The code for the parseLog.lua is:

Code: Select all
-- parseLog.lua
-- written by : Isaac Guenard
-- April 28th, 2003
-- version 1.01
-- modified to allow the use of : in a dialog
-- some other changes by: Marcelo Resegue


-- relative path to the log file --
logpath = [[logs\nwclientLog1.txt]]

-- output file name
outname = [[logs\]].."nwLog_"..date("%Y%m%d%H%M%S")..[[.html]]

-- initializing the player and character lists
p_list = {}
c_list = {}

---------------- FUNCTIONS -----------------------

-- is val in the table t
function isin(t, val)
   if val == nil then return 0 end
   if type(t) == "table" then
      for i,v in t do
         if v ~= nil then
         if strlower(val) == strlower(v) then
            return 1
         end
         end
      end
   end

   return 0
end

-- if the player is not already in our list, add them
function player_list(player, ch)
  if isin(p_list, player) == 0 then
     tinsert(p_list, player)
    tinsert(c_list, ch)
  end
end

-- trim trailing spaces. I am sure gsub() can do a cleaner job
function  trim(strTrim)
    if strTrim == nil then return "" end
   i = 1   
   while strsub(strTrim, i, i) == " " do
      i = i + 1   
   end
   strTrim = strsub(strTrim, i)

   i = -1
   while strsub(strTrim, i, i) == " " do
      i = i - 1
   end
   strTrim = strsub(strTrim, 1, i)   
   return strTrim
end

-- split the string into a table
-- based on a delimiter arg or default
-- to a comma as delimiter

function split(strInput, delimit)
   ret = {}
   for i = 1, strlen(strInput) do
     x = strsub(strInput, i, i)
     if x == delimit then
      ret[1] = trim( strsub(strInput, 1, i-1) )
      ret[2] = trim( strsub(strInput, i+1, -1) )
      break
     end
   end
   
   if getn(ret) == 0 then
     ret[1] = ""
     ret[2] = strInput
   end
   return ret
end

function parseLine(line)
-- by MR - Clear leading points
  i = 1   
  while strsub(line, i, i) == "." do
   i = i + 1   
  end
  line = strsub(line, i)

  local l = split(line, ":")
  local t = {}
  trash = ""
  local ch = gsub(l[1], "%[(.-)]", function (p) trash = trim(p) end)
  local player = trash
  ch = trim(ch)

  if l[2] == nil then l[2] = " I am bad text "  end
  local txt = gsub(l[2], "%[Talk%]", "")
  txt = trim(txt)
  txt = gsub(txt, "%b<>", "")
  txt = gsub(txt, "%[Whisper%]", "<FONT COLOR=GRAY>")
  txt = gsub(txt, "%[Tell%]", "<FONT COLOR=BLUE>")
  txt = gsub(txt, "%[Party%]", "<FONT COLOR=DARKGREEN>")
  txt = gsub(txt, "%[Shout%]", "<FONT COLOR=RED>")
  txt = txt.."</FONT>"
  return ch, player, txt
end

-- does logfile exist
fh, errorMsg = openfile(logpath, "r")
if fh == nil then
  print("Could not open ".. logpath .. "\n  "..errorMsg)
  exit(-1)
end

-- can I create the outfile
out, errorMsg = openfile(outname, "w+")
if out == nil then
  print("Could not open ".. outname .. "\n  "..errorMsg)
  exit(-2)
end

-- initialize some useful stuff
lastchar = ""
lasttext = ""
tmp = ""
lastplayer = ""

-- the main file read loop
repeat
  line = read(fh, "*l")
 
  if line == nil then break end
 
  ch, player, txt = parseLine(line)

  if player ~= "" then player_list(player, ch) end
 
  -- I collect together sequential lines by the same character
  if ch ~= lastchar then
   if lastplayer ~= "" then lastchar = "<i>"..lastchar.."</b><FONT COLOR=GRAY> ("..lastplayer..")</FONT></i>" end
   tmp = tmp.."\n".."<p><b>"..lastchar.."</b><br>"..lasttext.."</p>"
   lasttext = ""
  end
 
  lasttext = lasttext .. txt .."<br>\n"
  lastplayer = player
  lastchar   = ch
until true

closefile(fh)

-- Don't forget the last lines
if lastplayer ~= "" then lastchar = "<i>"..lastchar.."</b><FONT COLOR=GRAY> ("..lastplayer..")</FONT></i>" end
tmp = tmp.."\n".."<p><b>"..lastchar.."</b><br>"..lasttext.."</p>"


-- do all the HTML stuff

head = [[
<html><head><title>NeverWinter Client Log</title></head>
<body>
<div align=center><h1>Log From NeverWinterNights</h1></div>

]]

cast = [[
<table align=center width=50% border=1>
<tr><td colspan=2><h3>Cast of Characters</h3></td></tr>
<tr><td><b>Player Name</b></td><td><b>Character Name</b></td></tr>
]]


for i, v in p_list do
  cast = cast.."<tr><td valign=top>"..v.."</td><td valign=top>"..c_list[i].."</td></tr>"
end
cast = cast.."</table>"

dlg = [[
<table align=center border=1 width=50%>
<tr><td><h3>Dialogue</h3></td></tr>
<tr><td>
]]

tail = "</td></tr></table></body></html>"

write(out, head..cast..dlg..tmp..tail)
closefile(out)

print("Wrote log to file "..outname)


By the way, Isaac (the program creator), I don't know your board name (and neither if you are a player here), so please send me a message. I would like to send these changes to you first, after all this is your program and I'm editing it without asking you.
Cheers.
User avatar
Drysh
Apprentice Scholar
 
Posts: 607
Joined: Mon Jun 28, 2004 3:34 pm
Location: Brazil
Timezone: GMT -3

PostAuthor: izyk » Thu Nov 11, 2004 3:48 pm

Hey. Nice work, Drysh.

I stopped working on this script a long time ago, I got a little too addicted to the game and left before it could become a real problem. Skipping work to play a game on a regular basis is a clear sign that something is wrong.....

Naturally you can modify the code in any way you like, I will be pleased to check your changes in to the version on my website as well. If someone else would like to take over as official maintainer, I would be pleased to relinquich the role.

I don't monitor these boards very closely anymore, if anyone would like to contact me directly, izyk@izyk.net is a good address to use.
Zachar Mordecai
Right and Proper Society of the Iron Mantis
( aka Izyk G )
User avatar
izyk
Scholar of Fools
 
Posts: 413
Joined: Thu Jan 23, 2003 4:21 am
Location: Toronto.

PostAuthor: izyk » Thu Nov 11, 2004 4:21 pm

Ok. The script on my website now contains these changes. If there is a bug or problem for any reason, let me know by emailing izyk@izyk.net.

I am not running NWN at the moment, so this code was not tested in any meaningful fashion. If anyone needs to revert to the previous version, you will find it at :

http://www.izyk.net/avlis/parseLog/parseLog_v1.01.lua
Zachar Mordecai
Right and Proper Society of the Iron Mantis
( aka Izyk G )
User avatar
izyk
Scholar of Fools
 
Posts: 413
Joined: Thu Jan 23, 2003 4:21 am
Location: Toronto.

PostAuthor: methuselah » Sun Jan 30, 2005 8:36 am

Question about the Log Parser.

Is there any way to have this parse your game log after your NWN session?

I have several logs I would like to clean up, and cant seem to find anything that will do this for me. Id rather not have to sift through 150+pages of text and edit things manually :(
Dralix wrote:If there's one thing I've learned about you from these forums, it's that there are two sides to every issue ... and you are on both of them. ;)
Darkfire wrote:You have more balls then I do, because I'm still at my job taking it up the brown. Props to you methuselah.

methuselah
Apprentice Scholar
 
Posts: 785
Joined: Thu Jun 17, 2004 5:37 pm
Location: Balto, MD (gmt -5)
Timezone: EST

PostAuthor: izyk » Wed Feb 02, 2005 3:28 pm

Absolutely.

The parser just has a hardwired path to nwclientLog1.txt stored in the variable logpath. If you change this path to the name of your text file, you should get what you need. i think you would edit line 10.

Code: Select all
-- relative path to the log file --
logpath = [[logs\nwclientLog1.txt]]

-- output file name
outname = [[logs\]].."nwLog_"..date("%Y%m%d%H%M%S")..[[.html]]



Alternatively, you could change these to accept command line arguments

Code: Select all
-- relative path to the log file --
if arg[1] then
    logpath = arg[1]
else
    logpath = [[logs\nwclientLog1.txt]]
end

-- output file name
if arg[2] then
    outname = arg[2]
else
    outname = [[logs\]].."nwLog_"..date("%Y%m%d%H%M%S")..[[.html]]
end



In the above example, you could run this as normal, or you could provide an input filename and an output filename

Code: Select all
   lua parselog.lua logs\oldquestlog.txt  logs\newhtmlfile.html


This would parse the file oldquestlog.txt and output a file called newhtmlfile.html.

Is this something you folks want me to add to the current application and to update on the website? I am no longer playing NWN, so if someone could email me a log file, I will make the changes, test it, and update. (izyk @ izyk . net)
Zachar Mordecai
Right and Proper Society of the Iron Mantis
( aka Izyk G )
User avatar
izyk
Scholar of Fools
 
Posts: 413
Joined: Thu Jan 23, 2003 4:21 am
Location: Toronto.

PostAuthor: storminj » Thu Sep 08, 2005 3:43 pm

Anyone know about chat logging Macs automatically? Considering osx is suppose to be good for makin little programs I thought I would find something but not yet.
Captain Friday Alibar of The Good Ship Clandestine
Privateer Extraordinaire of Privateer Enterprises
Sales Representative of FeatherFinger Trading
South Avlis Trade Federation (SATF) Member

"Hey, I don't make the crazy rules, I just twist them to my purpose." Celia OOTS 278
User avatar
storminj
Sage
 
Posts: 2401
Joined: Mon Nov 04, 2002 5:32 pm
Location: Houston Texas (GMT -5)

PostAuthor: storminj » Sat Feb 04, 2006 7:24 pm

Is still the way to do it or is there a better way?
User avatar
storminj
Sage
 
Posts: 2401
Joined: Mon Nov 04, 2002 5:32 pm
Location: Houston Texas (GMT -5)

PostAuthor: Simon Drat » Sat Feb 04, 2006 7:33 pm

I use the ASK: http://www.avlis.org/viewtopic.php?t=46916

It has its own chat logger. It's a bit buggy sometimes but if you reset it every time you know you're going to need it on it will work for you. Does eat up a chunk of RAM tho, so use at your own lag risk... :)
User avatar
Simon Drat
Apprentice Scholar
 
Posts: 544
Joined: Mon Jan 03, 2005 11:42 am
Location: Cincinnati, OH
Timezone: EST (GMT -5)

PostAuthor: drunkenpig » Sun Feb 05, 2006 12:13 am

http://www.avlis.org/viewtopic.php?p=593686#593686

Check and see if he still needs beta testers

If you get his program runnig w/ ASK it rocks. I use the two together, and it does the best job I've seen.
User avatar
drunkenpig
Apprentice Scholar
 
Posts: 697
Joined: Wed Oct 27, 2004 2:51 am
Location: Clayton, NC (GMT -5 Oct-March, GMT -4 April-Sept)

PostAuthor: TwoTi » Fri Jul 21, 2006 9:59 am

I have just installed the parselog , and I think it is not updated still many monthes.
Since last update, the log file format has changed, and ParseLog do not parse correctly now.

Before doing any change in the parselog.lua file, has somebody an updated release of this file ? I can't believe that nobody uses it now ? ;)

It seems so simple, customisable that I'm sure somebody uses it now 8)

Thank's for your answers.
User avatar
TwoTi
Newbie
 
Posts: 2
Joined: Fri Jul 21, 2006 9:52 am

PostAuthor: longbow » Fri Jul 21, 2006 11:01 am

i still use the parselua and lua.exe on windows xp.

lua.exe is 152kb and is dated 13/03/2003.
parselog.lua is 5kb and dated 11/11/2004.

run them through a batch file that launches nwn into avlis directly. for axample my wilderness.bat is

d:\games\neverwinternights\nwn\nwmain.exe +connect "avlis.blackdagger.net:xxxx" +password "serverpassword"
lua parselog.lua


where xxxx is the port number for the server and serverpassword is the password.

hope this helps.
User avatar
longbow
Scholar of Fools
 
Posts: 318
Joined: Sun Mar 07, 2004 9:15 pm
Location: scotland (gmt +1)

PostAuthor: Gaelyn Faerstryd » Fri Jul 21, 2006 11:07 am

I still use it too, same as longbow has described.
"Anything worth doing... is worth doing fanatically." -- G. Irwin - **
User avatar
Gaelyn Faerstryd
Team Member; Retired with Honors
 
Posts: 1814
Images: 1
Joined: Sat Feb 22, 2003 2:24 am
Location: Quebec, Canada (GMT -5)
Timezone: Eastern

PostAuthor: TwoTi » Fri Jul 21, 2006 12:33 pm

Arf !
Perhaps it's due to my french version of NWN (yes, I'm french ^^).

In french, the logs have not the same structure, and it parses not correctly ?

Next week (I spend my week-end in the Alps), I will post an example of my clientlog and an example of my outpout parsing file ...
User avatar
TwoTi
Newbie
 
Posts: 2
Joined: Fri Jul 21, 2006 9:52 am

PostAuthor: Grunt » Fri Jul 21, 2006 12:50 pm

Well, if the raw logs are different then parselog may not work. The script isn't too difficult to poke around in. For example, I didn't like the output going
Character Name
blah blabababalah...

Character two
Blablah?

etc. so I changed the output so that it goes
Character Name: blahblahblahbla

and makes it easier for quoting. If your output for something like "[talk]" is different then it may be just a matter of adjusting the script slightly.
FletcherWiki

*Stepping out of a portal*
Nawen Amakiir: there he is.. *smirks* someone had to make an entrance
Fletcher Millstone: MILLSTONE! *arms held high*
Lilliana Be'letane: You're the worst, Fletcher.
User avatar
Grunt
CCC
CCC
 
Posts: 9417
Images: 3
Joined: Sat Jun 05, 2004 12:37 am
Location: Boston, MA
Timezone: I AM A TIME LORD

PostAuthor: DanishPastry » Fri Jul 21, 2006 3:59 pm

Grunt wrote:Character Name
blah blabababalah...

Character two
Blablah?

etc. so I changed the output so that it goes
Character Name: blahblahblahbla

and makes it easier for quoting

Want to share the specific change to the code you made to get that effect? :)
WrathOG777: This is a roleplaying game. There is no such thing as winning or losing. Only playing.
User avatar
DanishPastry
Team Member; Retired with Honors
 
Posts: 3439
Images: 0
Joined: Wed Jun 09, 2004 11:26 am
Location: Cph, Denmark
Timezone: GMT+1

PostAuthor: Grunt » Fri Jul 21, 2006 4:11 pm

DanishPastry wrote:
Grunt wrote:Character Name
blah blabababalah...

Character two
Blablah?

etc. so I changed the output so that it goes
Character Name: blahblahblahbla

and makes it easier for quoting

Want to share the specific change to the code you made to get that effect? :)

Code: Select all
Changed:
tmp = tmp.."\n".."<p><b>"..lastchar.."</b><br>"..lasttext.."</p>"

to
tmp = tmp.."\n".."<p><b>"..lastchar.."</b>: "..lasttext.."</p>"

Also, this will still have their next line of text on it's own line if they spoke twice in a row. I don't have the modified script here, but that should handle the output. Also look for where it says
Code: Select all
<table align=center border=1 width=50%>

and change the 50% to something more like 70% or 80% to get more text in there.

I was thinking of seeing how to make it so the font for tells would be green, text would be white, whisper would be something more visible than charcoal, maybe a medium grey... all on a black background, but wasn't motivated to do so.
FletcherWiki

*Stepping out of a portal*
Nawen Amakiir: there he is.. *smirks* someone had to make an entrance
Fletcher Millstone: MILLSTONE! *arms held high*
Lilliana Be'letane: You're the worst, Fletcher.
User avatar
Grunt
CCC
CCC
 
Posts: 9417
Images: 3
Joined: Sat Jun 05, 2004 12:37 am
Location: Boston, MA
Timezone: I AM A TIME LORD

PostAuthor: tizmo » Fri Jul 21, 2006 8:35 pm

If any Linux users were wanting to use this parsing utility, I got it working under linux. You need to compile lua-4.0 on linux, then you need to make 2 small changes to the parseLog.lua file.

Get lua source code here:
http://www.lua.org/ftp/lua-4.0.tar.gz

Type these commands:
tar -xvzf lua-4.0.tar.gz
cd lua
make all
cd bin

Now the executable is named "lua" in the bin directory. Copy that to your main NWN directory. (the one with nwmain)

Now download the parselog.zip listed in the first post of this thread:
http://www.izyk.net/avlis/parseLog/parselog.zip

unzip it:
unzip parselog.zip

Edit the parseLog.lua with a text editor (not a word processor) and change these two paths from a forward slash to a backslash:

old:
logpath = [[logs/nwclientLog1.txt]]
new:
logpath = [[logs\nwclientLog1.txt]]

----------------x---------- right above here

old:
outname = [[logs/]].."nwLog_"..date("%Y%m%d%H%M%S")..[[.html]]
new:
outname = [[logs\]].."nwLog_"..date("%Y%m%d%H%M%S")..[[.html]]

-----------------x---------- right above here

Copy the parseLog.lua to your main NWN directory (the one with nwmain).

Now make sure you've edited your nwnplayer.ini and added the logging flag, as indicated in the first post of this thread.

To use it, you just cd to your main NWN directory and run it:
./lua parseLog.lua

Now you'll have your html file in your logs directory.

Hope that helps:)

Tizmo

PS.. I almost forgot the mandatory notice.."The above instructions worked fine for me on my system. If you follow them and your system dies or a meteor crashes into your bedroom, don't blame me." :evil:

tizmo
CCC
CCC
 
Posts: 1359
Joined: Thu May 19, 2005 2:53 pm
Location: Washington, DC
Timezone: GMT-4

PostAuthor: Jedisniper » Thu Jan 04, 2007 10:09 am

*Tiny Nudge*

Been using this program for a while now and love it.

I have seen other log parsers out there that also log the combat window by setting "ClientEntireChatWindowLogging=1".

By doing this it logs combat stats and all other info in the right hand window like XP, Gold, items aquired etc.

Is there anyone out that knows how to, or would be willing to try to incorporate this into Parselog.lua?

If you use Parselog.lua in it's current form with: ClientEntireChatWindowLogging=1 enabled in the player.ini file it messes up the log configuration and generally makes a mess in the output of the parsed log.

I tried to go through the Lua code last night at work to see how to modify it, but i seriously have no idea where to start.

Anyone out there with suggestions or that might be willing to try?


-Snipes
Playing as:

Holandar Blackmane :- Psychic Warrior and Equalizer of Mikon
Sovanog :- Dreadpriest of The'ton
Riddassh :- Weaponmaster of Aarilax

Re-Enlisted CoEMF :CoEMF:
User avatar
Jedisniper
Team Member; Retired with Honors
 
Posts: 815
Images: 1
Joined: Fri Apr 15, 2005 12:05 am
Location: Sydney, Australia GMT +11
Timezone: GMT +10 / +11
DM Avatar: Aarilax

PostAuthor: tizmo » Mon Jan 08, 2007 12:01 am

Jedisniper wrote:*Tiny Nudge*

Been using this program for a while now and love it.

I have seen other log parsers out there that also log the combat window by setting "ClientEntireChatWindowLogging=1".

By doing this it logs combat stats and all other info in the right hand window like XP, Gold, items aquired etc.

Is there anyone out that knows how to, or would be willing to try to incorporate this into Parselog.lua?

If you use Parselog.lua in it's current form with: ClientEntireChatWindowLogging=1 enabled in the player.ini file it messes up the log configuration and generally makes a mess in the output of the parsed log.

I tried to go through the Lua code last night at work to see how to modify it, but i seriously have no idea where to start.

Anyone out there with suggestions or that might be willing to try?


-Snipes


I haven't looked at the output log when ClientEntireChatWindowLogging=1 is enabled in the player.ini file, but I'll tell you from a Code parsing point of view.. the only way to separate the output from the two log windows is if that single log contains a tag on each line telling which window created the log entry.. OR if each line has some common phrase or string you could use as a search string to tell which window it came from.

I'll go take a look and see what I does on my system...

Tizmo

tizmo
CCC
CCC
 
Posts: 1359
Joined: Thu May 19, 2005 2:53 pm
Location: Washington, DC
Timezone: GMT-4

PostAuthor: tizmo » Mon Jan 08, 2007 12:44 am

Ok, yes it is possible to parse both windows separately...

Here is what you need to do..
In your nwnplayer.ini, set:
ClientChatLogging=1

AND

ClientEntireChatWindowLogging=1

The output in the single log file will look like this:

chatlog wrote:[CHAT WINDOW TEXT] [Sun Jan 7 16:04:11] Welcome to Avlis.
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:13] tizmo has joined as a player..
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:13] [Server] You are now in a Full PVP Area.
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:19] Ewnin Amnannu: // this is a test
[tizmo] Ewnin Amnannu: [Talk] // this is a test
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:21] Ewnin Amnannu: // more testing
[tizmo] Ewnin Amnannu: [Talk] // more testing
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:24] Ewnin Amnannu: // more testing
[tizmo] Ewnin Amnannu: [Talk] // more testing
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:27] Ewnin Amnannu: // more testing
[tizmo] Ewnin Amnannu: [Talk] // more testing
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:37] [Server] You are now in a Full PVP Area.
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:40] Writing on the floor spells out, 'Follow the flame that is constant.'
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:47] [Server] You are now in a Full PVP Area.
[CHAT WINDOW TEXT] [Sun Jan 7 16:04:54] Ewnin Amnannu: // more testing
[tizmo] Ewnin Amnannu: [Talk] // more testing


Then you can parse out all lines that start with "[CHAT WINDOW TEXT]" into one separate file, then the Talk channel text into another log file. The text from the talk channel will end up in both files since the CHAT WINDOW TEXT entries log both the talk and the right (combat) window text.

On a linux system just do this:

In your logs folder:
# Make a backup of your log
cp nwclientLog1.txt myfulllog.txt
# Make a file with all CHAT WINDOW TEXT lines
grep "CHAT WINDOW TEXT" nwclientLog1.txt > AllText.txt
# Make a file with all regular Talk window lines
grep -v "CHAT WINDOW TEXT" nwclientLog1.txt > TalkTextOnly.txt

In your main nwn folder:
cp parseLog.lua parseLogAll.lua
cp parseLog.lua parseLogTalk.lua

Now, just edit the parseLogChat.lua to modify the file name of the

logpath = [[logs/AllText.txt]]

to point to AllText.txt.
and change the:

outname = [[logs/]].."AllTextnwLog_"..date("%Y%m%d%H%M%S")..[[.html]]

Now, just edit the parseLogTalk.lua to modify the file name of the

logpath = [[logs/TalkTextOnly.txt]]

to point to TalkTextOnly.txt.

outname = [[logs/]].."TalkTextOnlynwLog_"..date("%Y%m%d%H%M%S")..[[.html]]


Now run:
./lua parseLogChat.lua
./lua parseLogTalk.lua

After you've done this once.. all future times you'll just need to run the copy command and the two greps.. then run lua with the two files you already modified.

If you want to make a script.. here. put this code into a shell script and put it in your nwn directory and make it executable. You must create and modify the two parseLog files as described above before you run this script.

start of shell script - parsemylogs.sh wrote:#!/bin/sh

# You MUST modify this first path to be your NWN directory

NWNDIR=/path/to/nwn
LOGDIR=$NWNDIR/logs

# Backup your log
cp $LOGDIR/nwclientLog1.txt $LOGDIR/myfulllog.txt.bak
# Make a file with all CHAT WINDOW TEXT lines
grep "CHAT WINDOW TEXT" $LOGDIR/nwclientLog1.txt > $LOGDIR/AllText.txt
# Make a file with all regular Talk window lines
grep -v "CHAT WINDOW TEXT" $LOGDIR/nwclientLog1.txt > $LOGDIR/TalkTextOnly.txt

# I am going to assume you have lua and the luaparse.lua files in your NWN directory.
$NWNDIR/lua $NWNDIR/parseLogChat.lua
$NWNDIR/lua $NWNDIR/parseLogTalk.lua

echo "Parsed Chat and Talk log files and placed HTML formatted files in your nwn/logs directory"



That's the best I can offer in 20 mins...

Tizmo

tizmo
CCC
CCC
 
Posts: 1359
Joined: Thu May 19, 2005 2:53 pm
Location: Washington, DC
Timezone: GMT-4

PostAuthor: drunkenpig » Mon Jan 08, 2007 1:28 am

Jedisniper wrote:Anyone out there with suggestions


search for the parse program made by NCGrimbo which does this already and does some neat analysis of the stats :)
User avatar
drunkenpig
Apprentice Scholar
 
Posts: 697
Joined: Wed Oct 27, 2004 2:51 am
Location: Clayton, NC (GMT -5 Oct-March, GMT -4 April-Sept)

PreviousNext

Return to The Avlis Project: General Discussion

Who is online

Registered users: Google [Bot]