find image and type pattern
iu am using sikuli version 1.1.3
I want to find image pattern and type out accordingly
only 6 pattern: up arrow, down narrow, left arrow, right arrow, letter j and letter k
the image pattern could be up,up,k the code will detect and type up,up,k
the image pattern could be down,left j the code will detect and type out down,down,j
my code is to find the image and sort it using the x coordinate, then type out
patterns = [Pattern(
start = Pattern(
mm = []
all_icons = []
def by_x(match):
return match.x
def by_sort(icons):
# sort the icons by their x coordinates and put them into a new variable sorted_icons
sorted_icons = sorted(icons, key=by_x)
for icon in sorted_icons:
def recycleAll(x,name):
# --- using exception handling
# every not found in the try block will switch to the except block
try:
icons = findAll(x)
while icons.hasNext(): # loop as long there is a first and more matches
except FindFailed:
pass # we miss it
while True:#This is the main loop of the application.
if exists(start):
for x in patterns:
#by_key(mm)
mm = []
all_icons = []
pass
else:
pass
Having problem after sorting them by x coordinate, not sure how to detect and type
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: