Prism.js Language Definition: mmm

Variable Usage in Mini Mouse Macro

Table of Contents
  1. Variable Usage in Mini Mouse Macro
    1. Introduction
    2. Variable Types
      1. String Variables
      2. Integer Variables
      3. Decimal Variables
      4. Boolean Variables
      5. Pixel Variables
    3. Internal Variables
      1. Date and Time Variables
      2. Mouse Variables
      3. System Variables
      4. FOR Loop Variables
      5. Environment Variables
    4. Using Variables in Conditions and Actions
      1. Example: Using a String Variable
      2. Example: Using an Integer Variable
    5. Best Practices

Introduction

Variables in Mini Mouse Macro allow for dynamic data storage and manipulation during macro execution. They enhance the flexibility and adaptability of macros by enabling real-time decision-making and value handling.


Variable Types

Mini Mouse Macro supports several variable types, each serving unique purposes:

String Variables

  • Definition: Stores textual data.
  • Usage: Used for dynamic text handling in actions and conditions.
  • Definition Example:

    1 | RUN ACTION | DEFINE STRING VARIABLE | %NAME%::John Doe
    

Integer Variables

  • Definition: Stores whole numbers.
  • Usage: Used for numerical calculations and conditions.
  • Definition Example:

    1 | RUN ACTION | DEFINE INTEGER VARIABLE | %COUNT%::10
    

Decimal Variables

  • Definition: Stores floating-point numbers.
  • Usage: Useful for precise numerical calculations.
  • Definition Example:

    1 | RUN ACTION | DEFINE DECIMAL VARIABLE | %BALANCE%::123.45
    

Boolean Variables

  • Definition: Stores TRUE or FALSE values.
  • Usage: Used for logical conditions and flow control.
  • Definition Example:

    1 | RUN ACTION | DEFINE BOOLEAN VARIABLE | %ISACTIVE%::TRUE
    

Pixel Variables

  • Definition: Captures bitmap data of pixel ranges.
  • Usage: Used for screen-based evaluations.
  • Definition Example:

    1 | RUN ACTION | DEFINE PIXEL RANGE VARIABLE | %PIXELS%::At Location [X=10, Y=20, W=100, H=100]
    

Internal Variables

Mini Mouse Macro provides predefined internal variables that can be used for dynamic content:

Date and Time Variables

  • %DATE%: Current date (e.g., 4/01/2025)
  • %TIME%: Current time (e.g., 5:30:06 AM)
  • %DATE_Y%, %DATE_YEAR%: Year (2025)
  • %DATE_M%, %DATE_MONTH%: Month (1 or January)
  • %DATE_D%, %DATE_DAY%: Day (4)
  • %TIME_H%: Hour (5)
  • %TIME_M%: Minute (30)
  • %TIME_S%: Second (6)

Mouse Variables

  • %MOUSE_X%: Current mouse X coordinate.
  • %MOUSE_Y%: Current mouse Y coordinate.

System Variables

  • %LASTLOG%: Last log message.
  • %RETURN%: Last returned value.

FOR Loop Variables

  • %I%: Current iteration count.
  • %LINE%: Current text line in a file loop.
  • %FILE%: Current file path in a file loop.
  • %FILE.NAME%: File name in a file loop.
  • %FILE.PATH%: File path in a file loop.

Environment Variables

  • %ENV_USERNAME%: Username of the current user.
  • %ENV_SYSTEMDRIVE%: System drive (e.g., C:).
  • %ENV_TEMP%: Path to the temporary folder.
  • %ENV_COMPUTERNAME%: Name of the computer.

Using Variables in Conditions and Actions

Example: Using a String Variable

1 | IF | STRING VARIABLE | %NAME% | IS | "John Doe" | MESSAGE PROMPT | Welcome, %NAME%!
  • This example checks if %NAME% equals John Doe and displays a personalized message.

Example: Using an Integer Variable

1 | IF | INTEGER VARIABLE | %COUNT% | GREATER THAN | 5 | MESSAGE PROMPT | Count is %COUNT%.
  • This example evaluates if %COUNT% is greater than 5 and displays its value.

Best Practices

  • Use descriptive names for clarity.
  • Avoid overwriting system variables unless necessary.
  • Test variable values in small macro segments for debugging.

⬆️ Back to Top



Table of contents