From 7b8cd31cf3be1e832b56aa3f922494821e072d94 Mon Sep 17 00:00:00 2001 From: Bossiara13 <236771060+DmitryBykov-ISPO@users.noreply.github.com> Date: Wed, 22 Apr 2026 23:17:40 +0300 Subject: [PATCH] feat: add shell / url / keys action types to runtime dispatcher shell uses subprocess (with shell=True so user can write a normal command line); url uses webbrowser.open; keys uses pyautogui.hotkey for combinations or pyautogui.typewrite for raw text. pyautogui is imported lazily so the bot still starts on machines without a GUI. --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.py b/main.py index 7ecc082..2193db8 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ import struct import subprocess import sys import time +import webbrowser from ctypes import POINTER, cast import openai @@ -226,6 +227,20 @@ def run_action(action): _shutdown() elif t == 'sleep': time.sleep(action['ms'] / 1000) + elif t == 'shell': + if action.get('wait'): + subprocess.check_call(action['cmd'], shell=True) + else: + subprocess.Popen(action['cmd'], shell=True) + elif t == 'url': + webbrowser.open(action['href']) + elif t == 'keys': + import pyautogui + if action.get('sequence'): + keys = [k.strip() for k in action['sequence'].split('+') if k.strip()] + pyautogui.hotkey(*keys) + elif action.get('text'): + pyautogui.typewrite(action['text'], interval=0.02) elif t == 'multi': for step in action['steps']: run_action(step)