How to track the present mouse position and set it to a pair of variables?

I want to make a unique encounter in my RPG, whether it be a troop encounter or just a simple event that runs mimicking one, where it's a game where you have to keep your mouse position steady in a spot for a period of time.
I've been searching for plugins or ways to code how to do this but haven't found anything that works. Closest I found was a thread from 2022 with a plugin of the sort but it doesn't work properly for some reason.
None of my other plugins relate to mouse positioning so I don't believe they're causing any issues with the plugin I tried using for this, so I'm honestly all out of ideas on how to do this.

Here are images of the events if need be
The bit of code in the second image is from me trying to see if the old plugin I tried needed to be in a script thing in the event itself. Didn't work either.
1736983307110.png
1736983316847.png

Side note, if there is also a way to make the player's mouse get flicked for increased difficulty in the game that would be nice to know. If not though I'll just have the circle move every now and then.
Also also yes this minigame is inspired by Pandemonium from the game Pressure my friend suggested it and I thought it'd be funny and cool to try.
a plugin of the sort but it doesn't work properly for some reason.
Rather than giving up on that, why don't you share the link and explain why it doesn't work so that maybe folks here can better help you troubleshoot that instead of coming up with something entirely from scratch.

iirc, there is a script call to track mouse pointer x&y. I could be wrong - it's not something I use - but feel free to do a search of MV/Z script call list for it:

That being said, you'd need a parallel event to constantly track mouse position, otherwise it just wouldn't make sense - obviously.
The problem is that parallel events don't run during combat. So, you can either find a plugin that allows for parallel events during combat, or you'd need to event an entirely new combat system that works on the maps.
The problem with running the parallel during combat, however, is that the is no way for the turn to determine the "mouse mini game" has been complete and therefore can end the turn.

f there is also a way to make the player's mouse get flicked for increased difficulty in the game that would be nice to know.
Directly addressing the HID would require a programmer to develop. I doubt something like this already exists. At 30 posts you are allowed to use the Classified's section of the forums where you can commission someone to program that for you. Considering the aforementioned problem with running the parallel during combat and the turn determining when the action is complete, I'd honestly say commissioning the plugin would be the best course of action for the least jank implementation. (Or learn programming yourself, that's always viable if not a bit slower)

But, if you are able to set variables to mouse XY, then you can use the same variables to set the coordinates of a picture. You can then fake the mouse by making the picture the "mouse" and add a resistive force to the XY variables (through the existing parallel event, constantly adding a value opposite of the target value), which in turn would change the position of the picture. The cursor's true position would not be affected by this however, so you'd actually want the event to track the position of the picture and not the cursor.
Rather than giving up on that, why don't you share the link and explain why it doesn't work so that maybe folks here can better help you troubleshoot that instead of coming up with something entirely from scratch.
Sure I can. I got the plugin from here.

The problem though is that I don't understand why it's not working... I put it in as a plugin and used the fix they stated for it to work in MZ but it still doesn't seem to track the mouse position even when I have a text box share the variable.
1737008425596.png

Also yes the variable in the text is different from the last image I accidentally put the wrong number last time but I tested it again and it still didn't work.
The problem is that parallel events don't run during combat. So, you can either find a plugin that allows for parallel events during combat, or you'd need to event an entirely new combat system that works on the maps.
The problem with running the parallel during combat, however, is that the is no way for the turn to determine the "mouse mini game" has been complete and therefore can end the turn.
If it doesn't work during combat then that's fine. I can also make it just work as an event outside of combat, which I did test, and it still didn't work for some reason...
Thanks for the link.
Eli actually is a really great programmer and has contributed a lot to the community, so I highly doubt that it's a matter of the code being wrong. @Eliaquim might be able to assist further.

As a note, even though we aren't necessarily trouble shooting an event, it's still good practice to not crop the whole event window. There is pertinent information contained across the entire event window that could pertain to your problem.

Go through the standard set of troubleshooting steps:
Is the plugin properly installed?
Is the plugin in your plugin manager and turned on?
Did you follow Eli's instructions and open the plugin to set the variables to write the x coordinate and y coordinate?
If so, are you sure you that the conditionals you set up are tracking the correct variables?
Is the event a parallel event?
Don't put leading zeroes in front of your variables. It makes Javascript parse the number as octal instead of decimal and any number above 8 becomes a different number
I actually just found out that was the issue. After looking at the original post a fourth time to look at the instructions I noticed the reply to Eliaquim didn't include zeroes! It works now. Thank you guys!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-track-the-present-mouse-position-and-set-it-to-a-pair-of-variables.174735/