def click_on_pat(pat: str, mousebutton: int=<NUM_LIT:1>, offset: (float, float)=None, tolerance: int=<NUM_LIT:0>, restore_pos: bool=False) -> None:
x0, y0 = mouse_pos()<EOL>move_to_pat(pat, offset, tolerance)<EOL>mouse_click(mousebutton)<EOL>if restore_pos:<EOL><INDENT>mouse_move(x0, y0)<EOL><DEDENT>
Requires imagemagick, xautomation, xwd.
Click on a pattern at a specified offset (x,y) in percent of the pattern dimension. x is the horizontal distance from the top left corner, y is the vertical distance from the top left corner. By default, the offset is (50,50), which means that the center of the pattern will be clicked at.
Exception PatternNotFound is raised when the pattern is not found on the screen.
:param pat: path of pattern image (PNG) to click on.
:param mousebutton: mouse button number used for the click
:param offset: offset from the top left point of the match. (float,float)
:param tolerance: An integer ≥ 0 to specify the level of tolerance for 'fuzzy' matches. If negative or not convertible to int, raises ValueError.
:param restore_pos: return to the initial mouse position after the click.