CoordMode, Mouse, Client SetWorkingDir %A_ScriptDir% itemPointX := 1 itemPointY := 1 spellPointX := 1 spellPointY := 1 WinTitle := "HD-Player.exe" Tooltip, % "Press 2 to set points, 1 to start script, 3 to exit" return 1:: inputbox, loops, Times to run script loop, % loops { click_point(itemPointX, itemPointY, pid) Sleep, 1000 click_point(spellPointX, spellPointY, pid) Sleep, 2000 } return click_point(xx, yy, pid) { ControlClick, x%xx% y%yy%, % "ahk_id " pid,,,,NA } 2:: Tooltip, % "Right click item point" KeyWait, RButton, D WinGet, pid, ID, ahk_exe %WinTitle% MouseGetPos itemPointX, itemPointY KeyWait, RButton, U Tooltip, % "Right click spell point " pid KeyWait, RButton, D MouseGetPos spellPointX, spellPointY KeyWait, RButton, U Tooltip return 3:: ExitApp return