O/S is Windows 10 and AutoHotKey version is 1.1.33.08
I have an odd problem I'm hoping that you all can help me with. I'm probably missing something obvious so extra eyes and experience are always welcome.
I have a simple script, it runs a loop and every so often moves the mouse. It's supposed to move the mouse 1 in each direction (unless at the limits of the screen) but it appears to be moving it randomly. I let it run and move 4 times and these are the results I get.
Code: Select all
Run Start Move1 Move2 Move3 Move4 Move 5
Screen 8486,96 11518,194 11518,388 11518,774 11518,1550 11518,2158
Window 7854,82 100886,180 10886,374 10886,760 10886,1536 10886,2144
Client 7841,-15 10873,83 10873,277 10873,663 10873,1439 1083,2047
Any hint as to where I'm going wrong would be appreciated.
Many thanks,
David
Code: Select all
^m::
intDirection=0
loop
{
CoordMode, Mouse, Screen ;Relative, Client, Window
MouseGetPos CurX, CurY
if intDirection=0
{
if CurX>=1
{
MouseMove ,CurX-1, CurY
}
}
if intDirection=1
{
if CurX<=1000
{
MouseMove ,CurX+1, CurY
}
}
if intDirection=2
{
if CurY>=1
{
MouseMove ,CurX, CurY-1
}
}
if intDirection=3
{
if CurY<=800
{
MouseMove ,CurX, CurY+1
}
}
intDirection:=intDirection+1
if intDirection=4
{
intDirection=0
}
Sleep (1 * 60 * 1000)
Send, {Ctrl}
Send, {Ctrl}
}