Jump to content

My PixelGetColor Script


jlarson
 Share

Recommended Posts

I would have put this in the example forums but I can't post there yet...

Press Home to get the current color of where your mouse is. It's a very noobish script but I use it all the time and you might think it's usefull.

Tell me what you think!

; Includes
#include <GUIConstantsEx.au3>

; Variables
$x = 0
$y = 0
$xx = 0
$yy = 0
$start = False

HotKeySet("{HOME}", "set")

Func set()
    $xx = MouseGetPos(0)
    $yy = MouseGetPos(1)
    $start = True
EndFunc

GUICreate("Pixel Search", 200, 700)
GUISetState(@SW_SHOW)

while 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    Sleep(1000)
    If $xx > 0 And $yy > 0 And $start == True Then
        $pixel = PixelGetColor($xx, $yy)
        GUICtrlCreateLabel($pixel, $x, $y)
        $y = $y + 15
        $start = False
    EndIf
    If $y > 700 Then
        $y = 0
        $x += 50
    EndIf
    If $x > 200 Then
        Exit
    EndIf
WEnd
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...