Multi Detection

Detect multiple images, texts and colors

How it works

Multi Detection is very similar to Single Detection.

On Success, On Fail, Loop settings are the same. The differences are how you construct the condition (multiple detections) and the action to take.

How to Create

Using the icon in Bottombar.

Condition
Condition

Condition is formed by multiple detections or Logical Group and they can be added from the Bottombar.

A detection inside a Multi Detection will have some options removed. Timeout, Scan Rate, Loop is no longer settable as this might cause one detection stuck if not set properly.

On Success, On Fail for individual detection still work but only Wait, Variable Set and Code block are available. Other actions might cause side effect (a click might change the screen) so they are removed.

A detection will have Wait till appear as the default action instead of Click best match though you can use whichever action you like. Use Wait till vanish as a negate (NOT) condition for Wait till appear.

Logical Group

Logical Group houses multiple detections and other Logical Group. In fact the Condition tab is actually just a Logical Group.

Logic
Logical Group Logic

You can set the Logic for each Logical Group. This will determine if the Group is Success or not. There are 6 Logic total:

  • All Detection Success: Success when all detections succeed. Fail when one detection fails.
  • One Detection Success: Success when one detection succeeds. Fail when all detections fail.
  • All Detection Fail: Success when all detections fail. Fail when one detection succeeds. This is the NOT logic of One Detection Success.
  • One Detection Fail: Success when one detection fails. Fail when all detections succeed. This is the NOT logic of All Detection Success.
  • Always Success: Always consider as success regardless of the detection's results. Should be used in All Detection Success so the detections inside this group doesn't affect the outcome of the outter group.
  • Always Fail: Always consider as failure regardless of the detection's results. Should be used in All Detection Fail so the detections inside this group doesn't affect the outcome of the outter group.

Note: For logic such as One Detection Success or One Detection Fail, you might want to know which detection succeed or fail. You can use Conditional to check for them in On Success or On Fail.

Complex Logic, Nested Logical Group

Logical Group can be nested inside another Logical Group. This allow you to combine logic to create a more complex logic

For example to create the logic "(Detection 1 or 2 succeeds) and (Detection 3 or 4 succeeds)".

You would have Detection 1 and 2 are inside a Logical Group with the logic One Detection Success, Detection 3 and 4 are also inside a another group with One Detection Success logic. These two groups would then be inside the outter most group with the logic All Detection Success.

Short-circuit

All logics are Short-circuit.

For example if we have 4 detections inside All Detection Success logic, the 2nd detection fails then detection 3 and 4 will be skipped and the group will be evaluated to fail.

You can choose to disable this behavior with Disable Short-circuit option. With the above example, detection 3 and 4 will run, the group will still be evaluated to fail regardless of their results.

Option
Timeout, Scan Rate

These are the same as Single Detection

Actions

6 actions are currently available:

  • Click All Success: Click on all detections that are succeeded.
  • Click First Success: Click on the first successful detection.
  • Click Last Success: Click on the last successful detection.
  • Swipe Detection: Swipe from each successful detections.
  • Swipe Detection Reverse: Same as above but in reverse order.
  • Nothing: Does nothing so you can implement your own actions in On Success or On Fail.
On Success, On Fail, Loop

These are the same as Single Detection

Code Equivalent

    //Create a Region
    var region1 = Region(x, y, w, h)
    var region2 = Region(x, y, w, h)

    //Find the template
    var match1 = region1.find("template name")
    var match2 = region2.find("template name")

    if (match1 and match2) {
        //Success    
    } else {
        //Fail
    }

© 2024 - Macrorify by KoK-CODE