jackiemagpie Posted June 27, 2020 Share Posted June 27, 2020 Hi I am new and trying to writing macro but I have one problem. My function must: ""When the colour appears in coordinates, then press "a" """ but I cant find where I need to put the send("a") command . When I put in the While.....Wend it doesnt wait the colour to press "a". When I put the out of the While...Wend line then it doesnt press the "a". Anyone knows the where I need to put ? Local $WaitPixelColor = 0xF8F4F8, $waitpixel While 1 $waitpixel=PixelSearch (340,75,1148,440, $WaitPixelColor) If Not @error Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
Developers Jos Posted June 27, 2020 Developers Share Posted June 27, 2020 (edited) 4 minutes ago, jackiemagpie said: I cant find where I need to put the send("a") command What do you think when considering your requested logic? 4 minutes ago, jackiemagpie said: When I put the out of the While...Wend line then it doesnt press the "a". Anyone knows the where I need to put ? That means it that pixels never gotten that color as yet in the indicated area. So what is the goal really for this script? Jos Edited June 27, 2020 by 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...
jackiemagpie Posted June 27, 2020 Author Share Posted June 27, 2020 2 minutes ago, Jos said: What do you think when considering your requested logic? That means it that pixel never gotten that color as yet. So what is the goal really for this script? Jos I said the goal: When colour appears in coordinates, press a. Simple right ? Also pixel got the colour but dont press a, it finishes the script. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 27, 2020 Developers Share Posted June 27, 2020 7 minutes ago, jackiemagpie said: I said the goal: When colour appears in coordinates, press a. Simple right ? sweet .... have fun. FrancescoDiMuro 1 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...
Bert Posted June 27, 2020 Share Posted June 27, 2020 5 hours ago, jackiemagpie said: I said the goal: When colour appears in coordinates, press a. Simple right ? Also pixel got the colour but dont press a, it finishes the script. Lets rephrase what Jos asked - in what application are you using this logic? (the name of the app please) I ask for there may be a MUCH better way to do it. Pixel searching is the worst way to automate. Usually hooking directly into the control is best. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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