OrangeTiger Posted December 19, 2017 Share Posted December 19, 2017 Hello, I'm pretty new to AutoIt, but I have avery strange Problem with the PixelSearch() Function The code I have is: $Coord = PixelSearch(0, 0, 1920, 1080, 0xFF0000) MouseMove($Coord[0], $Coord[1], 0) This should look for a Color (in this example red) on the whole screen and move the mouse to this position. It seems that it's finding the red color, but always with a offset to the right and bottom. So let's say the red Pixel is at 1000, 500 and PixelSearch returns 1200, 600. But it's not always off by a fixed value let's say 200 or 100. If the red Pixel is more to the right, the return of PixelSearch is even more to the right... Hopfully you could understand my problem. Thanks for the help Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 5 minutes ago, OrangeTiger said: Hopfully you could understand my problem. not really. What are you actually trying to do? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
OrangeTiger Posted December 19, 2017 Author Share Posted December 19, 2017 I want to move the mouse to the red pixel on the screen. Link to comment Share on other sites More sharing options...
Somerset Posted December 19, 2017 Share Posted December 19, 2017 facepalm. Earthshine 1 Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 No kidding ... That much I got from you initial post, but that doesn't really answer the question about what you are really asking as nothing is shown, so all you want us to do is guess? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
RoundChecker Posted December 19, 2017 Share Posted December 19, 2017 If you are trying to search your entire screen you might want to use what is within the software to calculate it instead of manually typing it, its more accurate and returns safer values. $Coord = PixelSearch(0, 0, 1920, 1080, 0xFF0000) MouseMove($Coord[0], $Coord[1], 0) To $Coord = PixelSearch (0, 0, @DesktopWidth, @DesktopHeight, 0xFF0000, 0) ; The last 0 there is the tolerance added, to make sure it finds red exactly. MouseMove($Coord[0], $Coord[1], 0) Link to comment Share on other sites More sharing options...
Earthshine Posted December 19, 2017 Share Posted December 19, 2017 (edited) snip Edited December 19, 2017 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
OrangeTiger Posted December 19, 2017 Author Share Posted December 19, 2017 You mean, what I want it for? Actually I don't really know yet. Maybe some aimbot, but I don't have any game for it in mind. I'm more interested in the "programming" part, not the "use" part. But I don't see why this is important for the question. Ok, thanks for the tip with @DesktopWith, but it still gives me wrong values. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 19, 2017 Moderators Share Posted December 19, 2017 (edited) @OrangeTiger please ensure you make yourself familiar with our forum rules - especially the part on game automation - before you proceed any further. You will not receive any assistance on this subject. Also, the old "No specific goal, just trying to learn" wears a bit thin. How are we to assist if you do not have a specific goal in mind that you want to accomplish? Edited December 19, 2017 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
OrangeTiger Posted December 19, 2017 Author Share Posted December 19, 2017 Ah well, didn't knew, that game automation is not allowed on this forum, sorry for that. So then this topic can be closed. Link to comment Share on other sites More sharing options...
Recommended Posts