Sign in to follow this  
Followers 0
tinytoon9002

A new comer need help!

7 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

thanks, but the problem is not in the hot key.

I mean the collected color is wrong, it always give me 0 value when i run this graphic program, so i can't catch the correct color.

Share this post


Link to post
Share on other sites

is it on the internet?

is it a game?

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

GameGuard?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes, it is internet and a game. Do u have any idea? it is XTrap.

Edited by tinytoon9002

Share this post


Link to post
Share on other sites

Any1 pls help me, pls

Share this post


Link to post
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
Sign in to follow this  
Followers 0