ChatGPT를 이용하여, 간단하게 특정위치에서 버튼을 5초마다 누르고, s키를 2초 후에 누르도록 스크립트를 짜도록 요청하였습니다. 잘 작동하네요.

#SingleInstance force

Gui, Add, Button, x50 y50 w100 h50 gRunButton, Run

Gui, Show, w200 h150, My GUI

global continueRunning := true ; Set a global variable to keep track of whether the script should continue running

RunButton:
SetTimer, ImageTimer, 5000 ; Set timer to trigger ImageTimer label every 5 seconds
return

ImageTimer:
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 C:\Path\To\Your\Image.png
if(ErrorLevel = 0) ; If the image is found
{
    MouseClick, left, %FoundX%, %FoundY% ; Click at the location of the image
}
if(!continueRunning) ; If continueRunning is false, exit the timer
{
    SetTimer, ImageTimer, Off
    return
}
return

Pause::
continueRunning := false ; Set the global variable to false to stop the script
return

GuiClose:
continueRunning := false ; Set the global variable to false to stop the script when the GUI window is closed
ExitApp ; Exit the script
return