Skip to content

Instantly share code, notes, and snippets.

@conf8o
Last active September 13, 2021 09:33
Show Gist options
  • Save conf8o/ab17132e76ed9f2f23c9e91372f4b06a to your computer and use it in GitHub Desktop.
Save conf8o/ab17132e76ed9f2f23c9e91372f4b06a to your computer and use it in GitHub Desktop.
横移動入力
import pyautogui as auto
import time
import random
def hold(key: str, duration: float, natural: bool=True, sd: float=0.05):
duration += random.gauss(0, sd) if natural else 0
t = time.time()
while time.time() - t < duration:
auto.keyDown(key)
while True:
hold("d", 0.1)
hold("a", 0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment