Sign in to follow this  
Followers 0
Centrelink

*boggle* Just cant wrap myself around it.

4 posts in this topic

#1 ·  Posted (edited)

Hi guys long time reader (first)? time poster.

Having an issue I was hoping someone could help me out with, its alittle unique because of constraints of the GUI I'm building it for.

First of all I have 3 boxes to search.

Each of said 3 boxes may contain one or more click-able buttons.

BUT--I would only like to click one button/box at a time. (See image)

Posted Image

I would just use a direct mouse click, but the buttons vary every time the ui is opened or scrolled and I end up clicking on the wrong thing.

I'm currently using:

Do
    ;Right
$color=PixelSearch(1174, 370, 1194, 659,0x00000,0,3)
If NOT @ERROR Then
Mousemove ($color[0], $color[1], 10)
sleep(300)
mousemove ($color[0]-, $color[1]+x, 00)
sleep(300)
MouseClick ("left")


EndIf
Else

    
    
    $color=PixelSearch(1174, 370, 1194, 659,0x000000,0,3)
If NOT @ERROR Then
Mousemove ($color[0], $color[1], 10)
sleep(300)
mousemove ($color[0]+x, $color[1]+x,0)
sleep(300)
MouseClick ("left")

EndIf
Else

    
    
    $color=PixelSearch(1174, 370, 1194, 659,0xf3f3f3,0,3)
If NOT @ERROR Then
Mousemove ($color[0], $color[1], 10)
sleep(300)
mousemove ($color[0]+110, $color[1]+100, 00)
sleep(300)
MouseClick ("left")


EndIf 


$slider=PixelSearch(882, 388,891, 631,0xffffff,0,5)
    MouseMove($slider[0], $slider[1],0 )
    sleep(100)
    MouseWheel("down",2)
        
    sleep(100)
        
    
EndIf

But that is resulting in it missing a majority of box3 before it scrolls as it only checks box3 if box 1 and 2 are @error and the dropdown box mousing over a button in box3 makes it miss 2 boxes below it.

Any help would be greatly appreciated. I'm sure its a simple loop that I just cant get my head around.

Love you long time.

Edited by Centrelink

Share this post


Link to post
Share on other sites



If you are building the GUI in AutoIt then why are you doing a pixel search? Why not just interface directly with the control? Have you tried to get the ID if the controls?

I would just use a direct mouse click, but the buttons vary every time the ui is opened or scrolled and I end up clicking on the wrong thing.

I get that to a point but if the GUI is AutoIt generated (as you said in the beginning of your post)

Having an issue I was hoping someone could help me out with, its alittle unique because of constraints of the GUI I'm building it for.

then you can interact directly with the controls. If not, then we need more information so we will know what to do. Are you embedding something, interacting with something or what? Your post is very vague on the technical specs of your design.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

misspost.

Edited by Centrelink

Share this post


Link to post
Share on other sites

"GUI I am building it for"

Not building the GUI in Autoit.

Its the GUI I am building the script to use ;-)

Either-way. Thanks for all your help guys. I figured it out in the end. Ditched the else statements and its working as I needed it to..

Share this post


Link to post
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
Sign in to follow this  
Followers 0