Detect multiple images, texts and colors
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.
Using the icon in Bottombar.
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 houses multiple detections and other Logical Group. In fact the Condition tab is actually just a Logical Group.
You can set the Logic for each Logical Group. This will determine if the Group is Success or not. There are 6 Logic total:
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.
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.
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.
These are the same as Single Detection
6 actions are currently available:
These are the same as Single Detection
//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