Skip to content

Instantly share code, notes, and snippets.

@magentapenguin
Created December 3, 2024 22:15

Revisions

  1. magentapenguin created this gist Dec 3, 2024.
    22 changes: 22 additions & 0 deletions rngmouse.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    import mouse, random, keyboard

    RNG_X = 200
    RNG_Y = 200


    def stop():
    global running
    running = False
    raise KeyboardInterrupt



    keyboard.add_hotkey("ctrl+alt+\\", stop, suppress=True)
    running = True


    while running:
    x = random.randint(-RNG_X, RNG_X)
    y = random.randint(-RNG_Y, RNG_Y)
    mouse.move(x, y, False, 0.2)
    mouse.click()