Skip to content

Instantly share code, notes, and snippets.

@Rorythedev
Created September 21, 2024 14:40
Show Gist options
  • Save Rorythedev/c456dae80def03b22e37f27d806f406e to your computer and use it in GitHub Desktop.
Save Rorythedev/c456dae80def03b22e37f27d806f406e to your computer and use it in GitHub Desktop.
makes the game osu! slower! WARNING: this is in beta.
import psutil
import ctypes
import time
def find_osu_process():
for proc in psutil.process_iter(['name']):
if proc.info['name'] == 'osu!.exe':
return proc
return None
def slow_down_process(pid, slow_factor=0.5):
kernel32 = ctypes.windll.kernel32
handle = kernel32.OpenProcess(0x1F0FFF, False, pid)
if handle:
try:
while True:
kernel32.SuspendThread(handle)
time.sleep(slow_factor)
kernel32.ResumeThread(handle)
time.sleep(1 - slow_factor)
except KeyboardInterrupt:
print("Stopping the slowdown...")
finally:
kernel32.CloseHandle(handle)
else:
print(f"Failed to get handle for process {pid}")
def main():
osu_process = find_osu_process()
if osu_process:
print(f"Found osu! process with PID: {osu_process.pid}")
slow_down_process(osu_process.pid)
else:
print("osu! process not found. Make sure the game is running.")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment