Write script using pynput
This commit is contained in:
parent
d123352e89
commit
00d24222b1
25
proarbeit.py
25
proarbeit.py
|
@ -1 +1,24 @@
|
|||
from pynput.mouse import Listener
|
||||
from pynput.mouse import Controller
|
||||
from secrets import randbits
|
||||
from time import sleep
|
||||
|
||||
|
||||
def initialize_mouse():
|
||||
mouse = Controller()
|
||||
return mouse
|
||||
|
||||
|
||||
def erratic_movement(mouse):
|
||||
x, y = mouse.position
|
||||
mouse.move(x + randbits(2), y + randbits(2))
|
||||
sleep(randbits(2))
|
||||
|
||||
|
||||
def main():
|
||||
mouse = initialize_mouse()
|
||||
while True:
|
||||
erratic_movement(mouse)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue