DexterMorgan Posted August 4, 2008 Share Posted August 4, 2008 (edited) This is probably the most basic thing you have ever seen on this forums.. But for the people that dont know, This is a little tooltip with the X and Y coordinates of the mouse and the pixel color If you press CTRL and P then it copies the pixel to the clipboard CTRL and M for coords Esc to exit #NoTrayIcon #include <Misc.au3> While 1 $pos = MouseGetPos() $var = PixelGetColor( $pos[0] , $pos[1] ) ToolTip($pos[0] & "," & $pos[1] & @CRLF & Hex($var, 6) ) If _IsPressed(11) and _IsPressed(50) Then ClipPut( Hex($var, 6)) EndIf If _IsPressed(11) and _IsPressed('4D') Then ClipPut( $pos[0] & "," & $pos[1]) EndIf If _IsPressed('1B') Then Exit EndIf WEnd Edited August 4, 2008 by Konstig code Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 4, 2008 Share Posted August 4, 2008 You are forgetting two things. First, it will literary burn up your CPU since it uses 100%, you need a Sleep() in there. Second, you should have read the page about _IsPressed more "in-depth". If calling this function repeatidly, should open 'user32.dll' and pass in handle. When these two things are added it is almost at 0% CPU usage. #NoTrayIcon #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 $pos = MouseGetPos() $var = PixelGetColor( $pos[0] , $pos[1] ) ToolTip($pos[0] & "," & $pos[1] & @CRLF & Hex($var, 6) ) If _IsPressed(11, $dll) and _IsPressed(50, $dll) Then ClipPut( Hex($var, 6)) EndIf If _IsPressed(11, $dll) and _IsPressed('4D', $dll) Then ClipPut( $pos[0] & "," & $pos[1]) EndIf If _IsPressed('1B', $dll) Then ExitLoop EndIf Sleep(10) WEnd DllClose($dll) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
DexterMorgan Posted August 4, 2008 Author Share Posted August 4, 2008 You are forgetting two things. First, it will literary burn up your CPU since it uses 100%, you need a Sleep() in there. Second, you should have read the page about _IsPressed more "in-depth". When these two things are added it is almost at 0% CPU usage. #NoTrayIcon #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 $pos = MouseGetPos() $var = PixelGetColor( $pos[0] , $pos[1] ) ToolTip($pos[0] & "," & $pos[1] & @CRLF & Hex($var, 6) ) If _IsPressed(11, $dll) and _IsPressed(50, $dll) Then ClipPut( Hex($var, 6)) EndIf If _IsPressed(11, $dll) and _IsPressed('4D', $dll) Then ClipPut( $pos[0] & "," & $pos[1]) EndIf If _IsPressed('1B', $dll) Then ExitLoop EndIf Sleep(10) WEnd DllClose($dll) ohh.. well that works too.. Thanks code Link to comment Share on other sites More sharing options...
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