Guest Posted December 18, 2017 Share Posted December 18, 2017 (edited) im working on a macro and i want it to search 964,182,973, 197 for 0x496d36 but... i want it to keep search until it finds the pixel color (while 1 loop) or if it is searching for > 29 sec. how would i go about doing this? thanks in advance just now i realize a do... until loop would be the way to go. But, how would i get a "value"( for lack of a better word) for the time that the do... until loop stars then add 29 sec? Edited December 18, 2017 by lewiaa Link to comment Share on other sites More sharing options...
Earthshine Posted December 18, 2017 Share Posted December 18, 2017 (edited) Look in the help file please. Or is this easier than a google search? Search google for “timers in autoit” nuff said Edited December 18, 2017 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
aa2zz6 Posted December 19, 2017 Share Posted December 19, 2017 I would definitely use a If EndIf statement if the pixel is found ^^ $location = PixelSearch (137, 321, 540, 683,0xEEA200, 2, 1) If IsArray ($location) = 1 Then MouseClick ('left', $location[0], $location[1], 1, 0) EndIf References: https://www.autoitscript.com/autoit3/docs/keywords/IfElseEndIf.htm https://www.autoitscript.com/autoit3/docs/keywords/Do.htm https://www.autoitscript.com/autoit3/docs/functions/PixelSearch.htm https://www.autoitscript.com/autoit3/docs/functions/WinActivate.htm Link to comment Share on other sites More sharing options...
Bert Posted December 19, 2017 Share Posted December 19, 2017 (edited) What is the application you are working with? Also - why greater than 29 seconds? Pixel searching is the WORST way to automate. The slightest change in the GUI can break your script. It is extremely likely there is a script that already does what you are asking for. Edited December 19, 2017 by Bert Earthshine 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Earthshine Posted December 19, 2017 Share Posted December 19, 2017 You didn’t search for timers in the help file My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
RoundChecker Posted December 19, 2017 Share Posted December 19, 2017 Telling him what he didn't search doesn't really help him, maybe he did search but did not understand it and looks for some insight. Also pixel searching is not the worst way to automate no, it just depends on how you set up your pixel searching, you can also use backprop. method and return values forward and back to make it recognize several things than 1, just like neural network. In most cases of pixel searching people just look for x,y and the pixel, which is a wrong way to achieve the fullest of pixel searching, you can use math calculations to define the changes around by using the set x,y,l,h. Using those dimensions given then sub. or add certain needed amount to reach destination. To answer OP: Local Clicker = False Local $color = 0x496d36 $tLX = 964 $tLY = 182 $bRX = 973 $bRY = 197 Local $a = PixelSearch($tLX,$tLY,$bRX,bRY,$color,1) If isArray($a) then $Clicker = True EndIf While $Clicker = True $a = PixelSearch($tLX,$tLY,$bRX,bRY,$color,1) If isArray($a) then MouseClick("left", $a[0], $a[1],1, 0) ; ClickType, XPosition, YPosition, TotalClicks(Clicks that should be clicked), Speed (0 = instant) Else $Clicker = False EndIf WEnd This should do. Link to comment Share on other sites More sharing options...
RoundChecker Posted December 19, 2017 Share Posted December 19, 2017 Local $Clicker = False Forgot "$" Make sure you read the code and try to understand it. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 20 minutes ago, RoundChecker said: Telling him what he didn't search doesn't really help him, maybe he did search but did not understand it and looks for some insight. Not sure I would agree there, but it is funny to see how many respond without the OP even responding to any of it. Also wondering whether you read the forum rules as the posted example is pretty much a game automation script without naming it. Your other posts are also it that direction. Jos Earthshine 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...
RoundChecker Posted December 19, 2017 Share Posted December 19, 2017 Just now, Jos said: Not sure I would agree there, but it is funny to see how many respond without the OP even responding to any of it. Also wondering whether you read the forum rules as the posted example is pretty much a game automation script without naming it. Your other posts are also it that direction. Jos Why would you not agree there? Ofcourse its agreeable, telling him what he didn't read without knowing what he read or not doesn't help him. Not everyone understands the examples you have in AutoIt and the tutorials, some people does not comprehend reading as well as others. Asking for help should be returned in answering first then referring him to a certain topic he could learn more about it, not judge him telling him he didn't read - THAT doesn't help. Also you are judging for game automation when he asked for a macro, it can be for several things, he is searching such a small area of the screen for 1 certain color, that should be clicked until it's gone, then looped. It can be anything, it can be checking for a buff within a game to appear and spam click it, it can be checking an area on his screen and making a macro, it can be a certain application that pops up something he wants to remove every now and then.https://merelynumbers.com/hexadecimal/0x496d36 The color he is searching for is green. And no my other posts aren't about that at all. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 You're quite defensive there ...aren't you, but you didn't answer the question whether you have read the forum rules yet. We will see what legitimate purpose the OP comes up with. 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 No, not defensive at all, I am just stating the obvious, humanity tends to rule and judge because of their status and position, because they think they can, without any proof or knowledge behind the intentions of the cause. Yes I did read the rules, and I do understand them perfectly, I hope you did also read the rules as a Developer and attend your time to actually helping people instead of judging them, you can answer the OP, then tell him if this is for game automation I will not give you the answer, how you choose to answer is up to you - But judging people is not anywhere close to a behavior one should have towards a community that is built for seeking help from the others that knows more within this certain topic. Me stating my opinion and how you should not judge people is not the definition of defensive, it is rather the opposite, it's the definition of standing up for what one means and thinks. Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 Sure.. thanks for the lecture Earthshine 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...
Somerset Posted December 19, 2017 Share Posted December 19, 2017 Free shovels! Get your free shovels. Link to comment Share on other sites More sharing options...
kylomas Posted December 19, 2017 Share Posted December 19, 2017 Quote Sure.. thanks for the lecture @jos - perhaps he knows about whine wine also! 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 Link to comment Share on other sites More sharing options...
kylomas Posted December 19, 2017 Share Posted December 19, 2017 RoundChecker - don't get your panties in a bunch...just poking a little fun... 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 Link to comment Share on other sites More sharing options...
Earthshine Posted December 19, 2017 Share Posted December 19, 2017 (edited) roundchecker, I am not here to do it for him. and, IF you search google with phrase, "timers in autoit" he would have had his answer. I don't care what you think by the way. or do i need to search for him too?!? there, you want to be spoon fed? You are not helping him by doing it for him, especially when it's child's play to search google. LAZY. I, for one, am tired of the laziness. At least I pointed him to his answer. Lead a horse to water https://www.google.com/search?q=timers+in+autoit&rlz=1C1CHBF_enUS771US771&oq=timers+in+autoit&aqs=chrome..69i57.5508j0j7&sourceid=chrome&ie=UTF-8 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...
Bert Posted December 19, 2017 Share Posted December 19, 2017 (edited) 54 minutes ago, RoundChecker said: Also pixel searching is not the worst way to automate no, it just depends on how you set up your pixel searching, you can also use backprop. method and return values forward and back to make it recognize several things than 1, just like neural network. Yes it is the worst way for a LOT of reasons. It is inherently UNSTABLE the slightest change to the GUI will break it. This includes window resizing, application update by the vendor and so forth anything that gets put in front of the window - oh look - script breaks. if the window isn't the active window - depending on how the script is written - broken. I can keep going. You should ALWAYS try first to hook directly into the control. I can only count on one hand the number of times where pixel searching was the only option in solving the problem when dealing with controls. I've been working with AutoIt since 2005 so I think I know what I'm talking about. Now if this is game automation - we ALL know that is a No, NO, NO WAY, NO! Just NO! in that being discussed in the forum. So, I will ask again: The name of the application please. Edited December 19, 2017 by Bert Earthshine 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
RoundChecker Posted December 19, 2017 Share Posted December 19, 2017 No it does not, if you worked with AUTOIT since 2005 you should know that you have a way to get window position, then from that window position you can always assert calculations referring to that, as in backprop. I suggest you search that up if you are unfamiliar with Neural networking and how values can be sent forward and back. I might be new to AutoIT, but I am definitely not new to scripting, and I know what I AM talking about. And nothing needs to be put infront of the window if you are smart enough to use several functions, as window always on top, recheck the window always before pixel searching, to activate it, if its not activated then activate it again, also recalculate the changes everytime it activates, and link them all together, if you actually knew what you were talking about you wouldn't say it's the worst. Everything has its pros and cons. I could go on forever and ever about this, but it seems your experience with pixelsearching is very low and if you even know how Neural System works, it works on actual pixelsearching and controlling Neurons from several pixels to send a certain weight and by adding values such as Bias to increase and decrease the output from input and vice versa to come to a result. The most intelligent AIs are now built on pixel searching and you're going to tell me that it's terrible? Please. Link to comment Share on other sites More sharing options...
Earthshine Posted December 19, 2017 Share Posted December 19, 2017 (edited) what applications we talking about then? 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...
Developers Jos Posted December 19, 2017 Developers Share Posted December 19, 2017 (edited) Could everybody please do me a favor and stop posting till the OP is back and replies as we have now 19 reply posts! Jos Edited December 19, 2017 by Jos junkew 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...
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