TheKromz Posted November 30, 2012 Share Posted November 30, 2012 how can i make pixel search, keep searching for 5 seconds / intill it finds the pixel? Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 30, 2012 Share Posted November 30, 2012 (edited) http://www.autoitscript.com/autoit3/docs/functions/PixelSearch.htmhttp://www.autoitscript.com/autoit3/docs/keywords/While.htmOh ... andhttp://www.autoitscript.com/forum/forum-2/announcement-15-forum-rules-7-nov-2012/ Edited November 30, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
TheKromz Posted November 30, 2012 Author Share Posted November 30, 2012 but doesn't that go infinite in-till expression is false how can i make it stop after 5 seconds and till expression is true? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 30, 2012 Developers Share Posted November 30, 2012 What have you tried first before asking your question? I hope your goal isn't that we make it for you. Start reading and searching and come back when you tried something that doesn't work. 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...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 As Jos said make some code, play and experiment its the only way your going to learn but the areas you need to look at are Pixelsearch, For, While and Sleep the code is not hard. Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 30, 2012 Share Posted November 30, 2012 http://www.autoitscript.com/autoit3/docs/functions/TimerInit.htm http://www.autoitscript.com/autoit3/docs/functions/TimerDiff.htm Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 TimerInit/dif isn't required just sleep. Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 30, 2012 Share Posted November 30, 2012 TimerInit/dif isn't required just sleep.Sleep is a blocking function. He wants the program to search for five seconds OR until it finds the pixel. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 (edited) Yes, and it can all be done with sleep :/ I have posted in an earlier reply everything thats required for the small project Edited November 30, 2012 by Gotemp Link to comment Share on other sites More sharing options...
Blue_Drache Posted November 30, 2012 Share Posted November 30, 2012 *facepalm* ... Ok. Whatever. BrewManNH 1 Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
JohnOne Posted November 30, 2012 Share Posted November 30, 2012 *facepalm* ... Ok. Whatever. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Gotemp Posted November 30, 2012 Share Posted November 30, 2012 (edited) He has my working code, maybe new but i know it works =) Could of looked better too but i was busy, anyhow bed time its late =) Edited November 30, 2012 by Gotemp Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 1, 2012 Share Posted December 1, 2012 (edited) Your code that you PM'd me doesn't work for shit. If you gave him the code I PM'd you, then you're a liar. Edited December 1, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
TheKromz Posted December 1, 2012 Author Share Posted December 1, 2012 i don't understand how to use TimerInit could someone give a brief explanation please i'm pretty new to this stuff. Link to comment Share on other sites More sharing options...
JohnOne Posted December 1, 2012 Share Posted December 1, 2012 Does the code Gotemp sent you, not work? AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheKromz Posted December 1, 2012 Author Share Posted December 1, 2012 i never received the one gotemp sent. Link to comment Share on other sites More sharing options...
JohnOne Posted December 1, 2012 Share Posted December 1, 2012 he sent you some code via PM, do you know how to read a PM? AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheKromz Posted December 1, 2012 Author Share Posted December 1, 2012 i,m not allowed to use the private messaging system.(this is last post i can make till tomorrow so help would be appreciated thanks) Link to comment Share on other sites More sharing options...
Blue_Drache Posted December 1, 2012 Share Posted December 1, 2012 i,m not allowed to use the private messaging system.(this is last post i can make till tomorrow so help would be appreciated thanks)Why not put the time to good use and read the help file. With all the fun examples and what-not, you just might not need to come back for help. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Gotemp Posted December 1, 2012 Share Posted December 1, 2012 (edited) @Kromz - i never sent you code, i told you to look at how to write it.@John - read above@Blue - I only sent you code and i would like less of the language and accusations, i also suggest you read your pm and learn that you can break out of an infinite loop! Though i will admit im still learning and the code is NOT working as i fully intended because i dont play with pixelsearches and had to modify my original code which works with image searching. Oh and yes that uses and infinite loop and finds a result, what is it you said again? *facepalm*I would try and fix my code so it worked as i intended but after seeing your maturity i see no point, but i do advice you look over it and learn you can break out of an infinite loop, infact why dont you even ask here on these forums? Update:I got bored and decided i would work on getting my code to work as i originally intended and i have succeeded and replaced my While loop with a Do, Until loop.Reviews of code.Blue_Drache:His code works instantly and after 5.1 seconds it dies saying "Not found!".My original code (one quick test):Could of worked similar to blues with an instant find i had the first color as green to avoid that and then move onto the timed version though which looked for the pixel after 5 seconds, the theory of the while loop was to make it look for the pixel again if it was not found, this is where it failed but works with image searching like i said ive NEVER used pixel searching before.My new code (done a few tries with 1 second and 5seconds):Code sleeps for x seconds and then performs the search of cause the time can be changed to make the search as fast as possible because its and infinite loop, once the pixel has been found it does the required actions in this case a MsgBox with the coords and also move the mouse there. Edited December 1, 2012 by Gotemp Link to comment Share on other sites More sharing options...
Recommended Posts