Skip to content

Instantly share code, notes, and snippets.

@FaltoGH
Created April 18, 2021 14:59
Show Gist options
  • Save FaltoGH/fbb74a770bf238df93ce7ec54e50537a to your computer and use it in GitHub Desktop.
Save FaltoGH/fbb74a770bf238df93ce7ec54e50537a to your computer and use it in GitHub Desktop.
Control the Minecraft Bukkit with Python!
import win32gui, win32con, time
server = win32gui.FindWindow(None, 'C:\\WINDOWS\\system32\\cmd.exe')
def command(x):
for y in x:
win32gui.PostMessage(server, win32con.WM_CHAR, ord(y), 0)
win32gui.PostMessage(server, win32con.WM_CHAR, 13, 0)
while True:
command('say Hello world!')
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment