tinytoon9002 Posted July 26, 2006 Posted July 26, 2006 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
Valuater Posted July 26, 2006 Posted July 26, 2006 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)
tinytoon9002 Posted July 26, 2006 Author Posted July 26, 2006 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.
Moderators SmOke_N Posted July 26, 2006 Moderators Posted July 26, 2006 GameGuard? 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.
tinytoon9002 Posted July 26, 2006 Author Posted July 26, 2006 (edited) Yes, it is internet and a game. Do u have any idea? it is XTrap. Edited July 26, 2006 by tinytoon9002
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