Skip to content

Instantly share code, notes, and snippets.

@sl5net
Created May 25, 2025 17:49
Show Gist options
  • Save sl5net/2b5b1f84a294abcaa895c77be0628afb to your computer and use it in GitHub Desktop.
Save sl5net/2b5b1f84a294abcaa895c77be0628afb to your computer and use it in GitHub Desktop.
Element-Spam AutoKey-Script(Python) automatisiert "Alle Einladungen ablehnen" & Cache-Reset (call other Python-Script)
import subprocess
import os
from pathlib import Path
import time
time.sleep(.1)
wT = 'Element'
window.activate(wT)
time.sleep(.2)
home_dir = str(Path.home())
project_path = os.path.join(home_dir, "projects", "oad-visual-test-automation")
python_path = os.path.join(project_path, "autogui_01_env", "bin", "python")
script_path = os.path.join(project_path, "0ad_clickButton.py")
# send spam report.. its brutal spam.. i very sad
for j in range(0):
button_name = "1"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(1)
button_name = "2"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(1)
button_name = "3"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
button_name = "3"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
button_name = "4"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
# deleta all and rebuild cash
for i in range(1):
keyboard.send_keys("<ctrl>+<np_divide>")
time.sleep(.2)
#button_name = "Sicherheit"
button_name = "Sicherheit"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(.2)
button_name = "Sicherheit_vectorText"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(.5)
for i in range(5):
time.sleep(.2)
keyboard.send_keys("<page_down>")
time.sleep(1)
button_name = "alleEinladungenAblehnen"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(.8)
button_name = "HilfeButton"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
button_name = "Versionen"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
time.sleep(.2)
for i in range(5):
time.sleep(.2)
keyboard.send_keys("<page_down>")
button_name = "ZwichenspeicherLoeschenUndNeuladen"
command = f'cd "{project_path}" && source autogui_01_env/bin/activate && "{python_path}" "{script_path}" "{button_name}"'
try:
subprocess.run(command, shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running the script: {e}")
keyboard.send_keys("<esc>")
# time.sleep(160) # slee 2 min
# exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment