You can't do this directly, but you can use a "Repeat" to chunk one big, quick, movement into lots of smaller ones. Control the speed by changing Local_granularity -- smaller is faster:
Okay, may I ask why? Is the point to emulate the human arm, perhaps to pass a captcha, or to avoid detection by an online game?
I've done this. As Nige says, you can use a little math to smooth the mouse motion. But there's a second way that uses less math (but not zero math.) You can simply record your own mouse movement, then "replay" that movement. All the "smooth, human and inaccurate" motion of your own hand will be replayed to the screen. All you have to do is scale the recorded motion to fit your simulated mouse motion. It's very easy, and when you see it in action, you will laugh like a giddy child who is getting on their first ride at Disneyland, especially when you place the macro in a loop that moves to random places on the screen. It just looks so human!
I have written such a macro, but it was over a year ago, and so I would need to rewrite it, because that's the way I roll. So I suggest that you take a stab at it today because I'm a little busy today.
Okay, I spent the afternoon today writing a set of macros that records and emulates human movement, and I will upload them in the next couple of minutes to the macros forum. They may be of use to you, but I'm sure they will be of use to others. Here it is...
The idea is,
I use it for a software with a slider. I want to adjust said slider. But with an auto movement with no easing. The program doesn’t register the mouse’s movement
In my previous windows system with AHK I simply used a smooth mouse movement. That moved the mouse up there almost instantly to the human eye but behind the scenes it moved smoothly. And the issue went away
The macro group that I uploaded is designed for moving a mouse without the mouse buttons being clicked while moving the mouse, so they won't be of any use to you (without modification.) In your original question you did not mention that you wanted the mouse button down while moving the mouse.
I can think of several easier solutions rather than modifying my macro.
Most sliders don't require clicking and dragging. If you just click anywhere in the slider, the slider will move to that position. This is especially important for you because it can be tricky to figure out where the slider is. Perhaps you should tell us which application you are using whose slider you want to adjust. It's difficult to give advice when we don't know what software you are using.
Another possible solution is to use the KM Move or Click Mouse action with its Drag option to drag the mouse. Like this:
Another possible solution is to use the KM Move or Click Mouse action with its Hold option to hold the mouse while you drag it with the KM Move or Click Mouse action. Like this:
The above action will click, hold, drag and release by moving the mouse to 100,100 and releasing it at 200,100. All you have to do is replace those numbers with your own values.
The software I’m doing it for is… so out of date. It’s not even a GUI slider. It’s a slider ontop of a number than only activates on clicking and dragging the number. If you just click it you enter a text box
The issue is if I move to it and start dragging with the program. It uses the mouse’s coordinates to move the number.
Theirfor. It still thinks. Until a smooth movement happens that the mouse hasn’t moved. Instantly setting the number to 0. As it perceives the mouse location as unchanged
I've thought the idea of creating something like this with keyboard maestro before. Instead of trying to use the native KM mouse movement tools, I would try to create something like the following:
Create a KM subroutine with parameters:
X coordinate
Y coordinate
HoldLeftMouseButton (true/false)
You execute this subroutine when you determine you would like to move the mouse / drag something
In the subroutine save the parameters to non-instance KM variables
Use Javascript or Applescript, perhaps with a tool like cliclick, as a basis for moving the mouse
Randomly determine a duration between a minimum and maximum value for when to pause before starting and after ending the action
Randomly determine a duration between a minimum and maximum value for how long the mouse movement would take
When producing an interpolation, randomly decide between one of the velocity curves (see this After Effects Plugin for reference) in which to use for the movement. Choose Between:
Quad In-Out
Cubic In-Out
Elastic In-Out
Sine In-Out
Expo In-Out
Execute an action within the script to interpolate the mouse position between the referenced X and Y position
Reference the HoldLeftMouseButton KM variable on whether or not you want the mouse held down during this action.
randomise the duration before beginning to hold left click
randomise the duration before releasing left click
Addtional ideas:
Add another parameter of 'MouseSpeed', define if this is 'slow' or 'standard'
Randomise the velocity curve interpolation values instead of using presets.
Have the script add 'temporary velocity modifiers' to the interpolation, randomly selecting parts of the velocity curve to add a spike of acceleration/deaccelration or deacceleration/acceleration. Add 0-1 temporary velocity modifiers for fast movements, and 1-3 for slow movements.
Have the script add 'temporary positional modifiers' to the positional movement, randomly adding an additional movement in a random direction which is then reversed before the conlusion of the total movement. Add 0-1 temporary positional modifiers for fast movements, and 1-3 for slow movements.
I can have a go at producing this if you're interested.
You can do anything you want, of course. But may I ask what the purpose is?
If it's just for fun, go ahead and do it. If it's to try to avoid bot detectors, I can already see multiple flaws. The first flaw is that there are no "random" mouse patterns that are indistinguishable from human mouse motion because human mouse motion is NOT random (even though you might think it is.) As a result, a random mouse pattern looks very different from a human mouse pattern, in specific and measureable ways.
Let me ask you this: if I asked someone to come up with 100 random digits, and I had any computer program generate 100 random digits, would you agree that it would be easy to tell which set of digits came from the human? I think you would agree, because humans are not capable of coming up with truly random digits. Humans have heavy biases. I know, because I've measured them.
And think about this: Facebook can get a likelihood of whether you are male or female just by looking at how you move the mouse, because men have longer arms than women on average, so when you move the mouse in an arc on the screen (and javascript can return that data to the FaceBook server), the size of the arc correlates to the length of the user's arm. FaceBook or Google can use the length of your arm to determine whether you get ads directed at males or females. Long arcs get you truck ads, short arcs get you perfume ads.
The macro group that I uploaded on the thread called "Moving the Mouse like a Human would" at least has a chance of fooling some bot-detectors, because it actually uses true human movement data to move the mouse from Point A to Point B. But even so, I can see at least three things in my macro that could be detectable by a good bot-detector. Notice that my macro is not called "Moving the Mouse Randomly" because that's not the right approach to avoid bot-detectors. It's not "randomness" that makes a macro look human, it's "humanness" that does that. If you want your code to evade bot-detectors, you have to use the correct approach.
There is a field of math called "Probability Distribution Functions" (PDF) which you may want to read up on. I can see several "random functions" in your list that would fail the human-test. Human behaviour adheres to a specific PDF, and none of the random functions you described mention that PDF. Any specific mouse or keyboard activity can be measured against known PDFs, and if it doesn't match the human one, it's definitely not a human behind the data.
You're right, regardless of how much noise or randomness you try to inject, there'll be a pattern that you can identify as generated by an algorithim, particularly if enough of your emulated mouse movements are recorded and analysed by the third party.
I suppose you would have to utlise a system that utilises data produced by a neural network if you didn't want to try and record many dozens of mouse movements like this: GitHub - DaiCapra/Natural-Mouse-Movements-Neural-Networks
That's essentially correct. But my main point wasn't distinguishing human data from an algorithm's data, it was distinguishing human data from random data.
In theory, it is possible to create an algorithm that's capable of mimicking the biology of a human's body, but it would require knowledge of how human bodies/arms/hands/wrists moved. The algorithm, even if it included some RNG, would have to emulate human behaviour.
A simple example to illustrate this would be if a macro's functionality resulted in the time between each of its keystrokes, or mouse movements to be exactly 0.1 seconds. That's easy for a server to detect as non-human behaviour. But some macro programmers who think they are smart will say, "That's easy to fix, I'll just insert a Pause action for a random period of time between 0.0 and 0.5 seconds between each action." But that's not good enough either, because the PDF of that would be a flat line, whereas the PDF of time between actions for a human being would take the shape of a normal distribution curve. So even a few seconds of data would be enough to identify the activity as robotic.