Script can also be used for mouse move animation if needed moving in a small square.
This script will demonstrate the square movement on Windows Paint.
Code: Select all
RunProgram>%SYS_DIR%\mspaint.exe
//Starting coordinates
Let>X_start=200
Let>Y_start=200
//Width of box/square to be drawn
Let>Width=100
Let>Height=500
//Amount of pixels moved per loop - will affect speed of mouse
Let>Xd=1
Let>Yd=1
Let>X_new=X_start
Let>Y_new=Y_start
Let>X_new=X_start
Let>Y_new=Y_start
//These control X & Y direction and also which Axe Y or X must be moved next
Let>X_moved=0
Let>Y_moved=0
Let>Y_direction=1
Let>X_direction=1
Let>XY=1
Wait>0.2
Let>z=0
While>z<1000
//Let>z=z+1
IF>{(%X_moved% > %Width%) OR (%X_moved% = %Width%)}
Let>XY=XY*-1
Let>X_moved=0
Let>X_direction=X_direction*-1
ENDIF
IF>{(%Y_moved% > %Height%) OR (%Y_moved% = %Height%)}
Let>XY=XY*-1
Let>Y_moved=0
Let>Y_direction=Y_direction*-1
ENDIF
IF>XY=1
Let>X_new={%X_new%+(%Xd%*%X_direction%)}
Let>X_moved=X_moved+Xd
ELSE
Let>Y_new={%Y_new%+(%Yd%*%Y_direction%)}
Let>Y_moved=Y_moved+Yd
ENDIF
//Added to demonstrate movement of mouse
SetFocus>Paint*
MouseMove>%X_new%,%Y_new%
LClick
//Will affect speed of mouse
Wait>0.001
//Stops mouse when square is done
IF>{(%X_new%=%X_start%) AND (%Y_new%=%Y_start%)}
EXIT>0
ENDIF
Endwhile