Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[WIP] M&K Counter 2.0 - mouse and keyboard statistics


  • Please log in to reply
32 replies to this topic
Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010

Casual hello. It's me, Rseding91. *acts naturally*

This is my latest project

Name: M&K Counter 2.0
Current Version: 1.79
Download: https://www.dropbox....er 2.0.ahk?dl=0

Compatibility: AHK Basic, AHK_L ANSI, AHK_L Unicode x86/x64

ANY questions/comments/ideas PLEASE post. I love feedback (good or bad)


What is it?

Basically, It's a statistics script.

It will be capable of showing you almost anything you can think of regarding your keyboard and mouse once I finish it.

In its current state it records data for future use and is capable of showing you:
how many times you've pressed any of the mouse buttons
how many times you've scrolled the mouse wheel up or down
the number of pixels you've moved your mouse
the number of inches you've moved your mouse
the total number of keys you've typed on the keyboard
the number of words you've typed on your keyboard
the number of times you've pressed any of the keyboard or mouse buttons for a given date range
the number of times you've scrolled the mouse wheel for a given date range
the number of pixels/inches you've moved the mouse on a given monitor for a given date range
the number of words typed for a given date range
the length of the words typed for a given date range

When I am done with it, it will be able to give/show you the following information:

Total keyboard presses per minute/hour/day/week/month/year
Total Mouse clicks per minute/hour/day/week/month/year
Total pixels moved per minute/hour/day/week/month/year
Total individual (such as the "A" or "M" keys) key presses per minute/hour/day/week/month/year
The average number of times you press keys per minute/hour/day/week/month/year
The average number of times you press any key on your keyboard per minute/hour/day/week/month/year
The average number of times you click any button on your mouse per minute/hour/day/week/month/year
The average number of pixels moved per minute/hour/day/week/month/year
The number of times you pressed a key or clicked the mouse or moved the mouse during a specific time range
The times of day you most often press any key or mouse button
The minutes/hours/days/weeks/months/years you use your keyboard/mouse the most

And now for the fun stuff

The number of words you type per second/minute/hour/day/week/month/year
The number of letters in each word you type
The average length of each word you type (within a time frame or from when you first started the script)
The number of inches/feet/yards/miles you've moved your mouse at any given time frame
The total number of inches/feet/yards/miles you've moved your mouse
What monitor (if you have more then one) mouse movement was recorded on as well as which monitor you move your mouse on the most


Right now the script is not done. But, it will record all of the needed information to do everything I just described above eventually. All I need to do is code the functions to calculate and output that information and then anyone who has been running the script can see any of it


Wouldn't that make the script a keylogger?

Kind of, not really. The script, by default, rounds all of the time stamps it saves for the keyboard and mouse data down to the nearest minute. Trying to reassemble a minutes worth of typing into the original words would be VERY hard for anyone to do. Such a person looking to do this would have to get access to your computer to copy the data files off. If someone can get access to your computer then you have more to worry about then the chance someone copies the files this script makes.


How do I see the information the script can show me now?

If you hover over the script icon on the bottom right of your screen it will show you everything I have programmed it to be able to show at the moment.
 

 

Can I change where the script saves the information?

You can. Simply create a file called "Override.ini" next to the script with the section "[Settings]" and the key "Root_Directory=*folder you want to use*".



Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.783

Fixed: Switching from direct-to-disk to buffer-key-counts would erase almost all of the stored data (oops...)

berban_
  • Members
  • 202 posts
  • Last active: Aug 05 2014 11:52 PM
  • Joined: 16 Mar 2011
Hey man, I've been using this lately but I have a feature request. So currently it stores the data in several files in the My Documents directory. I would like to be able to change that to some other directory. This is especially important for me because the My Documents directory on my PC is backed up to two places.

First, it backs up to a USB which means every time I sync it has to copy over some key files (usually all of them), which is probably several times as many files as usually are copied otherwise.

More importantly, however, I also use Windows Live Mesh to back up my data to the cloud (it's analagous to dropbox). Since the key files are constantly changing, mesh is constantly scanning this folder and updating them to the online database. Which takes quite a bit of CPU and network, at least relative to how much it usually takes.

There are two solutions to this second problem that I can think of, the first being to somehow buffer more data so that it could be written less frequently and optimally to fewer files. The other would be to simply allow the storage directory to be changed, which sounds many times simpler to me :p

I know this is likely a very simple fix that I could do myself, but I would prefer if you did it because that way it could be incorporated in accordance with your vision of the finished script. Plus I am positive you will get this request from others. Thanks :)

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.7844

Fixed a few bugs that I can't remember about.. nothing huge
Changed the information shown with the hover-over tray tip
Added "words typed" - the number of words typed - to the hover-over tray tip
Vastily optimized the code used to show only the current days information in the hover-over tray tip
(hopefully) fixed a problem where the script would stop counting pixels moved
Changed some code around with the save system so you can choose where it stores all of the files (via the Override.ini mentioned near the end of the main post)
Changed some other code to be more compatible with the indexing functions I am building

Finished up the key count indexing function. Now, I just need to finish up the pixels moved indexer and the words per time indexer.

berban_
  • Members
  • 202 posts
  • Last active: Aug 05 2014 11:52 PM
  • Joined: 16 Mar 2011
Hey, so I figured out why there were 2 instances running - it's because you are monitoring the "on standby" event and reloading. Why is this necessary? My instinct would be do away with it altogether unless there is some serious bug with computer sleep - in which case the bug should probably be addressed first :p

If you keep the reloading, I would at least make the script #SingleInstance - it was giving me a "This script is already running" dialog before.

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Yeah, I added the reload thing because I saw someone said hotkeys failed when you resumed from sleep mode. I just tested it and it seems to work fine - so I removed the reload part.

Updated to 1.7845

Removed the "reload on resume from sleep" code

xxOrpheus
  • Members
  • 134 posts
  • Last active: Jul 21 2014 12:15 AM
  • Joined: 27 Sep 2011
This sounds cool! Trying it now :D

EDIT:
Works nicely, good job :)

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010

This sounds cool! Trying it now :D

EDIT:
Works nicely, good job :)



Thanks,

Can you think of anything else that you might find fun/interesting that I could add?

I'm getting close to done with everything I have and all that will be left is to make reporting functions (graphs and such).

xxOrpheus
  • Members
  • 134 posts
  • Last active: Jul 21 2014 12:15 AM
  • Joined: 27 Sep 2011

This sounds cool! Trying it now :D

EDIT:
Works nicely, good job :)



Thanks,

Can you think of anything else that you might find fun/interesting that I could add?

I'm getting close to done with everything I have and all that will be left is to make reporting functions (graphs and such).

Nope, you covered mostly everything :O If I think of anything I'll tell you :D

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.7852

Fixed version numbering (i messed it up..)
Changed the enable/disable options for keyboard, mouse and words per ? to save any buffered data they might have when you disable them (the pixels moved one already did this).

Next update: i'm adding in a check-for update option to the script so the script can check for updates and optionally download and switch to the update if you tell it to.


An update on what i'm doing recently: I finished up 2 of the 3 indexing/parsing functions for the data files and once I get the third done I am going to start working on graphing and reporting of data.

If anyone wants to help - take a look at this: <!-- m -->http://www.autohotke...pic.php?t=78716<!-- m -->

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.7853

Changed the crash-checking part of the script that monitors the pixels-moved function and ensures that it keeps running correctly.
Added a "Check for update" option to the script

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.7854

Added the menu option "Remove this program and all of its files from this computer" which does as you would think - it deletes everything the program has made and then deletes its self.

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
Updated to 1.786

Fixed the pixels-moved function storing incorrect time stamps for when it recorded the data (it was off by a hour every 60 minutes)
(I think) fixed the problem where the pixels-moved function would stop monitoring mouse movement
Changed the file storage location to use the computer name for a future option I want to build in (multi computer support) - it doesn't change how anything works at the moment and the script will move the files for you on first run if you had them setup already.


Also, I finaly finished the final "indexing" function so now I can add them into the script and work on graphing/reporting data :)

If anyone has ideas of how they think data should be reported/shown feel free to let me know. I am going to try to add in everything anyone can think of and anything I can think of.

jpjazzy
  • Members
  • 800 posts
  • Last active: Dec 17 2014 07:22 AM
  • Joined: 16 Feb 2010
Interesting script. It works nicely, but I really can't think of a practical use for it unless someone is designing a key logger right off the top of my head. What was your inspiration for this?

One thing I hate about a lot of scripts is the fact they write a lot of a files and you have to hunt them down. This was very easily removed and I don't know why I never added a 'remove file and written content' option to any of my scripts. Another thing I liked was your program automatically closed/deleted itself. I intend on studying that delete function more in depth so I can use it later. For security purposes it would be nice to develop a system, so that if script writers wanted to be able to use keys or possibly some type of protection method. Using your Uninstall_Script() method mixed with some encryption and a key based on a hard drive address I think this could be done. Anyways... That is a bit off topic, but is something I tried once and failed miserably at. If someone made a compact function to do it, which was easy enough to just implement in a script, I would definitely use it in a few of my game-designed scripts.

All in all, the script works great, I just haven't found a practical use for it yet.
AutoHotkey Basic - Windows 7
Posted Image

Rseding91
  • Members
  • 703 posts
  • Last active: Apr 02 2016 05:05 AM
  • Joined: 07 Jun 2010
My inspiration was knowing information about my keyboard and mouse use but not wanting to use a 3rd party one for lack of trust and options. I started with a simple one that counted mouse clicks and then moved on to to a hack-job key and mouse counter. After a while I started working on this :)


I specifically built this to have the option of being inaccurate (within a minute) for the time stamps it records. That means by default it can't be used as a keylogger.

This also allows you to greatly customize the script and it doesn't require a installer/special drivers like most do :)



Ofcourse it's not finished yet, but i'm close. I just need to find time to start working on the graphing/reporting part of the script.


The final reason I started this was to learn how to it :D I learned all kinds of stuff for how to deal with binary files and numget/numput/dllcall.