sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #36045
[Question #279248]: Successful use of Region with onAppear
New question #279248 on Sikuli:
https://answers.launchpad.net/sikuli/+question/279248
Hello, im having a bit of trouble figuring out how to use onAppear and Region properly. At first ive tried onAppear with the image only but the problem with that is the image that pops up doesnt last more than 5 seconds and I dont exactly know how long it keeps looking for this image to appear or how long it would take to notice its popped up. So im looking into adding a more refined search area that should improve search speeds (ive read it normally takes 3 seconds to search the whole screen and with region it can take .1 of a second?). If I can just learn how to use it once I can replicate it.
What I have so far.
for x in range(1000):
if exists("1450123792558.png"):
click("1450123792558.png")
wait(10)
if exists("1450123911447.png"):
click("1450123911447.png")
onAppear("1450123985359.png", lambda:click("1450124572739.png"))
Region(1309,107,271,52).observe(125)
In short. It clicks an image, a page pops up, it clicks an image to get things going, after X amount of time a message will popup near the top right of the page (I want it to wait until it notices this and act according.) Ill have it exit the page and repeat all over. If that image doesn't appear for some reason ill have to figure out how to have it timeout and restart the process but one problem at a time.
Ive done some reading and thats why you see lambda,observe, etc, but im at a loss, as I gained more knowledge I got even more lost and confused... Some help would be much appreciated.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.