I wanted to make my trovian move left and right while planting seeds.
i am not good at ahk and this is the mess i came up with.
can anyone help fix this, at the moment it just go left. while clicking r.
thanks in advance


#Persistent
SetTimer, noafk, 200
SetTimer, noakk, 16505
return
noafk:
WinGet, winList, List, ahk_class SDL_app
Loop % winList
ControlSend,, {r},% "ahk_id " winList%a_index%
return

noakk:
WinGet, winList, List, ahk_class SDL_app
Loop % winList
ControlSend,, {A down},% "ahk_id " winList%a_index%
sleep 8000
ControlSend,, {A up},% "ahk_id " winList%a_index%
ControlSend,, {S down},% "ahk_id " winList%a_index%
sleep 500
ControlSend,, {S up},% "ahk_id " winList%a_index%
ControlSend,, {D down},% "ahk_id " winList%a_index%
sleep 8000
ControlSend,, {D up},% "ahk_id " winList%a_index%
return