|
<< 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.ShotSetFallback / SHOT.SETFALLBACK
Set Fallback Mode for Screenshot Capture
Purpose
The SHOT.SETFALLBACK command configures the fallback behavior when the primary capture mode fails. This ensures robust screenshot capture by automatically attempting alternative methods when the preferred capture mode is unavailable or fails to produce a valid screenshot. This is particularly important for automated workflows where capture reliability is critical.
This command is particularly useful when:
• Ensuring reliable screenshots across different system configurations
• Working with variable display setups (docking/undocking, multiple monitors)
• Capturing from applications that may interfere with certain capture methods
• Building resilient automation workflows that cannot afford capture failures
• Testing capture methods to find the most reliable for a specific environment
Syntax
SHOT.SETFALLBACK|$$ENABLE|$$RETURN_VAR
Parameters
$$ENABLE - Enable or disable fallback mode: 0=Disabled, 1=Enabled. When enabled, if the primary capture method fails, the system will automatically try alternative capture methods.
$$RETURN_VAR - The variable that will receive the result (1 for success, 0 for failure).
Fallback Behavior
When Enabled (1):
If the primary capture method fails, the system automatically attempts fallback methods in a predefined order: DirectX → GDI → PrintWindow. This ensures maximum compatibility at the cost of potentially slower capture times when fallbacks are triggered.
When Disabled (0):
Only the currently configured capture mode is used. If it fails, the screenshot operation fails immediately without attempting alternatives. This provides faster failure detection but less reliability.
Return Value
1 - The fallback mode was successfully configured
0 - Failed to set the fallback mode (invalid parameter)
Examples
' Example 1: Enable fallback mode for reliability
SHOT.SETFALLBACK|1|$$Result
IVV.$$Result!0
PRT.Fallback mode enabled successfully
ELS.
PRT.Failed to enable fallback mode
EIF.
' Example 2: Configure reliable capture for critical workflow
' Enable fallback to ensure capture succeeds
SHOT.SETFALLBACK|1|$$FallbackSet
' Set preferred capture mode
SHOT.SETCAPTUREMODE|2|$$ModeSet
' Capture with fallback protection
SHOT.SCREEN|$$CriticalScreenshot
PRT.Captured: $$CriticalScreenshot
' Example 3: Disable fallback for performance testing
SHOT.SETFALLBACK|0|$$DisableResult
PRT.Fallback disabled - testing primary capture only
Remarks
The fallback mode setting persists for the duration of the MCP server session or until changed by another SHOT.SETFALLBACK command. By default, fallback mode is typically enabled to ensure maximum compatibility.
When fallback is enabled and triggered, the server may log information about which capture method ultimately succeeded. This can be useful for diagnosing capture issues and optimizing the primary capture mode selection.
MCP.ShotSetFallback and SHOT.SETFALLBACK are aliases for the same command. You can use either form.
Error Conditions
The command will fail with an error if:
• The enable parameter is missing or invalid (not 0 or 1)
• The return variable parameter is missing
• The ScreenshotTools feature is disabled in the server configuration
• Too many parameters are provided
See also:
• SHOT.SETCAPTUREMODE - Set Capture Mode
• SHOT.SETPARSEMODE - Set Parse Mode
• SHOT.SCREEN - Capture Screenshot