← Back to team overview

sikuli-driver team mailing list archive

[Question #263493]: Sikuli click and drag from an imageA to the last count of equal imageB

 

New question #263493 on Sikuli:
https://answers.launchpad.net/sikuli/+question/263493

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.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.