Cursor + target coding help

Hello! I'm having issues with implementing a cursor controlled by variables:
1766877597437.png

hovering over a target (made by an image) and having it be triggered by pressing a button (ok)
I could have a still variable, but the issue is that this target is a moving one.
I was thinking that I would have to do something like this: (not exact)

If: Button [OK] is pressed
If: Cursor x = (Target x) & (Target x +788)
If: Cursor y = (Target y) & (Target y +78)
(target successfully hit)
1766877367523.png

( the Galv.Pic.anim script is to show animations on top of pictures)
However, It doesn't doesn't seem to work
If I can get some insight on how to process a moving target + past forums that would be helpful! thank you in advance
That ok press check has to be inside the same loop that checks for the arrow keys (also there has to be some mechanism to break the loop).

Also, shouldn't the coordinate checks be that bigger than the target start point and less than the target end point (and of course you need to update the target coordinates somewhere)? And your cursor pic origin is center, so you might need to modify the checks based on that.

Original thread: https://forums.rpgmakerweb.com/threads/cursor-target-coding-help.181640/