Jump to content

A new comer need help!


Recommended Posts

Dear everyone

I am trying to make some small code to catch the pixel color inscreen. But what i got is only 0 value in my save file. It only happens when i run a graphic program then try to capture its pixels, but when i close it and run in desktop screen, it works. So can someone explain and help me to solve it.

Thanks in advance and here is my code :

3276800 = 320000H (but i don't know how to write it in Autoit)

HotKeySet("{F9}", "Terminate")

Func Terminate()

FileClose($file)

Exit 0

EndFunc

While 1

$file = Fileopen ("color.txt", 2)

$var = 0

While $var< 3276800

$var = PixelGetColor( 170 , 377)

FileWriteLine($file, String($var))

Wend

MouseClick("left", 170, 377, 1, 0)

$var = 0

While $var< 3276800

$var = PixelGetColor( 213, 352)

FileWriteLine($file, String($var))

Wend

MouseClick("left", 251, 377, 1, 0)

$var = 0

While $var< 3276800

$var = PixelGetColor(294,352)

FileWriteLine($file, String($var))

Wend

MouseClick("left", 332, 377, 1, 0)

Wend

Link to comment
Share on other sites

maybe

HotKeySet("{F9}", "Terminate")

Dim $file = FileOpen("color.txt", 2)

While 1
    $var = 0
    While $var <> "3276800"
        $var = PixelGetColor(170, 377)
        FileWriteLine($file, String($var))
        Sleep(20)
    WEnd
    MouseClick("left", 170, 377, 1, 0)
    $var = 0
    While $var <> "3276800"
        $var = PixelGetColor(213, 352)
        FileWriteLine($file, String($var))
        Sleep(20)
    WEnd
    MouseClick("left", 251, 377, 1, 0)
    $var = 0
    While $var <> "3276800"
        $var = PixelGetColor(294, 352)
        FileWriteLine($file, String($var))
        Sleep(20)
    WEnd
    MouseClick("left", 332, 377, 1, 0)
    Sleep(20)
WEnd

; ------- Functions ------------------

Func Terminate()
    FileClose($file)
    Exit 0
EndFunc  ;==>Terminate

8)

NEWHeader1.png

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...