import pyautogui as pg
import pydirectinput as pd
import time
ax,ay = pg.locateCenterOnScreen('firefox.PNG',confidence=.6)
def function_when_restart():
print(ax,ay)
pd.rightClick(ax,ay)
pd.leftClick(ax,ay)
print('Waiting to return back to the server...')
time.sleep(8)...