POE 2 Python Combo menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    hellking298's Avatar Member CoreCoins Purchaser
    Reputation
    1
    Join Date
    Jul 2016
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    POE 2 Python Combo

    Change key order in combo_keys as you like.
    Adjust key delay according to cast time average

    Python is required.
    pip install all libraries below

    Tesseract is not required.I tried to add Screen OCR and auto life and mana but not working well so releated codes are commented out


    Code:
    import keyboard
    import time
    import cv2
    import pytesseract
    import pygetwindow as gw
    pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
    
    # Configuration: Keys in the combo and their delays (in milliseconds)
    combo_keys = ["q", "1", "e", "r", "t", "f"]
    key_delay = 0.7  # Delay in seconds (500ms)
    activation_key = "shift"  # Key to activate the combo
    pause_key = "7"  # Key to pause the combo
    resume_key = "8"  # Key to resume the combo
    life_key = "4"  # Key to press if Life is below threshold
    mana_key = "5"  # Key to press if Mana is below threshold
    
    # Threshold values
    life_threshold = 150
    mana_threshold = 150
    
    # State variables
    is_paused = False
    
    # Function to execute the combo
    def execute_combo():
        for key in combo_keys:
            keyboard.press_and_release(key)
            time.sleep(key_delay)
    
    # Function to ensure the game window is focused
    # def focus_game_window():
    #     game_window_name = "Path of Exile 2"
    #     for window in gw.getAllTitles():
    #         if game_window_name in window:
    #             gw.getWindowsWithTitle(window)[0].activate()
    #             return True
    #     print("Game window not found or not focused.")
    #     return False
    
    # Function to extract value from green rectangle using OCR
    def extract_value_from_image(image_path):
        # Load the image
        image = cv2.imread(image_path)
    
        # Convert the image to HSV for color detection
        hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
    
        # Define green color range
        green_lower = (40, 50, 50)
        green_upper = (90, 255, 255)
    
        # Create mask for green color
        green_mask = cv2.inRange(hsv, green_lower, green_upper)
    
        # Find contours for green rectangles
        contours, _ = cv2.findContours(green_mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
    
        # Assume the largest green contour is the box containing the value
        if contours:
            green_rect = max(contours, key=cv2.contourArea)
            x, y, w, h = cv2.boundingRect(green_rect)
    
            # Crop the green rectangle area
            cropped_image = image[y:y + h, x:x + w]
    
            # Convert to grayscale for OCR
            gray = cv2.cvtColor(cropped_image, cv2.COLOR_BGR2GRAY)
    
            # Perform OCR to extract text
            text = pytesseract.image_to_string(gray, config="--psm 7 digits")
    
            try:
                # Extract the first numeric value
                value = int(text.split('/')[0])
                return value
            except (ValueError, IndexError):
                print("Failed to extract value from OCR.")
                return None
        else:
            print("No green rectangle detected.")
            return None
    
    # Function to check Life threshold
    # def check_life():
    #     value = extract_value_from_image("Life.png")
    #     if value is not None and value < life_threshold:
    #         keyboard.press_and_release(life_key)
    #         print("Life is below threshold.")
    
    # Function to check Mana threshold
    # def check_mana():
    #     value = extract_value_from_image("Mana.png")
    #     if value is not None and value < mana_threshold:
    #         keyboard.press_and_release(mana_key)
    #         print("Mana is below threshold.")
    
    # Main loop
    print(f"Press '{activation_key}' to trigger the combo...")
    print(f"Press '{pause_key}' to pause and '{resume_key}' to resume...")
    try:
        while True:
            if keyboard.is_pressed(pause_key):
                is_paused = True
                print("Combo paused.")
                while keyboard.is_pressed(pause_key):
                    pass  # Wait until the pause key is released
    
            if keyboard.is_pressed(resume_key):
                is_paused = False
                print("Combo resumed.")
                while keyboard.is_pressed(resume_key):
                    pass  # Wait until the resume key is released
    
            if not is_paused:
                # if focus_game_window():
                if keyboard.is_pressed(activation_key):
                    execute_combo()
                    while keyboard.is_pressed(activation_key):
                        pass  # Wait until the activation key is released
    
                # Check Life and Mana from their respective images
                # check_life()
                # check_mana()
    
            time.sleep(0.1)  # Small delay to prevent excessive CPU usage
    
    except KeyboardInterrupt:
        print("\nMacro stopped.")

    POE 2 Python Combo
  2. #2
    Gonzaga_'s Avatar Member
    Reputation
    3
    Join Date
    Aug 2016
    Posts
    50
    Thanks G/R
    2/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would like to test it, but no idea how to run it.

  3. #3
    heromal's Avatar Member
    Reputation
    1
    Join Date
    May 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Gonzaga_ View Post
    would like to test it, but no idea how to run it.
    Google "how do I run a python program". Or ask chatgpt.

  4. #4
    hellking298's Avatar Member CoreCoins Purchaser
    Reputation
    1
    Join Date
    Jul 2016
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Python is required to install from source website : https://www.python.org/ftp/python/3....12.8-amd64.exe


    Well i will add .rar file with open source content. I added more features in it. Now it swaps weapon set before casting other spells.

    Extract the .rar into folder. Double click to runme.bat. You will see CMD screen so you will know its working.

    Basically in my build
    Weapon set 1 gives bonuses to Fire damage
    Weapon set 2 gives bonuses to Cold damage

    So swapping weapon set between casting spells maximizes the combo.

    I also added voices to increase clarity

    Z key changes combo route.


    keycombo.rar

  5. #5
    spdkllz's Avatar Member
    Reputation
    2
    Join Date
    Jul 2012
    Posts
    18
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hellking298 View Post
    Python is required to install from source website : https://www.python.org/ftp/python/3....12.8-amd64.exe


    Well i will add .rar file with open source content. I added more features in it. Now it swaps weapon set before casting other spells.

    Extract the .rar into folder. Double click to runme.bat. You will see CMD screen so you will know its working.

    Basically in my build
    Weapon set 1 gives bonuses to Fire damage
    Weapon set 2 gives bonuses to Cold damage

    So swapping weapon set between casting spells maximizes the combo.

    I also added voices to increase clarity

    Z key changes combo route.


    keycombo.rar
    You can assign a specific skill to use a specific weapon set and it will only use that weapon set for that skill, auto-switching. You dont need to manually switch. In the skill details, there are two checkboxes I and II, corresponding to weapon sets. If you uncheck one of the weapon set, skill will use the other set all the time, auto-switching.

  6. #6
    hellking298's Avatar Member CoreCoins Purchaser
    Reputation
    1
    Join Date
    Jul 2016
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What im using it for is passives not skills. I know i can do what you say.

Similar Threads

  1. POE mtx modding with python
    By Enneagram in forum Path of Exile
    Replies: 1
    Last Post: 12-09-2018, 06:42 PM
  2. Monthy Python reference
    By Marlo in forum World of Warcraft General
    Replies: 0
    Last Post: 04-22-2007, 01:43 PM
  3. Warroir Combo damage exploit
    By Snor11 in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 08-19-2006, 08:36 PM
  4. Keeping combo points after using SnD
    By Cloud in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 08-14-2006, 08:15 PM
All times are GMT -5. The time now is 04:41 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search