← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #195342]: Optimal way to scan constantly in main loop

 

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

    Status: Answered => Open

bengalih is still having a problem:
Rai....

This seems to work...

while True:
    wait(1)
    # search once every five seconds
    while not TestEpisodeRegion.exists("nextepisode.png", 0):
        wait(5)
    print("i see you")


However I have some questions

I would have expected this to stop the processing of the rest of the
script (in terms of hotkey handling) and only pickup the hotkeys every 5
seconds.  I guess then that a hotkey event will interrupt the script and
run at any time?

Also, I have the search region relatively narrow, it is probably set to about 1/50th of the screen.
I still see that Sikuli spikes the java process to about 3-5% every x seconds (with X being my wait interval above).
Short of narrowing the scan area,  or increasing the interval between checks with the wait, are there any other tuning operations I can perform that might lessen CPU?

I had narrowed down the area by about half and didn't see any real
changes in cpu consumption, so I'm wondering if narrowing the area will
really help (while still keeping it large enough to be accurate for my
image).

thanks

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