Numeric Expressions

2.6 Numeric Expressions

Numeric expressions are supported since v1.3. The following rules apply:
English format of floating-point variables is expected, e.g. '1.25'.
Time variables like '5s' (five seconds) are not accepted except the cases where the time modifier is at the very end of the expression. Examples:

  • CORRECT:  Wait 5+5s
  • INCORRECT: Wait 5s+5s

Supported numeric operators are:

  • Parenthesis '(' and ')'
  • Plus '+'
  • Minus '-'
  • Unary minus '-' (negative numbers)
  • Multiplication '*'
  • Division '/'
  • Modulo division '%'
  • Power operator '^'

Numeric expressions are accepted anywhere in the language where a number is expected, e.g.

# Wait 1 hour - in milliseconds
Wait "1*60*60*1000" 

# Search for an image and then click onto it 10 points from its left upper corner
Compareto "pattern.png" method="search"
Mouse click to="x:{_SEARCH_X}+10,y:{_SEARCH_Y}+10"

To define a variable based on a numeric expression use the Eval command instead of the Var one, e.g. 'Eval HOUR_IN_MS=1*60*60*1000'.