Jump to content

Do PixelSearch Until, Then


Recommended Posts

Hey folks, my brains fried. i've been stuck at this line of code for a couple hours now. I've done Google searches, forum searches, etc.. I'm making no progress and I feel like I've tried every variation of the code possible. It's a simple program to open a 3d application I'm working on so I can Log in.

$default_resolutionX = 1920

$default_resolutionY = 1080

$x_ratio = @Desktopwidth / $default_resolutionX

$y_ratio = @Desktopheight / $default_resolutionY

Run ("C:\Program Files (x86)\3dMax\Projects\Project1.exe")

Do

$Pixel2 = PixelSearch(0,0,(1113 * $x_ratio),(616 * $y_ratio),0xF6F8FC,3)

Until @error Then

If not @error Then

MouseClick("left", Round(1113 * $x_ratio),Round(616 * $y_ratio))

Endif

Do

$Pixel3 = PixelSearch(0,0,(1113 * $x_ratio),(616 * $y_ratio),0xF6F8FC,3)

Until @error Then

Do

$Pixel4 = PixelSearch(0,0,(959 * $x_ratio),(356 * $y_ratio),0xEF571D,3)

Until @error Then

Etc..

I realize this is grossly incorrect, but I re-did the coding that would make sense to me. Hopefully you can see my way of thinking and help explain how I'm getting everything wrong here. Having a hard time figuring out how to continue off of "Until @error" because it seems to just stop when it becomes true, instead of wanting to use the "Then" request. It basically needs to search for the launch button with the distinct red color at those coords, when it appears, clicks it, then starts searching for the next pixel, clicks a certain point on the screen, etc...

Thanks folks. Once I grasp this, should be smooth sailing. This is my first Autoit program, coming from DOS batch files.

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...