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.

def click_on_pat(pat: str, mousebutton: int=1, offset: (float, float)=None, tolerance: int=0, restore_pos: bool=False) -> None:
    """
    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.
    """
    x0, y0 = mouse_pos()
    move_to_pat(pat, offset, tolerance)
    mouse_click(mousebutton)
    if restore_pos:
        mouse_move(x0, y0)