Re: [Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-08 Thread Karl
Question #284364 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/284364

Status: Open => Answered

Karl proposed the following answer:
The default region is your screen. If you search nearby 50 of this
region, you'll just get your screen again.

Make sure you're getting all your regions from my_find.
When you call my_find put the returned regions in a variable, and loop over 
them to do your double clicking.
It sounds like you would need to do your double clicking in the function 
definition to have the name variables to write..

Lastly, it looks like you're only searching for a subset of the images
when you use recursive input. If you do recursively find all possible
images with nearby when two images are next to each other it would
trigger an infinite loop.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-04 Thread VincentDugue
Question #284364 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/284364

Status: Answered => Open

VincentDugue is still having a problem:
thank for you reply Karl,
I tried it and it works a little :P
My last script for this function was :
#first line
def my_find(region, str):
if (len(str)>1):
regioni = my_find(region, str[0])
while regioni.hasNext():
referenceRegion = regioni.next()
try:
return my_find(referenceRegion.nearby(50),str[1:])
except:
pass
else:
picti = str[0]+".png"
try:
regionfound = region.findAll(Pattern(picti).exact)
return regionfound
except:
pass
#last line

It work a lil too but i think i have too mix both script to finally get my 
function 
if you have any idea to do it, please say it to me 
Thanks a lot for everything

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-04 Thread Karl
Question #284364 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/284364

Status: Open => Answered

Karl proposed the following answer:
It looks like you're trying to recursively create regions and then pass them to 
doubleClick. That won't work because doubleClick only works on one PSMRL at a 
time. 
http://sikulix-2014.readthedocs.org/en/latest/region.html?highlight=doubleclick#Region.doubleClick

The recursion seems interesting enough. You can put the doubleClick in
your definition.

def my_doubleClick(str):
if len(str) == 1 :
doubleClick(str+".png")
else:
str2 = str[:-1]
return my_find(str2
my_doubleClick("AFR1234")

#You can simply use:
str = "AFR1234"
for letter in str:
#type(str)
doubleClick(letter+".png")

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-02 Thread VincentDugue
Question #284364 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/284364

Status: Needs information => Open

VincentDugue gave more information on the question:
I think it's because of my 
the script is actually working i change somethings, including index[]
so the program is looking for the good Letters (A, then B, then C...etc)
but my RegionSearch only take the last letter/number(for example 4) and then it 
clicked on a random 4 on the screen...
how to concatenate "A.png" + "B.png" ... + "4.png" ?? 

And yes all my screenshot letter/number are like :
Pattern("A.png").exact  #.similar(1)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-02 Thread Eugene S
Question #284364 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/284364

Status: Open => Needs information

Eugene S requested more information:
When you say "it doesn't click", are you certain that what you are
looking for was actually found? let's start from here

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #284364]: how to use while len(string) > 1 : ??

2016-02-02 Thread VincentDugue
New question #284364 on Sikuli:
https://answers.launchpad.net/sikuli/+question/284364

Hi everybody !
I need help for my script... 
#1st line
def my_find(str):
while len(str) > 1 :
str2 = (str[len(str)-1:]
return my_find(str2).nearby(30)
RegionSearch = find(str+".png")
return RegionSearch
#End my_find
#indent correct
doubleClick(my_find("AFR1234")

I'm working on an airport software and i want to create a "SearchingTool" :
Write the name of the airplane, doubleClick on the Airplane in the software... 
My function is working but it doesn't click on the good airplane 
I think THE while isn't working. I need help please :)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp