Script that moves my cursor in a circle
-
- Posts: 3
- Joined: 03 Dec 2019, 14:44
Script that moves my cursor in a circle
I needed a certain script. I've tried to fix it for a while. So here's what I need.
Every 3 seconds, it moves my cursor in a circle. Must be accurate without drift. I need it to type this every 300 seconds:
/play skyblock (enter) wait 10 seconds
/WARP island (wait 10 seconds)
[Mod edit: Topic name added.]
Every 3 seconds, it moves my cursor in a circle. Must be accurate without drift. I need it to type this every 300 seconds:
/play skyblock (enter) wait 10 seconds
/WARP island (wait 10 seconds)
[Mod edit: Topic name added.]
Re: Script that moves my cursor in a circle
uve tried to fix it. what is it?
moves my cursor in a circle
mice moving in circles
Re: Script that moves my cursor in a circle
Basically does what you want. Modify as needed:
Use AHK version 1.1.31 or later.
Code: Select all
#Persistent
SetTimer, MoveMouse, 3000
SetTimer, SendText, 300000
return
MoveMouse:
MoveMouseInCircle(200, 15)
return
SendText:
SendInput, /play skyblock{Enter}
Sleep, 10000
SendInput, /WARP island ; no Enter?
; don't see what waiting another 10 seconds here is supposed to accomplish. what follows it?
return
MoveMouseInCircle(r := 200, degInc := 5, start := "top", speed := 0)
{
static radPerDeg := 3.14159265359 / 180
MouseGetPos, cx, cy
Switch start
{
Case "top":
angle := 0
cy += r
Case "right":
angle := 90 * radPerDeg
cx -= r
Case "bottom":
angle := 180 * radPerDeg
cy -= r
Case "left":
angle := 270 * radPerDeg
cx += r
}
loop, % 360 / degInc
{
angle += degInc * radPerDeg
MouseMove, cx + r * Sin(angle), cy - r * Cos(angle)
Sleep, speed
}
}
Esc::ExitApp
-
- Posts: 3
- Joined: 03 Dec 2019, 14:44
Re: Script that moves my cursor in a circle
Thx ima test it out :
-
- Posts: 3
- Joined: 03 Dec 2019, 14:44
Re: Script that moves my cursor in a circle
Thanks it works. Anyway to make it run in the background?
And how do I turn ut off?
And how do I turn ut off?
Re: Script that moves my cursor in a circle
Not sure what you mean by running in the background. You won't be able to use the mouse at the same time it's moving it around. You might be able to have it send the text to a background window, but that doesn't work for all windows.
Hit the Escape key to exit the script.
Hit the Escape key to exit the script.
-
- Posts: 4
- Joined: 16 Oct 2022, 16:53
Re: Script that moves my cursor in a circle
Hey guys,
I was looking at this script, and it works like a charm, but is what needs to be changed in the hand so that the speed is increased and there is a specific Hotkey to trigger this script, Like F2 to start and F3 to stop, rather than closing the hand.
I'm newbie to AHK and still trying to learn the mechanics.
I appreciate any help you can provide. ^_^
I was looking at this script, and it works like a charm, but is what needs to be changed in the hand so that the speed is increased and there is a specific Hotkey to trigger this script, Like F2 to start and F3 to stop, rather than closing the hand.
I'm newbie to AHK and still trying to learn the mechanics.
I appreciate any help you can provide. ^_^
Re: Script that moves my cursor in a circle
Since the speed is already maximum, you could make it go faster by increasing the degree increment, which would make it less like a circle because it would have longer and flatter segments.
Starting it with a hotkey would be simple, but stopping it with a hotkey depends on what you would want to do after that. When it’s restarted, would it just complete the circle? Or would you want it to start over?
Starting it with a hotkey would be simple, but stopping it with a hotkey depends on what you would want to do after that. When it’s restarted, would it just complete the circle? Or would you want it to start over?
-
- Posts: 4
- Joined: 16 Oct 2022, 16:53
Re: Script that moves my cursor in a circle
boiler wrote: ↑03 Dec 2019, 17:17Basically does what you want. Modify as needed:Use AHK version 1.1.31 or later.Code: Select all
#Persistent SetTimer, MoveMouse, 3000 SetTimer, SendText, 300000 return MoveMouse: MoveMouseInCircle(200, 15) return SendText: SendInput, /play skyblock{Enter} Sleep, 10000 SendInput, /WARP island ; no Enter? ; I don't see what waiting another 10 seconds here is supposed to accomplish. what follows it? return MoveMouseInCircle(r := 200, degInc := 5, start := "top", speed := 0) { static radPerDeg := 3.14159265359 / 180 MouseGetPos, cx, cy Switch start { Case "top": angle := 0 cy += r Case "right": angle := 90 * radPerDeg cx -= r Case "bottom": angle := 180 * radPerDeg cy -= r Case "left": angle := 270 * radPerDeg cx += r } loop, % 360 / degInc { angle += degInc * radPerDeg MouseMove, cx + r * Sin(angle), cy - r * Cos(angle) Sleep, speed } } Esc::ExitApp
Hey guys
This script works like a charm, but is there any way we can trigger this script rather than just opening it for it to work? Like using F2 to start and F3 to Stop (replace it with ESC), cause it gives me an error when I add:: to the script for the commands. I appreciate any help you can provide.
-
- Posts: 4
- Joined: 16 Oct 2022, 16:53
Re: Script that moves my cursor in a circle
So for the script, I wanted it go a loop, just make circular rotations. Just need a Hostkey to push the script to start and stop like on wherever the pointer is at.boiler wrote: ↑16 Oct 2022, 18:41Since the speed is already maximum, you could make it go faster by increasing the degree increment, which would make it less like a circle because it would have longer and flatter segments.
Starting it with a hotkey would be simple, but stopping it with a hotkey depends on what you would want to do after that. When it’s restarted, would it just complete the circle? Or would you want it to start over?
I hope that makes sense
Re: Script that moves my cursor in a circle
You still haven't been very specific, but try this. Use the same key (F2) to start and stop.
Code: Select all
Pause
loop
MoveMouseInCircle(200, 20)
return
F2::Pause
Esc::ExitApp
MoveMouseInCircle(r := 200, degInc := 5, start := "top", speed := 0)
{
static radPerDeg := 3.14159265359 / 180
MouseGetPos, cx, cy
Switch start
{
Case "top":
angle := 0
cy += r
Case "right":
angle := 90 * radPerDeg
cx -= r
Case "bottom":
angle := 180 * radPerDeg
cy -= r
Case "left":
angle := 270 * radPerDeg
cx += r
}
loop, % 360 / degInc
{
angle += degInc * radPerDeg
MouseMove, cx + r * Sin(angle), cy - r * Cos(angle)
Sleep, speed
}
}
-
- Posts: 4
- Joined: 16 Oct 2022, 16:53
Re: Script that moves my cursor in a circle
Well, this is what I was looking for; I needed the script to use the mouse to move in a circle, and with a hotkey to make to start/pause, you helped it with the F2 key.
Sorry for not being able to share the correct details that you asked for.
Thank you so much.
Sorry for not being able to share the correct details that you asked for.
Thank you so much.
Re: Script that moves my cursor in a circle
how to change the spped mouse? i need it to movee fasterboiler wrote: ↑16 Oct 2022, 19:13You still haven't been very specific, but try this. Use the same key (F2) to start and stop.Code: Select all
Pause loop MoveMouseInCircle(200, 20) return F2::Pause Esc::ExitApp MoveMouseInCircle(r := 200, degInc := 5, start := "top", speed := 0) { static radPerDeg := 3.14159265359 / 180 MouseGetPos, cx, cy Switch start { Case "top": angle := 0 cy += r Case "right": angle := 90 * radPerDeg cx -= r Case "bottom": angle := 180 * radPerDeg cy -= r Case "left": angle := 270 * radPerDeg cx += r } loop, % 360 / degInc { angle += degInc * radPerDeg MouseMove, cx + r * Sin(angle), cy - r * Cos(angle) Sleep, speed } }
Re: Script that moves my cursor in a circle
Try changing the MouseMove line to this:
Code: Select all
MouseMove, cx + r * Sin(angle), cy - r * Cos(angle), 0
Re: Script that moves my cursor in a circle
@boiler Your last script causes the cursor to go towards the middle of the canvas, like this:
Can you change this?
Can you change this?
Re: Script that moves my cursor in a circle
Please show exactly what code you ran to get that result.
Re: Script that moves my cursor in a circle
I have a Windows 11, possibly MS paint behaves differently than other OSs:
Code: Select all
Pause
loop
MoveMouseInCircle(200, 20)
return
F2::Pause
Esc::ExitApp
MoveMouseInCircle(r := 200, degInc := 5, start := "top", speed := 0)
{
static radPerDeg := 3.14159265359 / 180
MouseGetPos, cx, cy
Switch start
{
Case "top":
angle := 0
cy += r
Case "right":
angle := 90 * radPerDeg
cx -= r
Case "bottom":
angle := 180 * radPerDeg
cy -= r
Case "left":
angle := 270 * radPerDeg
cx += r
}
loop, % 360 / degInc
{
angle += degInc * radPerDeg
MouseMove, cx + r * Sin(angle), cy - r * Cos(angle)
Sleep, speed
}
}
Re: Script that moves my cursor in a circle
That doesn’t make any sense to me because it is showing that straight segment coming off what would be the halfway point around the circle. Can you describe where your mouse pointer is when you press the hotkey, then the path it takes as it draws?
Re: Script that moves my cursor in a circle
I made an animated gif:
Re: Script that moves my cursor in a circle
It looks like for reasons unrelated to the script, your mouse pointer jumps to a totally different location at various times. Are you pausing the script and then unpausing it after having moved your mouse pointer to a new location and somehow expecting it to continue where it left off? Are you in any way manually moving the mouse pointer while the script is running? Are you touching anything at all once you started the script running? You must at least be holding the left mouse button down to get it to draw, so it seems you may be moving the mouse either inadvertently or on purpose while holding the mouse button down. Are you changing the active window while it is running?
If not the above scenario, do you have any other scripts or applications running that have anything to do with positioning the mouse? Are you using a laptop with a touch screen or touchpad? Does your mouse pointer ever move to another location of the screen at other times instead of slowly moving in a path to a new location? What is your mouse pointing device?
If not the above scenario, do you have any other scripts or applications running that have anything to do with positioning the mouse? Are you using a laptop with a touch screen or touchpad? Does your mouse pointer ever move to another location of the screen at other times instead of slowly moving in a path to a new location? What is your mouse pointing device?