SweatyOgre Posted June 27, 2004 Share Posted June 27, 2004 I need my script to look for a certain pixel in a given area, then if it finds the pixel, right click it. Here's my code, but it's not working. $color = PixelSearch(430, 340, 710, 455, 6824048) If not @error then MouseClick("right",$color[0],$color[1], 1, 0) Else EndIf If anyone knows what's wrong, any help would be much appreciated. Link to comment Share on other sites More sharing options...
pekster Posted June 27, 2004 Share Posted June 27, 2004 The code itself is good, so your problem is either that it's not finding the pixel, or that the click isn't in the proper place or at the proper time. By proper place I mean that, although it is clicking on a pixel of your requested color, it may not be the proper spot to register the click in whatever app you're scripting. You could try adding or subtracting a bit from the position of your click to see if that helps. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
SweatyOgre Posted June 27, 2004 Author Share Posted June 27, 2004 (edited) you mean the area it searches, or the actual spot it clicks, making it click a little away from the coordinate it returns? EDIT: also, how can i make it do this until it doesnt find the pixel color any more? just a Do...Until with the until being PixelSearch(430, 340, 710, 455, 6824048) = 0? Edited June 27, 2004 by SweatyOgre Link to comment Share on other sites More sharing options...
pekster Posted June 27, 2004 Share Posted June 27, 2004 you mean the area it searches, or the actual spot it clicks, making it click a little away from the coordinate it returns?I mean the spot it clicks. Since the code is valid, your problem must be that the click is either not in the correct spot to be detected by your application, or that a right click there doesn't do anything. I suppose the app could be blocking the "script click" and only accepting a real click too. also, how can i make it do this until it doesnt find the pixel color any more? just a Do...Until with the until being PixelSearch(430, 340, 710, 455, 6824048) = 0?How about this: While 1 $color = PixelSearch(430, 340, 710, 455, 6824048) If @error Then ExitLoop MouseClick("right",$color[0],$color[1], 1, 0) Sleep(100) WEnd [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. 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