mgsweet / Apex-NoRecoil-2021

Scripts to reduce recoil for Apex Legends. (auto weapon detection, support multiple resolutions)
GNU General Public License v3.0
551 stars 156 forks source link

No longer working? #322

Closed RaphielHS closed 1 year ago

RaphielHS commented 1 year ago

I Tested on 1920x1080 and 1366x768 and it seems that it dosen't detect the pixels anymore, but when i tested the code for pulling it down it does it successfully, i even turned on Debug mode hoping that there's a sound saying a weapon name when equipped and/or reload(ed) and it didint send/say anything

Is it just me? Or anyone else having this problem

RaphielHS commented 1 year ago

It works a few hours ago though...

RaphielHS commented 1 year ago

I'm using: Logitech G502 Hero (Logitech G Hub 2023.5.418755) Windows 11 (Build 22624.1848)

Does any of those have a effect?

RaphielHS commented 1 year ago

UPDATE: I debugged the code with the "Say" Function, and it's stuck on "return" on the function "DetectAndSetWeapon" first else statement (I am using this one https://github.com/mgsweet/Apex-NoRecoil-2021/pull/307) and i'm pretty sure the Resolution one is bugged and/or not valid anymore

RaphielHS commented 1 year ago

UPDATE: Using this branch, i have the same result, but have i think pin-pointed the problem How did i debug it: Modify IsValidWeaponColor and DetectAndSetWeapon code to (tested on 1920x1080 resolution

IsValidWeaponColor(weapon_color)
{
    Say("IsValidWeaponColor is " + weapon_color == LIGHT_WEAPON_COLOR || weapon_color == HEAVY_WEAPON_COLOR || weapon_color == SNIPER_WEAPON_COLOR 
    || weapon_color == ENERGY_WEAPON_COLOR || weapon_color == SUPPY_DROP_COLOR || weapon_color == SHOTGUN_WEAPON_COLOR)
    return weapon_color == LIGHT_WEAPON_COLOR || weapon_color == HEAVY_WEAPON_COLOR || weapon_color == SNIPER_WEAPON_COLOR 
    || weapon_color == ENERGY_WEAPON_COLOR || weapon_color == SUPPY_DROP_COLOR || weapon_color == SHOTGUN_WEAPON_COLOR
}

DetectAndSetWeapon()
{
    Reset()

    if IsSella() {
        SetSella()
        return
    }

    is_single_mode := CheckSingleMode()

    ; first check which weapon is activate
    PixelGetColor, weapon1_color, WEAPON_1_PIXELS[1], WEAPON_1_PIXELS[2]
    PixelGetColor, weapon2_color, WEAPON_2_PIXELS[1], WEAPON_2_PIXELS[2]
    if (IsValidWeaponColor(weapon1_color)) {
        check_point_color := weapon1_color
        current_weapon_num := 1
    } else if (IsValidWeaponColor(weapon2_color)) {
        check_point_color := weapon2_color
        current_weapon_num := 2
    } else {
        Say("Return")
        return
    }

    ; then check the weapon type
    if (check_point_color == LIGHT_WEAPON_COLOR) {
        if (CheckWeapon(R301_PIXELS)) {
            Say("R301")
            current_weapon_type := R301_WEAPON_TYPE
            current_pattern := R301_PATTERN
        } else if (CheckWeapon(R99_PIXELS)) {
            Say("R99")
            current_weapon_type := R99_WEAPON_TYPE
            current_pattern := R99_PATTERN
            is_gold_optics_weapon := true
        } else if (CheckWeapon(P2020_PIXELS)) {
            current_weapon_type := P2020_WEAPON_TYPE
            current_pattern := P2020_PATTERN
            is_gold_optics_weapon := true
        } else if (CheckWeapon(RE45_PIXELS)) {
            current_weapon_type := RE45_WEAPON_TYPE
            current_pattern := RE45_PATTERN
            is_gold_optics_weapon := true
        } else if (CheckWeapon(ALTERNATOR_PIXELS)) {
            current_weapon_type := ALTERNATOR_WEAPON_TYPE
            current_pattern := ALTERNATOR_PATTERN
            is_gold_optics_weapon := true
        } else if (CheckWeapon(CAR_PIXELS)) { 
            current_weapon_type := CAR_WEAPON_TYPE 
            current_pattern := CAR_PATTERN 
            is_gold_optics_weapon := true
        } else if (CheckWeapon(G7_PIXELS)) {
            current_weapon_type := G7_WEAPON_TYPE
            current_pattern := G7_Pattern
        } else if (CheckWeapon(SPITFIRE_PIXELS)) {
            current_weapon_type := SPITFIRE_WEAPON_TYPE
            current_pattern := SPITFIRE_PATTERN 
        } else if (CheckWeapon(RE45_PIXELS)) {
            current_weapon_type := RE45_WEAPON_TYPE
            current_pattern := RE45_PATTERN
            is_gold_optics_weapon := true
        }
    } else if (check_point_color == HEAVY_WEAPON_COLOR) {
        if (CheckWeapon(FLATLINE_PIXELS)) {
            current_weapon_type := FLATLINE_WEAPON_TYPE
            current_pattern := FLATLINE_PATTERN
        } else if (CheckWeapon(PROWLER_PIXELS)) {
            current_weapon_type := PROWLER_WEAPON_TYPE
            current_pattern := PROWLER_PATTERN
        } else if (CheckWeapon(RAMPAGE_PIXELS)) {
            current_weapon_type := RAMPAGE_WEAPON_TYPE
            current_pattern := RAMPAGE_PATTERN
        } else if (CheckWeapon(CAR_PIXELS)) { 
            current_weapon_type := CAR_WEAPON_TYPE 
            current_pattern := CAR_PATTERN 
            is_gold_optics_weapon := true
        } else if (CheckWeapon(P3030_PIXELS)) {
            current_weapon_type := P3030_WEAPON_TYPE 
            current_pattern := P3030_PATTERN
        }
    } else if (check_point_color == ENERGY_WEAPON_COLOR) {
        if (CheckWeapon(VOLT_PIXELS)) {
            current_weapon_type := VOLT_WEAPON_TYPE
            current_pattern := VOLT_PATTERN
            is_gold_optics_weapon := true
        } else if (CheckWeapon(DEVOTION_PIXELS)) {
            current_weapon_type := DEVOTION_WEAPON_TYPE
            current_pattern := DEVOTION_PATTERN
            if (CheckTurbocharger(DEVOTION_TURBOCHARGER_PIXELS)) {
                current_pattern := TURBODEVOTION_PATTERN
                current_weapon_type := DEVOTION_TURBO_WEAPON_TYPE
            }
        } else if (CheckWeapon(HAVOC_PIXELS)) {
            current_weapon_type := HAVOC_WEAPON_TYPE
            current_pattern := HAVOC_PATTERN
            if (CheckTurbocharger(HAVOC_TURBOCHARGER_PIXELS)) {
                current_weapon_type := HAVOC_TURBO_WEAPON_TYPE
            }
        } else if (CheckWeapon(NEMESIS_PIXELS)) {
            current_weapon_type := NEMESIS_WEAPON_TYPE
            current_pattern := NEMESIS_PATTERN
            if (IsNemesisFullCharge()) {
                current_weapon_type := NEMESIS_CHARGED_WEAPON_TYPE
                current_pattern := NEMESIS_CHARGED_PATTERN
            }
        }
    } else if (check_point_color == SUPPY_DROP_COLOR) {
        if (CheckWeapon(HEMLOK_PIXELS)) {
            current_weapon_type := HEMLOK_WEAPON_TYPE
            current_pattern := HEMLOK_PATTERN
            if (is_single_mode) {
                current_weapon_type := HEMLOK_SINGLE_WEAPON_TYPE
                current_pattern := HEMLOK_SINGLE_PATTERN
            }
        } else if (CheckWeapon(LSTAR_PIXELS)) {
            current_weapon_type := LSTAR_WEAPON_TYPE
            current_pattern := LSTAR_PATTERN
        }
    } else if (check_point_color == SHOTGUN_WEAPON_COLOR) {
        is_gold_optics_weapon := true
        current_weapon_type := SHOTGUN_WEAPON_TYPE
    } else if (check_point_color == SNIPER_WEAPON_COLOR) {
        is_gold_optics_weapon := true
        if (CheckWeapon(WINGMAN_PIXELS)) {
            current_weapon_type := WINGMAN_WEAPON_TYPE
        } else {
            current_weapon_type := SNIPER_WEAPON_TYPE
        }
    }
    global debug
    if (debug) {
        %hint_method%(current_weapon_type)
    }
    Say(current_weapon_type)
}
RaphielHS commented 1 year ago

@mgsweet @Eternal-Walnut Mind looking into it? or it's just a me problem

hitch3ns commented 1 year ago

I'm using: Logitech G502 Hero (Logitech G Hub 2023.5.418755) Windows 11 (Build 22624.1848)

Does any of those have a effect?

did use any edit for force fullscreen ? sometimes it mix stuff up, also nividia filters

RaphielHS commented 1 year ago

I'm using: Logitech G502 Hero (Logitech G Hub 2023.5.418755) Windows 11 (Build 22624.1848) Does any of those have a effect?

did use any edit for force fullscreen ? sometimes it mix stuff up, also nividia filters

i think i used it (-forcefullscreen i believe) but i removed not long after i used it because it didn't do anything to me, my launch options are +fps_max 60 -dev +exec autoexec.cfg -high -forcenovsync

RaphielHS commented 1 year ago

fixed by removing -high (and? -forcenovsync)