markyrocks 28 Posted March 1, 2015 I know this kinda sounds like a dumb noobish question but I am fairly decent at autoit but here goes. OK so I am constantly monitoring a line of pixels using a for statement. Example $y=614 For $x=0 to 1240 step 15 Mousemove($x, $y) $m=mousegetcursor() If $m <>14 then prepare to strike ect. There's nothing wrong with the code and it's moderately fast. But I want faster. And if I say just mousemove from one side of the screen to the other the script doesn't seem like it's monitoring the mouse cursor until the mouse move is complete. So I'm wondering if it's worth my while to just right a second script with a continuous loop that's sole purpose is to monitor the mouse cursor? I mean I know it sounds silly but even my code above stepping at 15 pixel intervals isn't exactly ideal bc sometimes the objective is missed by a pixel or 2....idk thanks in advance guys. Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Share this post Link to post Share on other sites
SadBunny 130 Posted March 1, 2015 Correct, the script halts until the mousemove is complete. Check the helpfile of the MouseMove function for information what the parameters can do. But what are you automating if you're waiting for a cursor change? There are bound to be better ways to accomplish your goal than to automate pixel hunting. Roses are FF0000, violets are 0000FF... All my base are belong to you. Share this post Link to post Share on other sites
water 2,359 Posted March 1, 2015 Just out of curiosity: Why do you need to monitor a line of pixels? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
markyrocks 28 Posted March 1, 2015 (edited) Well for what it's worth I tried other more precise methods to accomplish this task to no avail. I went as far as using pixel get color to save ever 5th pixel to an an array and then compare current pixel to the array looking for a change then a click but that didn't work. So this is kinda a last resort. Like I said it's working but just not as effective as I'd like. I think I'm hitting like 20-25%. I just tried running 2 scripts side by side but it looks like I'm encroaching on needing them to run on separate threads? Bc it seems like the script that is only monitoring the cursor is running 100% of the time nothing else will happen. @water it's part of a school project. Edited March 1, 2015 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Share this post Link to post Share on other sites
water 2,359 Posted March 1, 2015 What we want to know: Is this line a part of a GUI control, a web page etc. Depending on the answer we might suggest a better solution. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
markyrocks 28 Posted March 1, 2015 It's just like a living wallpaper with random click able objects. Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Share this post Link to post Share on other sites
water 2,359 Posted March 1, 2015 I still do not understand how the wallpaper is being set up, but anyway: Try: Mousemove($x, $y, 0) to enhance speed. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
markyrocks 28 Posted March 1, 2015 (edited) Ok thanks but ya that's how it currently is. OK so new question so let's say I can get a baseline for every 5th pixel in a given row for comparison. Is there a way to say take a screen shot and then compare the line to the screen shot while it's in memory instead of say having it copied to paint the comparing? Also is there no way to run 2 functions simultaneously ? Edit I've found adlibregister () so that may solve the issue but I guess I'll see. But from what I gather even using it still maybe no different than running a mouse cursor check once every loop Edited March 1, 2015 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Share this post Link to post Share on other sites
water 2,359 Posted March 1, 2015 Ok thanks but ya that's how it currently is. No, it is not. See parameter 3. 0 means that the move is instantly. You hadn't set parameter 3 so it defaulted to 10. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
kylomas 415 Posted March 1, 2015 If $m <>14 then prepare to strike ect. Have you read the forum rules? Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
markyrocks 28 Posted March 1, 2015 (edited) Have you read the forum rules? Ya it's what do you call that a figure of speech... didn't realize using common phrases was against the rules. Thanks I'll know better for next time. Anyways I figured out the issue the mouse cursor Id was wrong and instead of just moving it was moving then clicking on every position so. I corrected the id and now speed is definitely not an issue. It's working at like a 95% rate.No, it is not. See parameter 3. 0 means that the move is instantly. You hadn't set parameter 3 so it defaulted to 10. And yes that's how it was. I just failed to include it in the example that I posted. Yep 3 parameters x,y,speed gotcha Edited March 1, 2015 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Share this post Link to post Share on other sites
kylomas 415 Posted March 1, 2015 didn't realize using common phrases was against the rules Not necessarily, just asking the question before this gets too involved... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Share this post Link to post Share on other sites
Jos 2,164 Posted March 1, 2015 (edited) Ya it's what do you call that a figure of speech... didn't realize using common phrases was against the rules. Thanks I'll know better for next time. A yes would have been sufficient when you are acting within our rules. Since you have been pretty about your usage of AutoIt3, don't be surprised you get these questions. Jos Edited March 1, 2015 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. Share this post Link to post Share on other sites