Dag Posted May 21, 2007 Share Posted May 21, 2007 (edited) is it posible to make function what move my mouse from left side of screen to right (this in loop) and when pixel search event return succes (for example pop up show in right down corner) stop mouse moving and start next function? i try Do function but it dont work to good in this case and next question about sending data i have one program writing in delphi, and i save all result in txt file, and my autoit program read this txt file and depend of saved data, start diferent functions. is it good solution? if not how to send data directly to autoit program? thanks for helm regards Edited May 21, 2007 by Dag Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 21, 2007 Share Posted May 21, 2007 Yes it's possible. Doesn't even sound hard. Post your code and we'll fix it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Dag Posted May 21, 2007 Author Share Posted May 21, 2007 $color=color code Func test() Do $search = PixelSearch( 345, 45, 356, 56, $color) If not @error Then $pixelfound=1 EndIf MouseMove(210, 95,2) MouseMove(920, 95,2) MouseMove(80,646,2) MouseMove(962,646,2) Until $pixelfound=1 TrayTip("", "i found pixel" , 8 , 1) call ("other_function") EndFunc it is something like that, but this function first move my mouse 4 times and next call "other_function" i need to stop mouse in the middle of move when pixel is detected Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 21, 2007 Share Posted May 21, 2007 You don't give a valid value to $color, nothing calls your test() function, and the area searched is not the same area that the mouse is moving though. What are you trying to do? I can't tell what you are trying to accomplish. Do you want the mouse to end up on the matching pixel? This will do it, but I can't tell if that is what you are doing: $color = 0xFFFFFF ; black test() Func test() $pixelfound = 0 $search = PixelSearch(345, 45, 356, 56, $color) If Not @error Then MouseMove($search[0], $search[1]) TrayTip("", "i found pixel", 8, 1) Sleep(2000) EndIf EndFunc ;==>test Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Dag Posted May 21, 2007 Author Share Posted May 21, 2007 (edited) area searched is not the same area that the mouse is moving though.ya, i knowi try to explain it clearliermy mouse is moving around all screen, and when mouse pointer is at specific object, in small area of my screen corner color change to blueso i set pixelsearch function area in this screen fragment. and now when mouse is at specific object, my program detect color changes in screen corner, stop mouse moving and call another function.i also know that in my previous post was no color code and function what call test() but my script have ~2,5k lines so i post only my test fragmenti hope you understand my englishthx for help--------edit:my only idea is move mouse by few pixels, next check color and again move mouse, check color etc etc. Edited May 21, 2007 by Dag Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 21, 2007 Share Posted May 21, 2007 my mouse is moving around all screen, and when mouse pointer is at specific object, in small area of my screen corner color change to blueso i set pixelsearch function area in this screen fragment. and now when mouse is at specific object, my program detect color changes in screen corner, stop mouse moving and call another function.OK. I think I get it. You don't want to tell MouseMove() to go all the way across the screen then. You want your loop to increment counters for X and Y, and move one or two (or three, whatever granularity you need) pixels at a time. That will make it easy to stop when you get your color change. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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