search for an image in parallel

Asked by ALEXANDROS SKAMPARDONIS

I have a script that runs real time according to what happens within a game.
The problem I face, is that I would like to always check if an image appears, and if so, I would like to immediately stop the execution of first script, and do something else.

I have tried to insert multiple checks in many places of the original script, but this is not really sufficient enough, and also seems to complicate the development of the script quite a lot.

I wonder if there is a way, to perhaps run another instance of sikuli in parallel with the first one, and then if the seconds catches that image, stop the execution of the first (or more ideally, stop the execution of the current command of the first script, and continue execution from another point).

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
Last query:
Last reply:
Revision history for this message
Best masuo (masuo-ohara) said :
#1
Revision history for this message
ALEXANDROS SKAMPARDONIS (alexskab) said :
#2

This is great masuo, exactly what I was looking for.
The theory seems to meet my expectations, I now have to understand it and implement it. Perhaps if you know where I can find an example of how to use the 'Observerer' would help me quite a lot.

Thanks alot!

Revision history for this message
ALEXANDROS SKAMPARDONIS (alexskab) said :
#3

Thanks masuo, that solved my question.