# Roundly Mouse Move

## Recommended Posts

Hi, my name is Kevin and i need help from someone who is more advanced in autoit and math.

What i'm trying to do is to make mouse move from one point to another but not in stright line - I want to make "eclipse like" move from A to B.

Here is video of what exactly i'm trying to make:

I have a functional "Bot" that plays this in straight lines but i'm not good in math so i came here to ask for a little help.

Please don't get me wrong.. I'm NOT trying to make an automated Bot to play this game (!osu) to get advantage and abuse autoit language in to making hacks. I only want bot that dances like this and then mirror them in the video editing software so it would look like this: https://www.youtube.com/watch?v=vynUmJwSzn0 . I always loved "cursor dancing".

Here is code that moves mouse based on the locations of "notes" (Points where to click)

```func smoothmove(\$coords,\$j,\$firstms);make mouse move to the note
dim \$currcoord[3]
dim \$diff[3]
dim \$pixelsptms[3]
if \$j > 1 Then
if mod(\$coords[\$j-1][7][1],2) = 0 Then
\$currcoord[1] = \$coords[\$j-1][1][1]
\$currcoord[2] = \$coords[\$j-1][2][1]
Else
\$currcoord[1] = \$coords[\$j-1][1][\$coords[\$j-1][1][0]]
\$currcoord[2] = \$coords[\$j-1][2][\$coords[\$j-1][2][0]]
EndIf
Else
\$currcoord[1] = mousegetpos(0)
\$currcoord[2] = mousegetpos(1)
EndIf
if \$coords[\$j][1][1] = \$currcoord[1] then
if \$coords[\$j][2][1] = \$currcoord[2] then return 1
EndIf
if \$coords[\$j][3][1] <= \$firstms then return 1
\$diff[1] = \$coords[\$j][1][1] - \$currcoord[1]
\$diff[2] = \$coords[\$j][2][1] - \$currcoord[2]
\$pixelsptms[1] = (\$diff[1] / (\$coords[\$j][3][1]-\$firstms)) * 12
\$pixelsptms[2] = (\$diff[2] / (\$coords[\$j][3][1]-\$firstms)) * 12
\$firstms += 12
\$count = 0
while 1
DllCall(\$osumap[0], 'int', 'ReadProcessMemory', 'int', \$osumap[1], 'int', \$address[2], 'ptr', \$bufferptr, 'int', \$buffersize, 'int', '')
\$ms = DllStructGetData(\$buffer,1)
if \$ms >= \$coords[\$j][3][1] Then return 1
if \$pixelsptms[1] < 0 Then
if \$currcoord[1] <= \$coords[\$j][1][1] Then
\$currcoord[1] = \$coords[\$j][1][1]
\$pixelsptms[1] = 0
EndIf
Else
if \$currcoord[1] >= \$coords[\$j][1][1] Then
\$currcoord[1] = \$coords[\$j][1][1]
\$pixelsptms[1] = 0
EndIf
EndIf
if \$pixelsptms[2] < 0 then
if \$currcoord[2] <= \$coords[\$j][2][1] Then
\$currcoord[2] = \$coords[\$j][2][1]
\$pixelsptms[2] = 0
EndIf
Else
if \$currcoord[2] >= \$coords[\$j][2][1] Then
\$currcoord[2] = \$coords[\$j][2][1]
\$pixelsptms[2] = 0
EndIf
EndIf
if \$ms >= \$firstms Then
\$currcoord[1] += \$pixelsptms[1]
\$currcoord[2] += \$pixelsptms[2]
\$firstms += 12

mousemove(\$currcoord[1],\$currcoord[2],0)

EndIf
WEnd
EndFunc```

(This code isn't mine i downloaded it on some Russian site. Autor is unknown (i couldn't find him). Code was broken in many ways but i fixed it and got it working again)

##### Share on other sites

Razielex,

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation (regardless of the game) - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

##### Share on other sites
This topic is now closed to further replies.

×

• Wiki

• Back

• Git