← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #255984]: handler

 

Question #255984 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/255984

    Status: Open => Answered

Mark Weisler proposed the following answer:
Please paste a copy of the errors you get when running your program.
Also, it might help to initialize nb_quetes_tours_faites = 0 before going into the while loop.


On Oct 20, 2014, at 7:07 PM, den wrote:

> New question #255984 on Sikuli:
> https://answers.launchpad.net/sikuli/+question/255984
> 
> hello alll , i am fench so ...
> 
> i am new user of sikuli , and i just try to learn jython .
> 
> i read the faq a lot of times but i dont understand very wel , the aplication and how tu use an appear event for example , and particulary the parameter .
> 
> i try to do a lot of thing in my code but i dont find anything working :(
> 
> i would like to automatise in a loop , an on appear event  here the code for trying to help me ^^ :
> 
nb_quetes_tours_faites = 0
> 
> while nb_quetes_tours_faites != 200 : 
> 	#QueteValideeReg.onAppear("1413219985088-2.png", myHandler)
> 	#observe(FOREVER, background = True)
> 
> 	if QueteValideeReg.exists("1413219985088.png"):
> 		wait(1)
> 		QueteValideeReg.click("1413219985088.png")
> 		if exists(Pattern("1413716368262.png").similar(0.92)):
> 			click(Pattern("1413716368262.png").similar(0.92))
> 			if PrincipaleReg.exists("1413716480430.png"): # instance
> 				PrincipaleReg.click("1413716513801.png")
> 		nb_quetes_tours_faites += 1
> 		print(nb_quetes_tours_faites)
> 		continue
> 
> i know that is  a simple thing to do for an experiment user , but it is not my case XD 
> i have no ideea of how to make the handler , i ' ve try a lot , 3 weeks and i ' m so busy with this ...
> jyton put an eception if i put the "continue" in my handler.
> in the doc the handler part is very poor ( or i have understand nothing ) 
> 
> all help appreciated for solving my probleme .
> 
> thx
> 
> 
> -- 
> You received this question notification because you are an answer
> contact for Sikuli.
> 

-- 
Mark Weisler 
PGP Key ID 68E462B6
PGP Key fingerprint  87D5 A77B FC47 3CC3 DFF0  586D 23FF F8B4 68E4 62B6

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