Pharon Posted November 28, 2004 Share Posted November 28, 2004 I've looked through autoit help and couldn't find it, I need to make the mouse click when a certain color isn't under the mouse anymore. So lets say there is black under the mouse, and something red moves to where to mouse is, I want it to click while that color is there and stop when it moves away. Link to comment Share on other sites More sharing options...
Pharon Posted November 28, 2004 Author Share Posted November 28, 2004 Hmm, didn't do what I needed, how would I change it so that it will click when the color is under the mouse? I need to do this for about three colors, if this one isn't there then check for this, if not that one then check for this one. Along the way if any of them are under the mouse then click it. Link to comment Share on other sites More sharing options...
layer Posted November 28, 2004 Share Posted November 28, 2004 hmmm... study larrys code, look in the help file for the functions he used. theres not going to be one single function that does specifically every thing you want it, but you can make a fucntion that will, just think outside the box... FootbaG Link to comment Share on other sites More sharing options...
Pharon Posted November 28, 2004 Author Share Posted November 28, 2004 expandcollapse popupHotKeySet("=", "MyExit") HotKeySet("[", "MyStop") HotKeySet("-", "MyStart") Do Until 0 Func MyStart() $s = 1 Do If $s = 1 Then $coord = PixelSearch( 359, 378, 748, 379, 0x219988 ) If @error Then $s = $s + 1 Else MouseMove ( $coord[0], $coord[1] , 0 ) EndIf If $s = 2 Then $coord = PixelSearch( 359, 378, 748, 379, 0x020380 ) If @error Then $s = $s + 1 Else MouseMove ( $coord[0], $coord[1] , 0 ) EndIf If $s = 3 Then $coord = PixelSearch( 359, 378, 748, 379, 0x818507 ) If @error Then $s = $s + 1 Else MouseMove ( $coord[0], $coord[1] , 0 ) EndIf If $s = 4 Then $coord = PixelSearch( 359, 378, 748, 379, 0x9E9E9E ) If @error Then $s = 1 Else MouseMove ( $coord[0], $coord[1] , 0 ) EndIf Until $s = 99 EndFunc Func MyStop() $s = 99 EndFunc Func MyExit() Exit EndFunc Well, I tried to make it detect a color then put the mouse to it, but for some reason every time I run it I get a error saying that "Until $s = 99" has no matching Do statement, but there is one right at the begining. Link to comment Share on other sites More sharing options...
t0ddie Posted November 29, 2004 Share Posted November 29, 2004 (edited) lol try this do your code until EDIT: no wait, you DO have it in the right place, but you still have until 0 you need to erase that until 0 right under do EDIT2: sheesh, now i see another do in there also here... just get rid of this Do Until 0 Edited November 29, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
t0ddie Posted November 29, 2004 Share Posted November 29, 2004 oh i get it do until 0 keeps the program active hmm, let me look at this Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
t0ddie Posted November 29, 2004 Share Posted November 29, 2004 im stuck as well Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Pharon Posted November 29, 2004 Author Share Posted November 29, 2004 The only thing I could think of is that there is to much code between the Do and Until that it doesn't remember there is a Do up there. o.O I really doubt that's it though. Link to comment Share on other sites More sharing options...
t0ddie Posted November 29, 2004 Share Posted November 29, 2004 (edited) yep, i ran your code, i get the same error maybe instead of do until, use a while loop while $s > 0 your code wend then to stop it, $s = "" and i think the problem is in all those if statements. too damn many Edited November 29, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Pharon Posted November 29, 2004 Author Share Posted November 29, 2004 (edited) Yeah, but I couldn't think of a shorter way to make the script besides all the If statements, and I found out I need to put another color in there so if it's the If statements there will be another one. Edit: tried it and it says the wend statment has no while... Edited November 29, 2004 by Pharon 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