Spin mouse in one direction

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
math22
Newbie
Posts: 12
Joined: Sun Dec 03, 2017 1:00 am

Spin mouse in one direction

Post by math22 » Sun Dec 03, 2017 1:17 am

Searching in how to spin the mouse 360º i found this script from marcus:

viewtopic.php?f=3&t=4509#

Code: Select all

    //center position of ciorcle
    Let>cx=500
    Let>cy=500

    //start and end angles
    Let>angle1=0
    Let>angle2=2

    //radius of circle
    Let>radius=100

    Let>count=angle1
    Repeat>count
      Let>count=count+0.1
      Let>x2={round(%radius% * Sin(%count%) + %cx%)}
      Let>y2={round(%radius% * Cos(%count%) + %cy%)}
      MouseMove>x2,y2
      Wait>0.02
    Until>count=angle2
Not good in mathematic, need help editing that script to spin the mouse 360º
índice.png

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Spin mouse in one direction

Post by JRL » Sun Dec 03, 2017 4:24 am

Just change the value of angle2 from 2 to 6.3. The angles are expressed in radians. There are 2*pi radians in a full circle. 2*pi is about 6.3.

Code: Select all

//center position of ciorcle
    Let>cx=500
    Let>cy=500
    //start and end angles
    Let>angle1=0
    Let>angle2=6.3
    //radius of circle
    Let>radius=100
    Let>count=angle1
    Repeat>count
      Let>count=count+0.1
      Let>x2={round(%radius% * Sin(%count%) + %cx%)}
      Let>y2={round(%radius% * Cos(%count%) + %cy%)}
      MouseMove>x2,y2
      Wait>0.02
    Until>count=angle2

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts