Hello everyone,
I have been working on a mouse recorder which can be used inside OSBot.
It works fine, it repeats what I recorded, but it is ‘lagging’ when the mouse needs to move a lot of distance or just needs to move very fast circles (see .gifs below).
https://imgur.com/a/jfuEd5w - When I recorded the mouse movement (+/- 8 seconds)
https://imgur.com/a/B1mUOqf - When I played the recording of the mouse movement (+/- 15 seconds)
As you can see, when the recording gets played it takes almost double the time.
This is the core of the code from the mouse player which plays the data from following .txt file (see attachments, too many lines for forum I think)
//Plays the mouse data
/*
The mouseRecordingData is an arrayList which contains data from the txt file as where to move, etc.
*/
void playMouseData() throws InterruptedException{
for(int i = 0; i < mouseRecordingData.size(); i++){
//move mouse
getMouse().move(mouseRecordingData.get(i).getX(), mouseRecordingData.get(i).getY());
sleep(mouseRecordingData.get(i).getTime());
}
}
I am wondering, what can I do to improve the smoothness and speed of the mouse recording to stop this ‘lagging’?
If you need more files or data, please let me know.
Thank you in advance!
MacroFile.txt