Last active
November 26, 2021 04:11
-
-
Save karmatr0n/51805428dfbfd4b763bda07bad86ea74 to your computer and use it in GitHub Desktop.
mm
This file contains hidden or 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
do shell script " | |
/usr/bin/python <<END | |
import sys | |
import time | |
import random | |
from Quartz.CoreGraphics import * | |
def mouseEvent(type, x, y): | |
theEvent = CGEventCreateMouseEvent(None, type, (x,y), kCGMouseButtonLeft) | |
CGEventPost(kCGHIDEventTap, theEvent) | |
def mouseMove(x, y): | |
mouseEvent(kCGEventMouseMoved, x, y) | |
def mouseClick(x, y): | |
mouseEvent(kCGEventLeftMouseDown, x, y) | |
mouseEvent(kCGEventLeftMouseUp, x, y) | |
ourEvent = CGEventCreate(None) | |
currentpos = CGEventGetLocation(ourEvent) | |
while True: | |
r = random.randint(3, 10) | |
l = random.randint(0, 50) | |
x = random.randint(0, 100) | |
y = random.randint(0, 100) | |
for x in range(0, l): | |
mouseClick(x, y) | |
mouseMove(int(currentpos.x),int(currentpos.y)) | |
time.sleep(r) | |
END" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment