|
<< 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 |
MiniRobot Language (MRL) - MCP Screenshot Tools Commands
MCP.ShotGetQuadRect / SHOT.GETQUADRECT
Get Quadrant Rectangle
Purpose
The SHOT.GETQUADRECT command returns the complete rectangle coordinates (X, Y, Width, Height) of a specified screen quadrant. Unlike SHOT.GETQUADCENTER which only returns the center point, this command provides the full bounds of the quadrant, making it ideal for capturing specific screen sections or defining regions for further processing.
This command is particularly useful when:
• Capturing screenshots of specific screen quadrants
• Defining regions for image processing
• Creating multi-zone automation workflows
• Implementing grid-based screen analysis
• Setting up monitoring regions
Syntax
SHOT.GETQUADRECT|$$QUADRANT|$$X_VAR|$$Y_VAR|$$W_VAR|$$H_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 (left edge) of the quadrant.
$$Y_VAR - The variable that will receive the Y coordinate (top edge) of the quadrant.
$$W_VAR - The variable that will receive the width of the quadrant in pixels.
$$H_VAR - The variable that will receive the height of the quadrant in pixels.
Quadrant Layout (3x3 Grid)
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| 4 | 5 | 6 |
+---+---+---+
| 7 | 8 | 9 |
+---+---+---+
Return Values
The command populates the four provided variables with the rectangle coordinates of the specified quadrant:
X_VAR - Left coordinate of the quadrant
Y_VAR - Top coordinate of the quadrant
W_VAR - Width of the quadrant in pixels
H_VAR - Height of the quadrant in pixels
Examples
' Example 1: Capture the center quadrant
SHOT.GETQUADRECT|5|$$CX|$$CY|$$CW|$$CH
SHOT.SCREEN|$$CX|$$CY|$$CW|$$CH|$$CenterImage
PRT.Center quadrant captured: $$CenterImage
' Example 2: Capture top row (quadrants 1, 2, and 3 combined)
' Get first quadrant (top-left)
SHOT.GETQUADRECT|1|$$X1|$$Y1|$$W1|$$H1
' Get third quadrant (top-right) for end position
SHOT.GETQUADRECT|3|$$X3|$$Y3|$$W3|$$H3
' Calculate combined top row rectangle
MAT.$$X3+$$W3-$$X1|$$TopRowWidth
SHOT.SCREEN|$$X1|$$Y1|$$TopRowWidth|$$H1|$$TopRowImage
' Example 3: Monitor specific quadrant for changes
' Get the bottom-right quadrant bounds
SHOT.GETQUADRECT|9|$$QX|$$QY|$$QW|$$QH
' Capture this region for monitoring
SHOT.SCREEN|$$QX|$$QY|$$QW|$$QH|$$MonitorArea
Remarks
The SHOT.GETQUADRECT command provides complete rectangle information for any of the 9 screen quadrants. The returned values can be used directly with SHOT.SCREEN to capture that specific quadrant, or for any other operation requiring screen region coordinates.
All quadrants in the 3x3 grid have equal dimensions, with each quadrant being one-third of the screen width and one-third of the screen height.
MCP.ShotGetQuadRect and SHOT.GETQUADRECT 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)
• Any of the four return variable parameters are missing
• The ScreenshotTools feature is disabled in the server configuration
• Too many parameters are provided
See also:
• SHOT.GETQUADCENTER - Get Quadrant Center
• SHOT.SCREEN - Capture Screenshot