← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #269783]: onappear qeustion

 

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

Description changed to:
Latest verion of java. sikuli 1.1.0

Im getting to grips with sikuli well almost. So i decided to play around with other bits to see if they would work better in my script.
Onappear is giving me trouble an im sure its down to me not understanding the docs. I can get my test code to click once on a pic when it appears but not second or third etc.... 

If someone can point me in the right direction id be greatful. Im sure when its pointed out to me i shall slap hand to head.
Is onappear()  better to use then exists() ?

def Quit(event):
    Settings.Dquit = 5
#
def Fish(event):
    #
    #click(event.Rg)  #  cannot get this work! think i got wrong syntex
    Rg.click("fishy.png") # this worked tho
    
#
Rg = Region(575,256,608,536)
Settings.Dquit = 1
Env.addHotkey(Key.ESC,0,Quit)
#
Rg.onAppear("fishy.png", Fish) # wait for fish to appear (its on a random timer)
#
Rg.observe(FOREVER,True)
#
while Settings.Dquit == 1:
    pass
#
exit()

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