Author Topic: move mouse in a circle/ parabola  (Read 1690 times)

nnik00

  • Guest
move mouse in a circle/ parabola
« on: November 05, 2018, 09:58:26 AM »
i was wondering if you could write a parabolic equation to move mouse in circle or parabola.

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: move mouse in a circle/ parabola
« Reply #1 on: November 05, 2018, 01:51:24 PM »
Definitely possible, you just have to figure out how to get VA to work out the math. Might be easier to implement the math via a C# inline function, and then simply pass the results (i.e., mouse coordinates) back to VA to execute the mouse moving. Or you could have the mouse movement handled directly through an inline function. This will help get you started on a circle.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: move mouse in a circle/ parabola
« Reply #2 on: November 05, 2018, 03:04:17 PM »
Do keep in mind that depending on the application, moving the cursor to absolute coordinates(which most examples seem to employ) will not work.

If the application only registers relative movement, you'll likely need to use mickeys instead, to specify the distance the cursor should move in a given direction.

You'll probably want to calculate the position of the points along the circle, then calculate the relative distance from one point to the next and move the cursor that amount.


If it doesn't have to be an actual circle, but just enough of one to make a game think you're moving the cursor that way, you could try something like this:
Code: [Select]
Set integer [distance] value to 50
Move mouse right [distance] relative mickey(s), down [distance] relative mickey(s) (from cursor position)
Move mouse down [distance] relative mickey(s) (from cursor position)
Move mouse left [distance] relative mickey(s), down [distance] relative mickey(s) (from cursor position)
Move mouse left [distance] relative mickey(s) (from cursor position)
Move mouse left [distance] relative mickey(s), up [distance] relative mickey(s) (from cursor position)
Move mouse up [distance] relative mickey(s) (from cursor position)
Move mouse right [distance] relative mickey(s), up [distance] relative mickey(s) (from cursor position)
Move mouse right [distance] relative mickey(s) (from cursor position)
which will trace a hexagon, clockwise from the initial cursor position.

You can use the "Animate movement" option to tweak the speed, if need be.