Best Way to Test a Set of Different Images (Found Image)?

Hello, I’m struggling to understand how to realize my screen detection

Context :

In a game, I would like to monitor points to adjust reaction and triggers macros depending on levels.

Points are growing this way :
(A)
100 —> 200 —> 300 —> 400 —> 500 —> 600 —> 700 —> 800 (800 is final)

So I know beforehand the figures, the pb is it can also grow this way :
(B)
100 —> 400 —-> ….
namely skipping one or many levels (it never goes back)

Thoughts :

In case (A),

« Pause Until Found image 100 » —> triggers action 100
then
« Pause Until Found image 200 » —> triggers action 200
then
« Pause Until Found image 300 » —> triggers action 300…
an so on

is working well, I've tested it (screen detection is always in the same screen area),
but it doesn’t work in case (B) because if it goes from 100 to 400, « Pause Until » will wait for « Found image 200 » after the start.

At first I was thinking of having 8 different « if then » screen detection sub macros running asynchronously, but as the game can last 1 hour, I’m afraid of memory issue.

So now I’m searching more in this way :

(1)
as I know that first number is 100, I would start with « Pause Until 100 image is NOT found » (meaning the number has changed and that I have to move on and search for the right number displayed)

(2)
then test all remaining images (from 200 to 800) to found the right image and triggers the right action accordingly

Do you agree with this approach, and how can I build (2) ? I mean I've read a lot including about 'for each' action but I have no clue about how to handle it

I've just found a way, and I will post it below.



I've made a test on 6 pictures in my folders (VarName from 1 to 6) and it works so far

Don"t hesitate if you believe it could be done a better way.