Jump to content

Help move mouse in circle?


Recommended Posts

I suggest that you brush up on some algebra before going to a VB forum. You've been given all the info you should need, you just need to do a little work to use it.

If you followed the Google link I gave you, you saw that:

360 degrees = 6.28318531 radians

Or

360 degrees = 6.2832 radians
----          --------
360          360

1 degree = 0.0174528 radians

So

$Rad = 0.0174528 * $R
BlueBearrOddly enough, this is what I do for fun.
Link to comment
Share on other sites

Done Thanks for everyone input :whistle:

Option Explicit
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_END = &H23
Private Const VK_HOME = &H24

Private Type POINTAPI
        x As Long
        y As Long
End Type

Dim a As POINTAPI
Dim b As Long
Dim c As Long
Dim Stp As Integer
Dim Size As Integer
Dim Pos
Dim x As Integer
Dim y As Integer
Dim r As Integer
Dim Rad As Integer
Dim xx As Integer
Dim yy As Integer

Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_HOME) = -32767 Then
If Timer2.Enabled = True Then
Timer2.Enabled = False
Else
Stp = 90
Size = 3
Pos = GetCursorPos(a)
x = a.x
y = a.y
Timer2.Enabled = True
End If
End If
End Sub

Private Sub Timer2_Timer()
For r = 360 To 0 Step -Stp
Rad = 0.0174528 * r
xx = Sin(Rad) * Size + x
yy = Cos(Rad) * Size + y
SetCursorPos xx, yy
DoEvents
Sleep (50)
Next
End Sub
Edited by X-sploiT
Link to comment
Share on other sites

  • 2 weeks later...

can the maker of this help me make the bot stop if a color pops up on the screen and clickmouse (doesnthave to b under the mouse)

HI,

make a new thread and give more details. Game, color, and so on. As much as possible.

Maybe even your script you tried.

Thanks!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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...