Lanphrost Posted September 2, 2010 Share Posted September 2, 2010 (edited) Alright, so my problem is basically that I want the program to constantly check to see if there's a specific color in a certain spot and then send a command if that color is present. Unfortunately, I can't tell if it's looping, or if it simply checks once and then gives up. I'm guessing the latter. WinWaitActive( "firefox" ) $coord = PixelSearch( 145, 593, 292, 448, 006699, 10) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf As far as I can tell, if the color is there when the window opens it'll give me a dialogue of where it first detected the color. What I need it to do is to constantly check that space for the color and then "Send ("{TAB}")" which I haven't tried because I can't get my debug mode (the above snippet) working. Any help or advice would be appreciated. Edited September 2, 2010 by Lanphrost Link to comment Share on other sites More sharing options...
maqleod Posted September 2, 2010 Share Posted September 2, 2010 Why don't you have it write the color it sees in that spot to a log? that way you know if it loops because you'll have multiple entries rather than just one, you can use PixelGetColor() and _FileWriteLog() [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2010 Share Posted September 2, 2010 Its certainly not looping as there is no loop in your code. also step 10 will give you a 1 in 10 chance of catching your pixel. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Lanphrost Posted September 2, 2010 Author Share Posted September 2, 2010 Oh, now I see it, I was supposed to use 0, 10 And how would I loop that? I've tried a few variations, but all of them have failed so far. Link to comment Share on other sites More sharing options...
JohnOne Posted September 2, 2010 Share Posted September 2, 2010 if you want to loop until it finds the pixel. WinWaitActive("firefox") While 1 $coord = PixelSearch(145, 593, 292, 448, 006699) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) Exit EndIf Sleep(10) WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Lanphrost Posted September 3, 2010 Author Share Posted September 3, 2010 (edited) Alright, the color seems to be off, but I can't figure out which color it is, and I want it to loop even after it's found the color, is that possible? Edit 2: Got the thing to loop, removing 'exit' was easy enough. Now I just need to figure out what color it is that I'm looking for. Edited September 3, 2010 by Lanphrost Link to comment Share on other sites More sharing options...
Lanphrost Posted September 3, 2010 Author Share Posted September 3, 2010 And now it's working, thanks for all the help! Link to comment Share on other sites More sharing options...
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