Sikuli click and drag from an imageA to the last count of equal imageB

Asked by eduardobedoya

I have a single image (imageA) and several equal images "empty checker boxes" (imageB) that Sikuli count from top to bottom.
I would like to left click on imageA hold down and move mouse to the last imageB found on screen (the one at the bottom) using Sikuli.

A good fellow send me this code, to count and hover the mouse on the last imageB found:

count = 0
    try:
        matches = list(findAll(the empty checker box image))
        count = len(matches)
    except FindFailed:
        pass #nothing to do
    print "found:", count

    if count > 0:
        sortedMatches = sorted(matches, key=lambda m:m.y) # sorts top to bottom
        hover(sortedMatches[-1]) # take the last one

Thanks Advanced.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
eduardobedoya
Solved:
Last query:
Last reply:
Revision history for this message
eduardobedoya (gonnabdh) said :
#1

RaiMan answered this question in this link, thanks man!
https://answers.launchpad.net/sikuli/+question/263456