Skip to content

Instantly share code, notes, and snippets.

@VoidAny
Last active December 31, 2021 19:27
Show Gist options
  • Select an option

  • Save VoidAny/965a014367805350b65358383e60a8c7 to your computer and use it in GitHub Desktop.

Select an option

Save VoidAny/965a014367805350b65358383e60a8c7 to your computer and use it in GitHub Desktop.
This script just types "/mine" into a discord channel. I use it in a VM so that I can use my keyboard while it is running. Please run "pip install pynput" to install the depenencies.
import pynput
from pynput.keyboard import Key
from time import sleep
keyboard = pynput.keyboard.Controller()
def enter():
keyboard.press(Key.enter)
sleep(0.1)
keyboard.release(Key.enter)
while True:
keyboard.type("/mine")
enter()
sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment