Jump to content

Using relative to move in circle?


Recommended Posts

This is probably going to sound confusing, but I was just thinkin about REG and mouse pos and stuff and I was wondering if you could manipulate them with autoit to make x + 1 or y + 1  (your original coords are (2,4) then to (3,5) after x + 1 or y + 2) and it turns out you could and i was really interested with it because upon just thinking about it i was wondering how one would go about moving the mouse in a circle... just increasing/decreasing x or y. I would figure this would be difficult, right?

Here is the function : 

Func _MouseMoveRelative ($iX, $iY)
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSpeed","REG_SZ",0)
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSensitivity","REG_SZ",10)
    Local Const $MOUSEEVENTF_MOVE = 0x01
    DllCall ("user32.dll", "int", "mouse_event", _
                                "int", $MOUSEEVENTF_MOVE, _
                                "int", $iX, _
                                "int", $iY, _
                                "int", 0, _
                                "int", 0)
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSpeed","REG_SZ",1)
RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSensitivity","REG_SZ",20)
EndFunc

I'm such a freak c:

Link to comment
Share on other sites

I dont see a question here. Are you asking how to make the mouse move in a circle where the total size of the circle gets bigger when x and y get bigger or do you want the circle to be the same size but move from the original position?

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

I dont see a question here. Are you asking how to make the mouse move in a circle where the total size of the circle gets bigger when x and y get bigger or do you want the circle to be the same size but move from the original positionarrow-10x10.png?

the lastarrow-10x10.png one I think.I mean like doing

 mousemoverelative(5,0) would move the mouse a bit to one side, how would I do like a script that does mousemoverelative(1,0) and (-1,0) and (0,1) and (0,-1) to make a circle?

Link to comment
Share on other sites

Here is an example of using the parametric equations of a circle.

; Parametric Equation of a Circle
;     x = r cos(t)    y = r sin(t)

HotKeySet("{ESC}", "Terminate")
Local $r = 20
Local $Pi = 4 * ATan(1)
Local $aMPos, $i = 0
While 1
$aMPos = MouseGetPos()
for $i =  0 to 5 * $Pi  step 0.1 ; "5 * $Pi" does 2.5 circles
    MouseMove($aMPos[0] + ($r * Cos($i)), $aMPos[1] + $r * Sin($i), 4)
next
sleep(1000)
WEnd


Func Terminate()
    Exit 0
EndFunc   ;==>Terminate
Link to comment
Share on other sites

This thread is slowly spiralling out of control. Here is a visual illustration.

 

HotKeySet("{ESC}", "quitter")

$xo = MouseGetPos(0)
$yo = MouseGetPos(1)
$radius = 0
$angle = 0

While True
    $radius += .5
    $angle += .1
    MouseMove($xo + Cos($angle) * $radius, $yo + Sin($angle) * $radius, 1)
    Sleep(10)
WEnd

Func quitter()
    Exit
EndFunc   ;==>quitter

Lol, had the same idea as Malkey I see :)

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Come on dude, just do some early high school math. You can do it.

/edit: You copypasted the function straight from >here (or something related), and now you want others to do math and coding for you. Two people generously show you the math including a working code example, and instead of working with that, you just say "not what I meant, sadface, now can I get the exact code instead?" Maybe that's what you meant by being a freak.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...