Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Automated-Mouse/automouse.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (13 sloc)
363 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui as pya | |
import numpy as np | |
pya.FAILSAFE = True | |
#find screen dimensions | |
x,y = pya.size() | |
while pya.FAILSAFE == True: | |
#determine a random point on the screen | |
xnew = np.random.randint(0,x) | |
ynew = np.random.randint(0,y) | |
#smoothly move the cursor to that point | |
pya.moveTo(xnew,ynew,duration=3,tween=pya.easeInOutQuad) | |
#pause | |
pya.PAUSE = 5 |