Sign in to follow this  
Followers 0
TheKromz

pixel search help

21 posts in this topic

how can i make pixel search, keep searching for 5 seconds / intill it finds the pixel?

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

TimerInit/dif isn't required just sleep.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by Gotemp

Share this post


Link to post
Share on other sites

*facepalm* ... Ok. Whatever.

1 person likes this

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 by Gotemp

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

i don't understand how to use TimerInit could someone give a brief explanation please i'm pretty new to this stuff.

Share this post


Link to post
Share on other sites

i never received the one gotemp sent.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#20 ·  Posted (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 by Gotemp

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0