API Documentation
Learn how to use Opress automation functions
Quick Navigation
Basic Usage
Standard automation flow follows this pattern:
find(image)
click(pixel)
read(text)
assert(image)
Image Detection
Find images on screen with customizable parameters:
image(
needle_img: ImageOrPath,
confidence: float = 0.8,
wait_time: int = 10,
grayscale_search: bool = False
) -> Optional[Coordinate]
Parameters:
- needle_img: Path to image file or image data
- confidence: Match threshold (0.0 to 1.0)
- wait_time: Maximum wait time in seconds
- grayscale_search: Enable grayscale matching
Pixel Detection
Find specific pixels by color:
find(
input_value: Union[Callable, Tuple, List[Tuple], None],
assertion: bool = False
) -> bool
Parameters:
- input_value: RGB color tuple or function
- assertion: Raise error if not found
Mouse Interactions
Perform mouse clicks at specific coordinates:
click(
coordinates: Optional[Coordinates],
button: str = 'left',
clicks: int = 1,
slow: bool = False
) -> None
Parameters:
- coordinates: (x, y) tuple or list of coordinates
- button: Mouse button ('left', 'right', 'middle')
- clicks: Number of clicks
- slow: Enable slower click animation