I am working on a R6 Reputation bot. The basic idea is it will detect certain elements on the screen, click them, then move every so often once in game.
I have a dishonorable standing, and the idea is to just let this run over night to get the 100 games to reset my rep. Could someone who is more familiar with BE detection methods review my script?
Thanks,
Code:
import os
import time
import logging
import psutil
import pyautogui
import pydirectinput
from pynput import keyboard
# Configure logging
script_dir = os.path.dirname(os.path.abspath(__file__))
log_file = os.path.join(script_dir, 'siege_auto_log.txt')
logging.basicConfig(filename=log_file, level=logging.INFO, format='%(asctime)s - %(message)s')
# Path to the Assets folder
assets_path = os.path.join(script_dir, 'Assets')
# Global flag to control the automation loop
automation_active = False
def is_siege_running():
"""Check if Rainbow Six Siege is currently running."""
for process in psutil.process_iter(['name']):
if 'RainbowSix' in process.info['name']:
return True
return False
def locate_and_click(image_name, confidence=0.8):
"""Locate an image on the screen and click it if found."""
image_path = os.path.join(assets_path, image_name)
try:
button_location = pyautogui.locateOnScreen(image_path, confidence=confidence)
if button_location:
pyautogui.moveTo(pyautogui.center(button_location))
pyautogui.click()
logging.info(f"Clicked on '{image_name}'.")
return True
else:
logging.warning(f"'{image_name}' not found on screen.")
return False
except Exception as e:
logging.error(f"Error locating '{image_name}': {e}")
return False
def press_play_again():
"""Press the 'Play Again QUICK MATCH' button."""
logging.info("Attempting to press 'Play Again QUICK MATCH'.")
return locate_and_click('play_again_quickmatch.png')
def wait_for_match_found():
"""Wait until the 'Match Found' notification appears."""
logging.info("Waiting for 'Match Found' notification.")
while automation_active:
if locate_and_click('match_found.png'):
break
time.sleep(1)
def perform_in_game_actions():
"""Perform in-game actions: wait, move forward, wait, repeat."""
logging.info("Waiting 50 seconds before moving.")
time.sleep(50)
logging.info("Pressing and holding 'W' key for 5 seconds.")
pydirectinput.keyDown('w')
time.sleep(5)
pydirectinput.keyUp('w')
logging.info("'W' key released. Waiting 30 seconds before repeating actions.")
time.sleep(30)
def wait_for_play_again():
"""Wait until the 'play_again.png' button appears."""
logging.info("Waiting for 'Play Again' options.")
while automation_active:
if locate_and_click('play_again.png'):
break
time.sleep(1)
def on_capslock_toggle(key):
"""Toggle automation on or off when Caps Lock is pressed."""
global automation_active
if key == keyboard.Key.caps_lock:
automation_active = not automation_active
if automation_active:
logging.info("Caps Lock activated: Starting automation.")
else:
logging.info("Caps Lock deactivated: Stopping automation.")
return False # Stop listener
def main():
global automation_active
logging.info("Script started. Press Caps Lock to toggle automation.")
with keyboard.Listener(on_press=on_capslock_toggle) as listener:
while True:
if automation_active:
if is_siege_running():
logging.info("Rainbow Six Siege is running.")
if press_play_again():
wait_for_match_found()
perform_in_game_actions()
wait_for_play_again()
else:
logging.warning("Rainbow Six Siege is not running.")
time.sleep(5)
else:
time.sleep(1)
if not listener.running:
break
if __name__ == "__main__":
main()






