proarbeit/proarbeit.py

27 lines
564 B
Python
Raw Normal View History

2020-07-28 22:30:55 +02:00
from mouse import move
2020-07-28 15:31:55 +02:00
from secrets import randbelow
2020-07-28 12:42:19 +02:00
from time import sleep
def erratic_movement(screen_width=800, screen_height=600):
2020-07-28 22:30:55 +02:00
"""
Moves the cursor to a random position with the screen's width and height as an upper bound
"""
2020-07-28 13:24:50 +02:00
move(
randbelow(screen_width),
randbelow(screen_height),
2020-07-28 13:24:50 +02:00
)
2020-07-28 12:42:19 +02:00
def main():
2020-07-28 22:30:55 +02:00
"""
Calls the movement function in an infinite loop, with a random delay between each call
"""
2020-07-28 12:42:19 +02:00
while True:
erratic_movement()
sleep(randbelow(90))
2020-07-28 12:42:19 +02:00
if __name__ == "__main__":
main()