Marlo Posted September 2, 2009 Posted September 2, 2009 So the WoW servers went down stupidly early today so i had nothing better to do than make a script that measured how far my mouse had traveled on screen I also went through the trouble of finding out how many pixels there were to an inch on my screen (was 80) but that will probably be different for you. First script ive made in a while so i hope you like it. So here it be: #include <String.au3> Global Const $iPixToInch = 80 ;80 pixels to an inch on my screen Global Const $iInchToKilometer = 39370.0787 ;39370.0787 Inches to a Kilometer Global $iOldPos, $iNewPos, $iInches, $iKilometers, $iDistance Global $sSaveFile = @ScriptDir & "\Mouse Measure.ini" $iDistance = int(IniRead($sSaveFile, "Statistics", "Overall", 0)) Opt("OnExitFunc", "_Save") AdlibEnable("_Save", 1000) $iNewPos = MouseGetPos() $iOldPos = MouseGetPos() While True $iNewPos = MouseGetPos() $iDistance += Abs($iNewPos[0] - $iOldPos[0]) $iDistance += Abs($iNewPos[1] - $iOldPos[1]) $iOldPos = $iNewPos Sleep(2) WEnd Func _Save() $iInches = Round($iDistance/$iPixToInch, 1) $iKilometers = Round($iInches/$iInchToKilometer, 2) TraySetToolTip("Pixels Traveled: " & _StringAddThousandsSep($iDistance) & @CR & _ "Inches Traveled: " & _StringAddThousandsSep($iInches) & @CR & _ "Kilometers Traveled: " & _StringAddThousandsSep($iKilometers)) Iniwrite($sSaveFile, "Statistics", "Overall", $iDistance) EndFunc Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
billthecreator Posted September 2, 2009 Posted September 2, 2009 this is pretty cool. there has to be a way to find PixToInch by the resolution and monitor size... awesome script [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
Marlo Posted September 2, 2009 Author Posted September 2, 2009 this is pretty cool. there has to be a way to find PixToInch by the resolution and monitor size... awesome scriptThere probably is but i didnt look too far into it to be honest. Just drew a 200x200 pix box on my screen and measured it with a ruler Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
whim Posted September 2, 2009 Posted September 2, 2009 <br />this is pretty cool. there has to be a way to find PixToInch by the resolution and monitor size... <br /><br />awesome script<br /><br /><br /><br /> try this $Diag_in_pixel = Sqrt(@DesktopWidth*@DesktopWidth + @DesktopHeight*@DesktopHeight) ; remember Pythagoras ? $Diag_in_inch = InputBox( "Calculate your monitor DPI", "Type monitor size in inches. Please keep in mind" & @CRLF & _ "you need to measure the DIAGONAL size, this is how" & @CRLF & _ "monitor size is usually specified !", "", " M", 300, 150) $DPI = Round( $Diag_in_pixel / Number($Diag_in_inch) ) If $DPI > 0 And $DPI < 500 Then MsgBox(0, "Your monitor", "has " & $DPI & " dpi")
FireFox Posted September 2, 2009 Posted September 2, 2009 @marlo See here : http://www.autoitscript.com/forum/index.php?showtopic=86154 Cheers, FireFox.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now