Doporučili byste mi prosím bezpečný open source hýbač myší, nejlépe v portable verzi?
Případně poradili byste co opravit - uprasil jsem si podle příkladů z netu tenhle kus kódu, ale není spolehlivý...Několikrát jsem ho zkoušel, skript padá a komp se zamyká.
File "<ipython-input-1-af86fbd70ca6>", line 1, in <module>
runfile('C:/Python/mousemover.py', wdir='C:/Python')
File "c:\users\xxx\appdata\local\programs\python\python37\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "c:\users\xxx\appdata\local\programs\python\python37\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Python/mousemover.py", line 39, in <module>
moveit()
File "C:/Python/mousemover.py", line 34, in moveit
win32api.SetCursorPos((int(cx)+dx,int(cy)+dy))
error: (0, 'SetCursorPos', 'No error message is available')
import sys
import win32api
import math
import time
print("Start mouse move")
tx = input("Please enter number of seconds:\n")
tx =int(tx)
current = win32api.GetCursorPos()
cx = current[0]
cy = current[1]
print ("Moving every ", tx, " seconds")
print ("Press 'q' to quit")
def moveit():
current = win32api.GetCursorPos()
cx = current[0]
cy = current[1]
for i in range(360):
dx=int(math.sin(i)*10)
dy=int(math.cos(i)*10)
win32api.SetCursorPos((int(cx)+dx,int(cy)+dy))
while True:
moveit()
if win32api.GetAsyncKeyState(ord('Q')):
print ("Moving ended")
sys.exit()
time.sleep(tx)