Saurus Posted July 31, 2019 Share Posted July 31, 2019 Hello, first of all excuse me I have no experience in coding and I am new in here. But I have this code that id like to change a bit: $left = 880 $bottom =291 $right =1017 $top = 148 $color = 0xEEFBFB while(1) $pix = PixelSearch($right, $bottom, $left, $top, $color, 1) if Not(@error) Then Sleep(300) MouseClick("right",959,553,2,1) Sleep(2000) EndIf WEnd MouseMove(959,553,2) Id like the PixelSearch part to repeat 5 times (the pixel was found 5 times and it clicked on it 5 times) then i need to stop the pixel search, do the mouse move and repeat the whole script. Thanks for your time and once again sorry for my lack of knowledge. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 1, 2019 Share Posted August 1, 2019 (edited) @Saurus Which application are you trying to automate? Maybe there's a better way to do it, and not using PixelSearch Edited August 1, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Saurus Posted August 1, 2019 Author Share Posted August 1, 2019 @FrancescoDiMuro Hello, thaks for your response! Id prefer not to sure the application that im trying to automate. But you have to believe me that there is no better way to automate it. PixelSearch is 100% needed. Link to comment Share on other sites More sharing options...
Somerset Posted August 1, 2019 Share Posted August 1, 2019 1 hour ago, Saurus said: @FrancescoDiMuro Hello, thaks for your response! Id prefer not to sure the application that im trying to automate. But you have to believe me that there is no better way to automate it. PixelSearch is 100% needed. smells like a game related topic, from that suspicious response.. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 1, 2019 Moderators Share Posted August 1, 2019 @Saurus There is little anyone can do to assist if they don't understand what you're trying to accomplish. If you're uncomfortable stating the app in the forum, if it is proprietary or for work for instance, feel free to PM ***In case you missed it, this is a Mod stepping into a thread*** "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...
yeto Posted August 2, 2019 Share Posted August 2, 2019 On 8/1/2019 at 8:20 AM, JLogan3o13 said: @Saurus There is little anyone can do to assist if they don't understand what you're trying to accomplish. If you're uncomfortable stating the app in the forum, if it is proprietary or for work for instance, feel free to PM ***In case you missed it, this is a Mod stepping into a thread*** This is what he is trying to accomplish. He stated this in his first post. "Id like the PixelSearch part to repeat 5 times (the pixel was found 5 times and it clicked on it 5 times) then i need to stop the pixel search, do the mouse move and repeat the whole script." Link to comment Share on other sites More sharing options...
Developers Jos Posted August 2, 2019 Developers Share Posted August 2, 2019 9 minutes ago, yeto said: This is what he is trying to accomplish. He stated this in his first post. ... please reread that last part you quoted and simply stay out of this thread until it is given the OK! 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...
Saurus Posted August 3, 2019 Author Share Posted August 3, 2019 (edited) @JLogan3o13 @Jos Thank you for your quick responses! Meanwhile I managed to update the script a bit, but Id still like to keep its purpose confidential. Here it is: expandcollapse popup$left = 908 $bottom =291 $right =1017 $top = 175 $color = 0xEEFBFB Global $MouseClicks = 1 while(1) $pix = PixelSearch($right, $bottom, $left, $top, $color, 1) if Not(@error) Then Sleep(300) MouseClick("right",960,553,2,1) Sleep(2000) $MouseClicks = $MouseClicks +1 EndIf If $MouseClicks = 10 Then sleep(2000) MouseWheel("up",1) sleep(1000) MouseClick("right",960,553,1) Sleep(2000) MouseClick("left",854,567,1) Sleep(4000) MouseClick("right",960,553,1) Sleep(2000) MouseClick("left",854,567,1) Sleep(4000) MouseMove(960,900,1) Sleep(2000) MouseWheel("down",1) sleep(2000) MouseClick("right",960,553,1) sleep(2000) $MouseClicks -=10 EndIf wend But I have a different question about this script. Id like to implement a part that would sense that the pixel was not found for longer than X amout of time and then it would carry out a set of various actions and then restart the script. If youd help me with this I would highly appreciate it. Thanks. Edit: Ive had an idea of using if (@error) but how do I make it so it triggers itself lets say only after 30sec ? Edited August 3, 2019 by Saurus Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 4, 2019 Moderators Share Posted August 4, 2019 (edited) @Saurus if you do not want to publish the script purpose in the forum, that is fine, you can PM me with a full explanation. @Saurus As I pointed out in the PM, please familiarize yourself with the forum rules, especially the section on game automation, before posting again. Edited August 4, 2019 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...
Recommended Posts