DIY mouse mover
Aug 8, 2023
Move your mouse with this simple script and never work again!
- Make sure you have python installed
2. First install pyautogui
pip install pyautogui
import pyautogui
import time
def move_mouse():
width, height = pyautogui.size()
x, y = pyautogui.position()
new_x = (x + 20) % width
new_y = (y + 20) % height
pyautogui.moveTo(new_x, new_y)
while True:
move_mouse()
time.sleep(10)
Save above script in any file like move.py
make sure to name it with .py
extension
3. Run the script when you want. Simply go into the folder you have the file in.
4. Type cmd hit enter
5. run the command
python move.py
# or name the filename that you gave
Now the mouse will move every 10 sec. You can put time in seconds in the time.sleep()
function according to you.