Jump to content

limited version of AutoWindowSpy


layer
 Share

Recommended Posts

i was just messing around and just made something that tells you what position your mouse is at and the color under it in Hex... thats all, in a tooltip

HotKeySet ("{ESC}", "MyExit")
While 1
   $pos= MouseGetPos ()
   ToolTip ("X: " & $pos[0] & " " & "Y: " & $pos[1], $pos[0] +10, $pos[1] +10)
   $color= PixelGetColor ($pos[0], $pos[1])
   $hexit= Hex ($color, 6)
   ToolTip ("RGB Color under mouse: 0x" & $hexit, $pos[0] +10, $pos[1] +30)
   WEnd
   
   Func MyExit ()
      Exit
      EndFunc

not exactly sure why it flickers... but whatever, it works, and ya gotta be happy with what ya got! :D enjoy :idiot:

FootbaG
Link to comment
Share on other sites

Gah, flicker is an eternal problem with any script like this that's constantly doing things. When using a GUI or SplashScreen you can get round it by updating the text of the control, rather than re-displaying it every time. You can *possibly* do the same with a tool tip, but I dunno...

Edited by Chris_1013
Link to comment
Share on other sites

i was just messing around and just made something that tells you what position your mouse is at and the color under it in Hex... thats all, in a tooltip

HotKeySet ("{ESC}", "MyExit")
While 1
   $pos= MouseGetPos ()
   ToolTip ("X: " & $pos[0] & " " & "Y: " & $pos[1], $pos[0] +10, $pos[1] +10)
   $color= PixelGetColor ($pos[0], $pos[1])
   $hexit= Hex ($color, 6)
   ToolTip ("RGB Color under mouse: 0x" & $hexit, $pos[0] +10, $pos[1] +30)
   WEnd
   
   Func MyExit ()
      Exit
      EndFunc

not exactly sure why it flickers... but whatever, it works, and ya gotta be happy with what ya got! :D enjoy :idiot:

<{POST_SNAPBACK}>

Combine the two ToolTips into one using @LF and it will look real good.

ToolTip ("X: " & $pos[0]& " " & "Y: " & $pos[1] _

& @lf & _

"RGB Color under mouse: 0x" & $hexit, $pos[0] + 10, $pos[1] + 10)

Phillip

Link to comment
Share on other sites

just on the run and got bored while i wait 5 minutes so i just figured id make this...

While 1
   $pos= MouseGetPos ()
   $timeon= ToolTip (@Hour -12 & ":" & @Min & ":" & @Sec, $pos[0] +10, $pos[1] +10)
   WEnd

and for thso who like army time

While 1
   $pos= MouseGetPos ()
   $timeon= ToolTip (@Hour & ":" & @Min & ":" & @Sec, $pos[0] +10, $pos[1] +10)
   WEnd

so you have the clock at your mouse :idiot:

FootbaG
Link to comment
Share on other sites

nah, because that would cause the tool tip to be left a mile away from your mouse and be off by however much you sleep () between the loop... :lol: (maybe not what you were talking about?)

EDIT: btw... why don't you criticize autoit window spy :idiot: i betchya my little program takes up less then the window spy(not saying window spy is bad ;)) you must hate me :D

Edited by layer
FootbaG
Link to comment
Share on other sites

nah, because that would cause the tool tip to be left a mile away from your mouse and be off by however much you sleep () between the loop... :lol: (maybe not what you were talking about?)

EDIT: btw... why don't you criticize autoit window spy :idiot:  i betchya my little program takes up less then the window spy(not saying window spy is bad ;))  you must hate me :D

<{POST_SNAPBACK}>

You're speaking without actually knowing what you are talking about, I'm afraid. Even a simple Sleep(10) will stop the While loop from eating up the processor. If you can see ~10 milliseconds worth of latency when moving the mouse, congratulations on being a machine or superhero/villain.
Link to comment
Share on other sites

villan? and actually, it doesnt make a huge difference if you add the sleep (10) it only reduces the usage by 14 k :/

<{POST_SNAPBACK}>

Uhhhh, 14k? What are you talking about now? The wrong thing, obviously.

I'm talking about processor usage. With your script, AutoIt3.exe uses (Or tries to use) 100% of my CPU's power. By adding a Sleep(10) line inside the While loop, that drops back down to 0% with no noticeable latency to the movement.

Link to comment
Share on other sites

simple but useful, valik, i can notice the difference that sleep(10) makes, gj, also layer, you might want to add Decimal aswell ie..

ToolTip ("X: " & $pos[0] & " " & "Y: " & $pos[1] & @lf & "RGB Color under mouse: 0x" & $hexit & @lf & "Decimal : " & $color, $pos[0] + 10, $pos[1] + 10)

doesnt hurt to have decimal :idiot:, gj

Edited by burrup

qq

Link to comment
Share on other sites

heres an updated version where you can copy the things you see to the clipboard :idiot: just hit pause and go to a text file and hit CTRL+V :D

HotKeySet ("{ESC}", "MyExit")
HotKeySet ("{PAUSE}", "Clip")
While 1
   $pos= MouseGetPos ()
   $color= PixelGetColor ($pos[0], $pos[1])
   $hexit= Hex ($color, 6)
   ToolTip ("X: " & $pos[0] & " " & "Y: " & $pos[1] _
& @lf & _
"RGB Color under mouse: 0x" & $hexit, $pos[0] + 10, $pos[1] + 10)
Sleep (10)

   WEnd
   
   Func Clip ()
      ClipPut ("The color at" & " " & "X: " & $pos[0] & " and" & " " &  "Y: " & $pos[1] & " " & "is" & " " & "0x" &  $hexit)
      EndFunc
   
   Func MyExit ()
      Exit
      EndFunc
FootbaG
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...