Script that moves my cursor in a circle

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Script that moves my cursor in a circle

Post by LAPIII » 26 Mar 2023, 09:18

boiler wrote:
26 Mar 2023, 07:44
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?
I turned off all my other scripts and apps to eliminate interference with them. I am using a laptop with a touchpad, which is my pointing device, and the pointer has never acted erratically.

User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Script that moves my cursor in a circle

Post by boiler » 26 Mar 2023, 10:07

It’s not that it would be acting erratically. If you are touching the touchpad at all while it’s running, you would be moving the mouse from where it’s moving in circles.

You didn’t answer the questions about what you are doing while it’s running. After you start the script, are you just hitting the hotkey to un-pause it and holding down the left mouse button so it draws in MS Paint? Are you pausing and un-pausing the script? Since you must be holding the left mouse button down, is your hand possibly occasionally touching the touchpad?

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Script that moves my cursor in a circle

Post by LAPIII » 26 Mar 2023, 10:22

What I was doing after I start the script is, in MS paint, to un-pause and hold the left trackpad button down. I'm sure that I wasn't touching the touchpad. I used these hotkeys to help check for interference:

Code: Select all

1::DllCall("mouse_event", "UInt", 0x02) ; left mouse button down
2::DllCall("mouse_event", "UInt", 0x04) ; left mouse button up

User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Script that moves my cursor in a circle

Post by boiler » 26 Mar 2023, 10:39

Well, I can’t see how what is happening is a result of the function itself. To try to isolate it, just run your script without trying to draw anything in Paint. Just press the hotkey to unpause it and watch the mouse pointer move without touching your computer at all.

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Script that moves my cursor in a circle

Post by LAPIII » 26 Mar 2023, 10:46

It still moves to another area on the canvas to move in the circle. I was thinking testing in Virtualbox by making a Windows 10 virtual machine.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Script that moves my cursor in a circle

Post by swagfag » 26 Mar 2023, 10:58

LAPIII wrote:
26 Mar 2023, 10:22

Code: Select all

1::DllCall("mouse_event", "UInt", 0x02) ; left mouse button down
2::DllCall("mouse_event", "UInt", 0x04) ; left mouse button up
u wrote these dllcalls wrong, so any garbage thats left in memory nearby, gets passed as arguments to the function
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event

Trovecon
Posts: 1
Joined: 21 Aug 2023, 13:20

Re: Script that moves my cursor in a circle

Post by Trovecon » 21 Aug 2023, 13:24

To active click CTRL + 5 script is there:

Code: Select all

;Input my radius
InputBox, Radius, Radius, Input Radius
;Draw my circle
^5::
MouseGetPos, StartX, StartY
MouseMove, 0, %Radius%, 0, R
MouseClick, Left, , , , 0, D
Loop 64
{
	xVar := Radius*Sin(A_Index/10)
	yVar := Radius*Cos(A_Index/10)
	DrawX := StartX+xVar
	DrawY := StartY+yVar
	MouseMove, %DrawX%, %DrawY%,
	
}	
MouseClick, Left, , , , 0, U

Return

^`::Pause
^2::Reload
[Mod edit: [code][/code] tags added. Please use them yourself going forward.]

Post Reply

Return to “Ask for Help (v1)”