![]() See How Long You've Chatted To Contacts Each Month - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Forum: Plug-Ins (/forumdisplay.php?fid=28) +------ Thread: See How Long You've Chatted To Contacts Each Month (/showthread.php?tid=36981) See How Long You've Chatted To Contacts Each Month by jasonallen on 01-14-2005 at 05:00 PM
Hey, RE: See How Long You've Chatted To Contacts Each Month by Phrive on 01-14-2005 at 05:14 PM
I quite like that, exept my logs arent saved like that so i can't open i love the idea thought RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 01-14-2005 at 05:22 PM
quote: It wont be to difficult to implement the full txt log. I plan to have this done very soon. They'll just be 2 separate programs. You can choose which one you want. BTW, nice signature ! RE: See How Long You've Chatted To Contacts Each Month by user58943 on 01-14-2005 at 06:01 PM
Nice work, it should be intersting to see how long i've talked to people for. RE: See How Long You've Chatted To Contacts Each Month by John Anderton on 01-14-2005 at 06:01 PM
Looks like a cool plugin. Ill try it. RE: See How Long You've Chatted To Contacts Each Month by Ezra on 01-14-2005 at 06:45 PM
How about compatibilty with Hidden Folders and encrypted chat logs. RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 01-15-2005 at 12:17 AM
quote: Encryted chat logs - no, unfort. A list could be possible RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-05-2005 at 12:48 PM
Was just about to sit down and calculate it manually when I saw this post... RE: See How Long You've Chatted To Contacts Each Month by Edna Mode on 02-05-2005 at 12:50 PM
i probably wont be able to use it but it looks great RE: See How Long You've Chatted To Contacts Each Month by andrey on 02-05-2005 at 02:42 PM
Looks good RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 05:27 PM
quote: Oh, you have a fair point, I'll change that soon. RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 05:45 PM
quote: For what you want you will need to use the first program. On the MsgPlus Chat Log Location you need to continue the path down to the folder of the email address that you want to get the chat log from. Then select the month and type in the year (eg 2005) and then click go. RE: See How Long You've Chatted To Contacts Each Month by user27089 on 02-05-2005 at 05:47 PM
Looking good, nice work RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 05:50 PM The program has now been changed so that drives other than C:\ can be selected. RE: RE: RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-05-2005 at 10:45 PM
quote: Doesn't work either. At first there was a problem with my msg plus (configured in Swedish) renaming the text files by the swedish names. But I renamed a file and that's when I got the runtime error... Sending along a screenshot... Could you paste the header of one of you log files? Think it might be a problem since I am located in Sweden and that we use a different naming system for the dates... RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 10:50 PM Screenshot the top of ur chat log and i'll see what the problem is RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-05-2005 at 11:00 PM
I am quite sure it is the problem RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 11:04 PM
quote: Its messed up becuase of the date is in Swedish. The program is based on the English chat logs date format eg (05 January 2004). RE: See How Long You've Chatted To Contacts Each Month by J.J on 02-05-2005 at 11:12 PM
Looks cool RE: RE: RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-05-2005 at 11:41 PM
quote: What would I had to change in order for it to work out? The dates? 05 January 2005 instead for example? Does your program support 24hour clocks? RE: RE: RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-05-2005 at 11:44 PM
quote: It supports 24 hr clocks and US/UK Dates RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-06-2005 at 12:06 AM
okay RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-06-2005 at 12:09 AM
quote: You need to change them all in the same file to get it to work RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-06-2005 at 12:15 AM
My "test" file only consists of that text... RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-06-2005 at 12:18 AM
quote: No idea soz, it works with the properly generated files. You might need a blank line at the bottom. RE: RE: RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-06-2005 at 12:22 AM
quote: If you try to calculate the time for the following file, does it work for you? RE: See How Long You've Chatted To Contacts Each Month by Fredzz on 02-06-2005 at 12:25 AM
ok for some reason my logs are stored in montly folders. RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-06-2005 at 12:29 AM
quote: The program for foldered months has not be written yet. RE: See How Long You've Chatted To Contacts Each Month by jacoblo33 on 02-06-2005 at 08:56 AM Could anyone try and see if my chat log above works for them...? RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-06-2005 at 01:02 PM On your chat log, remove all the blank lines bar 1. So just have the chat log with 1 blank line at the end. That works for me now. RE: RE: RE: See How Long You've Chatted To Contacts Each Month by Fredzz on 02-07-2005 at 09:24 PM
quote: niiiice ![]() RE: See How Long You've Chatted To Contacts Each Month by haydos on 02-08-2005 at 09:27 AM
just curious to know how long until the .txt file version is available?? RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-08-2005 at 04:20 PM
quote: The all chat logs in 1 txt file program, shdn't be too long, having a few problems. Tends to not work with really big files ![]() RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-09-2005 at 10:47 PM Problem solved with the single text file chat log. Available again. RE: See How Long You've Chatted To Contacts Each Month by Dempsey on 02-09-2005 at 11:35 PM i like the idea, but would be better if it listed the available logs. RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-10-2005 at 01:00 PM I've planning to have this in future versions. RE: See How Long You've Chatted To Contacts Each Month by user27089 on 02-10-2005 at 04:33 PM
RE: RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-10-2005 at 04:37 PM
quote: This works for MSG Plus chat logs in the english language only. Check the final line of the chat log and check that it there is only 1 blank line at the end and no more than that. RE: See How Long You've Chatted To Contacts Each Month by user27089 on 02-10-2005 at 05:18 PM it seems okay with all of the short conversations, it only gets this error when checking lengthy conversations... RE: See How Long You've Chatted To Contacts Each Month by CookieRevised on 02-10-2005 at 07:36 PM
didn't tested it yet, but a few suggestions (from what I read in this thread). Please do not take all this in the wrong way, it is meant as positive criticism. So first of all, let me tell you that it is a nice idea to make a program for quote:In other words, use that registry key to obtain the correct format that is used in the logs. The actual names of months/days/etc can be obtained from the system with an API. When the format is still different then it is declared in that registry key (can happen when the user changed that registrykey previously), you can (in some cases) still obtain the correct date if you scan that date-text for the proper elements (1 or 2 digits for the day, 4 digits for the year and a textstring for the month), enumerate all the words of the months for all the available languages in plus! (can easly be found on the web) and you have your complete auto-detection of the correct date. Add an errorchecking for wrong cases so you can still obtain the correct format* and it is almost fool-proof. Also, provide a way to the user to choose the above "automatic" option, and to enter his own format (when the date couldn't be verified or to process logs from other people maybe or whatever). *When the registrykey defines "dd/MM" but the actually text in a log is "MM/dd", you can see the difference and what is what if one of the numbers is higher then 12 for obvious reasons... Unicode Support Unicode. This is vital in any Plus! related application! Clock I didn't tested it yet, so this might be trivial: * What happens when the log contains times passing midnight? * quote:Make sure it also supports 12hr clocks. Same applies here as with the date: use the registrykey to determine the clock settings and/or the system default notation. Also, a 24h clock can be reconized if hours are >12. Also, it would be nice if the user can define the clock-type before processing the logs (just as with the "date-problem"). * quote:He's missing the daytext, although this shouldn't be an issue... So, it also means that your code is (messy?)/faulty; you shouldn't take in account any text before the actual date, thus including the word for the day... or... you should use the method I described above (of course this can also include the discarding of the daytext as it is of no use). eg: if you can use regular expressions, it would be a good and very quick way in grabbing the part of the line that you need while autoamtically ignoring all the rest. Processing quote:Why? I mean, how do you search for the timevalues?? Any line not starting with "[" should be disregarded... And only when you encounter ".--------------------------------------------------------------------." there is a new session started. Any other line should be ignored. Every line that you encounter which begins with "[" should be dealt with as the end of the conversation*. This also makes that improper saved logs (due to systemcrash or whatever) can still be read properly, even if the "["-line is the last line and even if there are 10 empty lines after it. *Only the first line you encounter which starts with "[" after the second ".-----." line is a start for your timecalculation. Do all this until you actualy reach the EOF-marker of the file, only then you have processed the whole file. If the last line you encounter is a "["-line ended with an EOF-marker, then that means that the file is ended and you shouldn't read any further. Errors quote:An "Type mismatch" occurs when you try to assign an integer to a string variable or something like that. This almost can't have anything to do with the type of files you read in. Text should be text (eg: don't read in integers, bytes, etc. (it works though, if you know what you're doing) but rather read it in as strings, only when you need to process the strings convert them to numbers (only if you're sure that you have read in a number of course, otherwise the conversion will result in number 0). And again, don't assign a numbervariable to a stringvariable or vice-versa or something of that kind) Other stuff quote:Don't read the file as a whole, read it/process it line per line. This is the easiest way/more efficient to program and there will be no limit on filesize. GUI Make the fileselect dialog much wider, it is realy (too) small ![]() Test You can test your program with the attached log. If it can cope with all the bits and pieces, then the reading-in and calculating should be ok ![]() stats for the testlog: session 1: +00:01:09 session 2: +00:00:16 session 3: disregard (not enough time values to process) session 4: +25:53:21 -note1: it is very unlikely that you encounter this in 1 session (a +24h session), but it is possible though. But this example is just to show that you need to cope with times passing midnight. -note2: Also note that if you encounter 2 "[00:00:00]"-lines after eachother, it should be interpreted as 2 lines entered at the same time and not with a period of 24h between them as this is very unlikely because of the first note (although it could happen <= and this also proofs that calculating the total chattime like this isn't always 100% correct (only in rare cases though)). session 5: disregard (corrupted/interrupted session) session 6: +00:01:09 session 7: disregard (corrupted session) session 8: +00:05:32 ! (disregard last line as you don't know the complete and correct timevalue) total chattime should be 26:01:27 (in a total of 5 sessions) RE: See How Long You've Chatted To Contacts Each Month by Dempsey on 02-10-2005 at 07:48 PM
Cookie - you should be a software tester for a living RE: See How Long You've Chatted To Contacts Each Month by jasonallen on 02-10-2005 at 08:00 PM
Thanks Cookie for ur info ! code: This reads the session start date. code: and plugs it into an array. It keeps reading down, and skips the next .----. because thats the bottom of the box. It repeats this until the end of the file, and then closes it. The same file is then reopened to start at the start of the file again. There is no way I know of to go back easily in a text file. This time we skip the first .---. and move the next one. code: This reads the 8 chars of the time after the [. Again, this is a repeated process to get all the session start times. Now, how does the end time get found?.... Back later... RE: See How Long You've Chatted To Contacts Each Month by CookieRevised on 02-10-2005 at 10:59 PM
quote: ![]() quote:But why do you need this? The date is actually of no use when calculating the total time of chat in that log... quote:consult your helpfiles (or the microsoft msdn library). To move the filepointer (in any type of file) use the statement "seek" (also works as a function). quote: quote:Not realy, it gets a substring from t starting at position 2 and (now the important part) reads the next 8 characters if they exist. This means if you have a line like in my testlog (the last line of the file) it will not return a string of 8 characters in length. quote:You're making it way to complicated though ![]() 1) ![]() 2) Date should be ignored, it is of no use for this program... 3) Here you already complicate things ![]() 4) Why not doing what you're doing in step 6 (reading the times) in here? There is no need to process the whole file, close it, reopen it and start again with actually the same process. 5) Thus, like said in step 4, read the times directly from the first time. 6) Again complicating things... This pseudo-code is all you need to read those logs in one go and calculating the total chattime. It will skip over garbage automatically (because the only two acceptable lines are the ones with ".-----." and the ones with "[??:??:??]" (because that is all you need). code: I also attached a very commented VB source code which works with all the chatlogs (24h timeformat of course and in the form of "[??:??:??]", and the logs need to be saved as ASCII (thus unicode logs will not be read)) The source opens and correctly calculates my previous posted testlog file. (note that the code can also be optimized a lot and made much more efficient though) rest is up to you ![]() RE: See How Long You've Chatted To Contacts Each Month by atmlord on 01-30-2006 at 01:10 AM
bump. RE: See How Long You've Chatted To Contacts Each Month by dennis on 01-30-2006 at 04:40 AM i like it bravo... RE: See How Long You've Chatted To Contacts Each Month by Menthix on 01-30-2006 at 10:45 AM
j.g.allen: Your download links are down. quote:I assume you mean the file Cookie posted? That is a Visual Basic source file. You will need a Visual Basic complier and some coding knowledge for that. |