Jump to content

Waitpixel command


Recommended Posts

Hi I am new and trying to writing macro but I have one problem. My function must: ""When the colour appears in coordinates, then press "a" """ but I cant find where I need to put the send("a") command . When I put in the While.....Wend it doesnt wait the colour to press "a". When I put the out of the While...Wend line then it doesnt press the "a". Anyone knows the where I need to put ?

Local $WaitPixelColor = 0xF8F4F8, $waitpixel
While 1
    $waitpixel=PixelSearch (340,75,1148,440, $WaitPixelColor)
    If Not @error Then ExitLoop
WEnd

 

Link to comment
Share on other sites

  • Developers
4 minutes ago, jackiemagpie said:

I cant find where I need to put the send("a") command

What do you think when considering your requested logic?

4 minutes ago, jackiemagpie said:

When I put the out of the While...Wend line then it doesnt press the "a". Anyone knows the where I need to put ?

That means it that pixels never gotten that color as yet in the indicated area. ;) 

So what is the goal really for this script?

Jos

Edited 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.
  :)

Link to comment
Share on other sites

2 minutes ago, Jos said:

What do you think when considering your requested logic?

That means it that pixel never gotten that color as yet. ;) 

So what is the goal really for this script?

Jos

I said the goal: When colour appears in coordinates, press a. Simple right ? Also pixel got the colour but dont press a, it finishes the script.

Link to comment
Share on other sites

  • Developers
7 minutes ago, jackiemagpie said:

I said the goal: When colour appears in coordinates, press a. Simple right ?

sweet ....   have fun.

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

5 hours ago, jackiemagpie said:

I said the goal: When colour appears in coordinates, press a. Simple right ? Also pixel got the colour but dont press a, it finishes the script.

Lets rephrase what Jos asked - in what application are you using this logic? (the name of the app please) I ask for there may be a MUCH better way to do it. Pixel searching  is the worst way to automate. Usually hooking directly into the control is best.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...