MCP Commands - Screenshot Tools

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Screenshot Tools - Screen capture operations >

MCP Commands - Screenshot Tools

SHOT.GETQUADCENTER - Get Quadrant Center

PreviousTopNext


MiniRobot Language (MRL) - MCP Screenshot Tools Commands

 

MCP.ShotGetQuadCenter / SHOT.GETQUADCENTER

Get Quadrant Center Point

 

Purpose

 

The SHOT.GETQUADCENTER command calculates and returns the center coordinates (X, Y) of a specified screen quadrant. The screen is divided into a configurable grid (typically 3x3), and this command returns the center point of the requested quadrant, which is useful for targeting clicks or defining regions based on screen sections.

 

This command is particularly useful when:

• Targeting clicks to specific screen sections

• Dividing the screen into functional areas

• Creating relative positioning systems

• Implementing grid-based automation

• Converting quadrant notation to absolute coordinates

 

Syntax

 

SHOT.GETQUADCENTER|$$QUADRANT|$$X_VAR|$$Y_VAR

 

Parameters

 

$$QUADRANT - The quadrant identifier (1-9 in a 3x3 grid). Quadrants are numbered left-to-right, top-to-bottom: 1=top-left, 2=top-center, 3=top-right, 4=middle-left, 5=center, 6=middle-right, 7=bottom-left, 8=bottom-center, 9=bottom-right.

 

$$X_VAR - The variable that will receive the X coordinate of the quadrant center.

 

$$Y_VAR - The variable that will receive the Y coordinate of the quadrant center.

 

Quadrant Layout (3x3 Grid)

 

+---+---+---+

| 1 | 2 | 3 |

+---+---+---+

| 4 | 5 | 6 |

+---+---+---+

| 7 | 8 | 9 |

+---+---+---+

 

Return Values

 

The command populates the two provided variables with the absolute screen coordinates of the specified quadrant's center point:

X_VAR - Horizontal center coordinate of the quadrant

Y_VAR - Vertical center coordinate of the quadrant

 

Examples

 

' Example 1: Get center of screen (quadrant 5)

SHOT.GETQUADCENTER|5|$$CenterX|$$CenterY

PRT.Screen center is at: ($$CenterX, $$CenterY)

 

' Example 2: Click at center of top-right quadrant

SHOT.GETQUADCENTER|3|$$ClickX|$$ClickY

MOU.MOVE|$$ClickX|$$ClickY

MOU.CLICK|L

 

' Example 3: Iterate through all quadrants

VAR.Quadrant|1

LBL.QuadLoop

SHOT.GETQUADCENTER|$$Quadrant|$$QX|$$QY

PRT.Quadrant $$Quadrant center: ($$QX, $$QY)

MAT.$$Quadrant+1|$$Quadrant

IVV.$$Quadrant<10

JMP.QuadLoop

EIF.

 

Remarks

 

The SHOT.GETQUADCENTER command divides the screen into a 3x3 grid by default, creating 9 equal quadrants. The center point of each quadrant is calculated based on the current screen resolution. The coordinates returned are absolute screen coordinates suitable for use with mouse commands or other screen-based operations.

 

Quadrant 5 represents the exact center of the screen, which is often useful for centering dialogs or targeting the middle of the display area.

 

MCP.ShotGetQuadCenter and SHOT.GETQUADCENTER are aliases for the same command. You can use either form.

 

Error Conditions

 

The command will fail with an error if:

• The quadrant parameter is missing or invalid (not 1-9)

• Either return variable parameter is missing

• The ScreenshotTools feature is disabled in the server configuration

• Too many parameters are provided

 

See also:

 

SHOT.GETQUADRECT - Get Quadrant Rectangle

SHOT.SCREEN - Capture Screenshot

Screenshot Tools Overview