Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

MouseMovement(consistent circles).


  • Please log in to reply
15 replies to this topic
boddie
  • Guests
  • Last active:
  • Joined: --
I have been researching for a way to perform perfect circles in the mouse movement by simply pressing "spacebar". I have only done moding of numbers in autohotkey scripts, never have I made a script from scratch. I have read documentation on mousemovement but am not getting any where understanding it. Any help of any kind is apreciated.

At the 1st position would be the center of the circle. Then proceed 45 degrees down and left(distance doesnt matter, but that distance shall be the radius of the circle). Then proceed with the circles in a counterclockwise pattern. Speed shall be consistent and nonstop for duration of the "spacebar" being pressed.

If someone takes this upon themselves to do a great deed for another, i would prefer to be able to see the script and be able to determine the number in the script that manages the speed, so i can tune it to my function.

Any help is greatly aprreciated. Thanks.

ManaUser
  • Members
  • 1121 posts
  • Last active: Dec 07 2016 04:24 PM
  • Joined: 24 May 2007
Well the first question is, how "perfect" do the circles need to be?

boddie
  • Guests
  • Last active:
  • Joined: --
Well, thanks for just responding. I really didnt mean for the post to come off that I was only looking for someone to make it for me. I was only hoping there was a generous person that could help. Ive been looking at all the examples of mouse movement and stuff but am not getting any where.

I guess as close to perfection will have to do. Anything will help, if i get a scipt that performs the circles, i am sure i can look at the script and learn how it works. Then I can tune it up. Me starting one is the problem. This will aid in helping me with my right thumb disability. Its for a game on xbox 360 that requires me to perform the circular functions on the right stick, but with my right thumb having little flexion, the cpu is getting the better of me. I have purchased a controller that allows me to use mouse and keyborad for FPS games thru a PC with mouse replacing the right stick. Its helps me play when normally I cant. Anyways, the mouse is hard to do these circles with so thats why I am here.

So my answer to your question would be " no they dont have to be perfect circles". I have already drawn out my grid to get the pixel count but the codes are kicking my butt.

LetsHateCheaters
  • Guests
  • Last active:
  • Joined: --
check [this] thread.

boddie
  • Guests
  • Last active:
  • Joined: --
Thanks hater,

I didnt understand alot of what was going on in the thread you listed but it link to this one:

http://www.autohotke...436.html#160436


Im not sure if Im reading the code right but it looks like I can use this one right? I know it doesnt have the 45 degree starting offcenter, but simple circles will work. I will have to change the script start to spacebar but its looking promising. Ill have to study the script a little more to undestand it. I hope this works to relieve my frustrations. After all the searching, i cant believe i didnt find this.

LetsHateCheaters
  • Guests
  • Last active:
  • Joined: --
I had a try with the one from engunneer (the others might work too). Simply start his script. Press F11 to define the starting position, and WheelUp/-Down to start to circle back/forth.

LetsHateCheaters
  • Guests
  • Last active:
  • Joined: --

Press F11 to define the starting position

Which starts to move around the circle at "6 o'clock" :!:

boddie
  • Guests
  • Last active:
  • Joined: --
I dont mean to badger you with questions. I not interpreting everything in the script. Now if I change the "wheel up" to "spacebar", that will make the spacebar the executtion button right? Will it continue with the circles for how ever long the button is pressed? Also, i dont see a speed variable where i can tweak the speed. I need this incredibly fast, but preferably changable, is there a speed variable in there?

Again im sorry for all the questions, i hate coming here and asking for alot with nuthing to offer cause im new to this.. Thanks.

boddie
  • Guests
  • Last active:
  • Joined: --
Nevermind the speed I see it, i didnt have it exapnd all the way to the top. Thanks.

boddie
  • Guests
  • Last active:
  • Joined: --
Ok, it all just clicked. I think that will suffice for the purpose I need it for. When I get off work I will run it.

Thank you guys. You know most places you go and ask for help with nuthing to offer, nobody will help you. This place is great. thanks.

VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006
$*Space:: ; press space, then move the mouse, then release space
MouseGetPos, baseX, baseY
Keywait, Space
Speed = 15 ; also effects the accuracy of the circle, be careful
Clockwise := true
SetDefaultMouseSpeed, 0
MouseGetPos, offsetX, offsetY
dx := offsetX - baseX
dy := (-offsetY + baseY) * (!Clockwise*2-1)
offsetR := (dx = 0) ? (0.25+(dy>0)/2) : (ATan(dy/dx)/6.2831853+(dx<0)/2+(dx>0 && dy<0))
SetBatchLines, -1
Loop, % slices := Ceil( (10/speed) * Dist := Sqrt(dx**2 + dy**2) )
	MouseMove, % BaseX + Dist * Cos(6.2831853*(A_Index / slices + offsetR))
	, % baseY - (!Clockwise*2-1) * Dist * Sin(6.2831853*(A_Index / slices + offsetR))
return
:?:

boddie
  • Guests
  • Last active:
  • Joined: --
Ill try that script too VX when i get home. You guys are great!

boddie
  • Guests
  • Last active:
  • Joined: --

$*Space:: ; press space, then move the mouse, then release space
MouseGetPos, baseX, baseY
Keywait, Space
Speed = 15 ; also effects the accuracy of the circle, be careful
Clockwise := true
SetDefaultMouseSpeed, 0
MouseGetPos, offsetX, offsetY
dx := offsetX - baseX
dy := (-offsetY + baseY) * (!Clockwise*2-1)
offsetR := (dx = 0) ? (0.25+(dy>0)/2) : (ATan(dy/dx)/6.2831853+(dx<0)/2+(dx>0 && dy<0))
SetBatchLines, -1
Loop, % slices := Ceil( (10/speed) * Dist := Sqrt(dx**2 + dy**2) )
	MouseMove, % BaseX + Dist * Cos(6.2831853*(A_Index / slices + offsetR))
	, % baseY - (!Clockwise*2-1) * Dist * Sin(6.2831853*(A_Index / slices + offsetR))
return
:?:



Is there anyways to change that to where I can just push "space" alone to do circles as opposed to push "space and move mouse" ?

I tried the script enguneer had in the link above but it is way to slow.

VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006
All you'd have to do is comment out the lines that fill the variables dx, dy, and OffsetR, then manually assign values to them.

The format for those variables should be as follows:
dx := 0
dy := YourRadius
OffsetR := Starting angle (in revolutions). For instance, a 45ยบ towards the lower right would be OffsetR := 7/8

boddie
  • Guests
  • Last active:
  • Joined: --
Ok, circles are great, but when I run the exe that i need to run it on, it doesnt work. Its a locked on top exe, so maybe thats why its accepting the input.