Info: Calculating time spent in Feffox Nests based on chat.log

SnowLeopard

Stalker
Joined
Jul 19, 2006
Posts
2,406
Location
Montreal, Canada
Society
Guess Who
Avatar Name
Gray SnowLeopard Felix
This is probably the most accurate way to calculate the amount of time spent in the Feffox Nests.
If your chat.log is not enabled, you are s-o-l. If you did not leave the nests properly (ie did not relog after a crash), this probably skew the total in some way. Also, if you've done anything in a non-Feffox instance (beacons, feffoid cave, etc), you'll need to take time spent there into consideration.

The important lines from the chat.log have [Force] after the date and time on each line:
Code:
2013-04-27 03:57:27 [Force] [] You have now joined the Force chat channel.
2013-04-27 04:23:51 [Force] [] You have now joined the Force chat channel.
2013-04-27 04:37:18 [Force] [] You have now joined the Force chat channel.
2013-04-27 04:41:20 [Force] [] You have now joined the Force chat channel.
2013-04-27 04:44:16 [Force] [] You are no longer connected to the Force chat channel.
2013-04-27 16:54:17 [Force] [] You have now joined the Force chat channel.
2013-04-27 17:08:24 [Force] [] You have now joined the Force chat channel.
2013-04-27 18:06:49 [Force] [] You are no longer connected to the Force chat channel.

Multiple consecutive You have now joined lines are due to relogging following a crash and the extras must be ignored.
I used GNU awk from a command prompt to generate a CSV file with only the join and exit timestamps:
Code:
gawk "$3 ~ /Force/ { if ($8 ~ /joined/ && J == 0) { J=1; printf\"%s %s,\",$1,$2 } if ($9 ~ /connected/ && J == 1) { J=0; printf\"%s %s\n\",$1,$2} }" chat.log > chatlog.csv
Then I load the chatlog.csv in a spreadsheet. Column C for all rows is set to be Bx-Ax, and then a SUM() of the C column is done after the last row. (yeah, it would be cleaner to get gawk to do the math also, but this was quicker to get first result)
 
This is what i do with events also (well not exactly, i got a PHP server and i just made a simple script), sadly, going to a mothership or privateer, or going for a PVP event joins you into a force channel too... so need to filter those out.
Also, i'm still not quite sure how MA's timekeeping works, if you exit the cave, wait for ~10 minutes and go back in, you'll still have the same stats as when you left (does that time outside count, if it still remembers your stats?)
 
New and Improved (already!)
First, install GNU Awk.
Cut-and-paste the following into a text file (I used parse-log.awk):
Code:
$3 ~ /Force/ { if ($8 ~ /joined/ && J == 0) {
                        J=1;
                        A=mktime(sprintf( "%s %s",gensub(/-/," ","g",$1),gensub(/:/," ","g",$2)));
                        printf"%s,",A }
                if ($9 ~ /connected/ && J == 1) {
                        J=0;
                        B=mktime(sprintf( "%s %s",gensub(/-/," ","g",$1),gensub(/:/," ","g",$2)));
                        C=B-A;
                        printf "%s,%s\n",B,C;
                        T+=C; }
                }
END { printf "%s seconds total \n",T;
                H=T/60/60;
                printf "%s hours total\n",H; }

I recommend making a copy of the chat.log such as chat-feffox-log and editing the copy to remove everything before 2013-04-15 16:00:00, the official Feffox Mayhem start time. This script will not check the start time for you.
Also, as Cail pointed out, if you have done anything in Entropia that also uses Force Chat, this script will not be able to give you an accurate number. You will need to manually remove the sections of log that cover those other events.
From a command prompt you can then run
Code:
gawk -f parse-log.awk chat-feffox.log
It will output a bunch of lines with numbers which are the join time, leave time, and difference. The last two lines will be the total number of seconds and the number in hours on the last line spent in the Feffox nests.
 
Just a pointer, you could add a check into that to look for times between 2013-4-15:16:00 and 2013-4-28:23:59
So you don't need to filter out if you were on the force channel sometime before the event.
Or even make a variable of when you started/finished to only check between those times :)
 
Back
Top