Multi Detection
Multi Detection lets you run multiple image checks against the same moment on screen, and perform actions based on the combined results.
How it works
Add image detections to its Detections tab. It checks them all, then runs On Success or On Fail based on the condition you pick.
Important: You can only put Image Detection and Code actions inside the Detections tab. Other actions won't work here.
Conditions
- One Detection Success: Passes if it finds any of the images. Fails if it doesn't find any.
- All Detections Success: Passes only if it finds every single image. Fails if even one is missing.
- All Detections Fail: Passes only if it finds none of the images. Fails if it sees any of them.
- One Detection Fail: Passes if at least one image is missing. Fails if it finds all of them.
- Always Success: Unconditionally succeeds after running the detections, and triggers On Success.
- Always Fail: Unconditionally fails after running the detections, and triggers On Fail.
Use Short Circuit (on by default) stops checking as soon as the result is known. With One Detection Success, it passes on the first match without checking the rest. Turn it off to run every detection first.
Detection Timing
Timeout and Scan rate are set once here and apply to every detection in the list. A timeout of 0 (the default) checks the screen once and moves on; a higher value makes each detection keep scanning for that long before it counts as failed, at the scan rate you pick. Use the Looping tab if you want to retry the whole Multi Detection rather than have each detection wait.
Use Caches (on by default) makes all detections use one screenshot, so they see the same moment and it only costs one capture. It only applies with a 0ms timeout. Turn it off if a detection changes the screen and later ones need to see that.
Loops
You can set the whole Multi Detection block to loop based on what happens:
- Loop on success: Keeps running as long as the condition passes.
- Loop on fail: Keeps running as long as the condition fails (like timing out).
- Loop always: Keeps running no matter what.
- Loop Count: How many extra times to repeat. For example, a loop count of `1` means it runs normally once, then repeats 1 time (2 times total). Use `-1` to loop forever.
- Loop Delay (ms): A pause between repeats. Without it a failing loop re-scans as fast as the device allows and drains battery. A few hundred milliseconds is enough.
Note: When putting actions inside a loop, you can use and to control the flow.
Save Result To Variable
The Condition tab has a field for naming a variable that stores this group's outcome: %name.found% is whether the condition passed, %name.count% how many detections matched, %name.total% how many there were, and %name.x% / %name.y% the position of the last one that matched. Each detection inside the group can also save its own result, which is what you want when you need one specific target's position rather than the group's. See for the full list of parts.
Nested Actions (On Success & On Fail)
Just like standard image detection, you can put any actions you want inside the On Success and On Fail tabs.
- On Success: Runs the actions here if your condition passes.
- On Fail: Runs the actions here if your condition fails.
Code Equivalent
// Create Regions (optional)
let region1 = new Region(100, 200, 50, 50);
let region2 = new Region(0, 0, Screen.getWidth(), Screen.getHeight()); // entire screen
// Find the templates
let match1 = region1.find("image 1");
let match2 = region2.find("image 2");
// Example: All Detections Success
if (match1 && match2) {
// Success: Both were found
} else {
// Fail: One or both were missing
}