Исходник Ragebot initialization

Участник
Статус
Оффлайн
Регистрация
6 Апр 2021
Сообщения
338
Реакции[?]
207
Поинты[?]
113K
Maybe this will help some guys to sort their ragebot issues out, i cant release the full rage code since it has priv stuff, but this


C++:
void ams::rage_t::run( user_cmd_t* cmd ) {
    // no rage enabled
    if ( !_cfg->bool_elem[ bool_features::ragebot ] )
        return;

    this->init( );

    // do not run if local is dead or invalid
    if ( game::local_controller == nullptr || game::local_pawn == nullptr )
        return;

    // do not run if local is dead.
    if ( game::local_pawn->get_health( ) <= 0 )
        return;

    [ & ]( /* target selection */ ) {
        ams::_game->cache_aimbot( this->m_target );
    }( );

    auto weapon = game::local_pawn->clipping_weapon( );
    if ( weapon == nullptr )
        return;

    auto weapon_data = weapon->get_weapon_data( );
    if ( weapon_data == nullptr )
        return;

    // do not run.
    // this crashes when targets = 0
    // lets return if we have no targets
    if ( this->m_target.empty( ) )
        return;

    // we still got to use this :/
    auto can_see = [ & ]( player_pawn_t* enemy, player_pawn_t* local ) -> bool {
        if ( !enemy || enemy->get_health( ) <= 0 )
            return false;

        trace_filter_t filter( 0x1C3003, local, 3 );

        game_trace_t trace = {};
        ray_t ray = {};

        auto start_eye = local->get_eye_pos( );
        auto end_eye = enemy->get_eye_pos( );

        ams::engine_trace->trace_shape( ray, &start_eye, &end_eye, filter, trace );
        return trace.m_fraction > 0.97f;
        };

    // we can go and target aimbot
    // get eye pos.
    auto local_pos = game::local_pawn->get_eye_pos( );

    // do not try if we cant shot
    if ( !this->can_shot( ) )
        return;

    if ( this->m_target.size( ) > 0 ) {
        for ( int i = 0; i < this->m_target.size( ); i++ ) {
            const auto& target = this->m_target[ i ];

            // main shit safety
            if ( ( target.controller != nullptr ) && ( target.pawn != nullptr ) ) {
                // exit point data.
                evo::vec3_t exit_point;
                evo::vec3_t exit_pos;

                // autowall.
                static float traced_damage{};
                ams::autowall::m_data = ams::autowall_data_t( this->is_tracing_player, this->trace_damage, traced_damage, game::local_pawn->clipping_weapon( )->get_weapon_data( ),
                                                              game::local_pawn, target.pawn );

                this->get_best_hitbox_point( target.pawn, exit_point, exit_pos );

                // store it
                this->targeted_point = exit_pos;

                // knifebot fix.
                auto dist_to_player = game::local_pawn->scene_node( )->get_vec_origin( ).dist_to( target.pawn->scene_node( )->get_vec_origin( ) ) / 90;
                if ( _cfg->bool_elem[ bool_features::knifebot ] && ( weapon_data->weapon_type( ) == ams::weapon_type_t::weapon_type_knife ) &&
                     dist_to_player > 1 ) {
                    // do not run with knife if we're to far from player
                    // might work
                    continue;
                } else if ( !_cfg->bool_elem[ bool_features::knifebot ] && ( weapon_data->weapon_type( ) == ams::weapon_type_t::weapon_type_knife ) ) {
                    // do not run.
                    continue;
                }

                // go for fire
                if ( ams::autowall::fire_bullet( local_pos, exit_pos ) ) {
                    auto hit = this->hitchance( exit_pos, target.pawn, weapon, weapon_data );
                    if ( !hit ) { // failed hitchance
                        // run this only if we have it enabled
                        if ( _cfg->bool_elem[ bool_features::autostoprage ] )
                            this->autostop_internal( cmd, target.pawn, weapon, weapon_data );
                    }

                    // minimum damage setup
                    // this is abit gheto, but we can work with it
                    bool overrider = ams::shared::active( keybind_features::damage_override );
                    static int damage{}; // update this on the way

                    // yeah, i could use tenary : overrider ? dmgover : damagenormal
                    // but as i want to hardcode this shit i wont
                    // or i will
                    // depends on how it is when u see this code
                    if ( !_cfg->bool_elem[ bool_features::force_visible_damage_global ] ) {
                        // since this shit overrider was done via tenary why not do it complete via tenary
                        damage = can_see( target.pawn, game::local_pawn ) ? ( overrider ? _cfg->int_elem[ int_features::rage_minimumdamage_override ] :
                                                                              _cfg->int_elem[ int_features::rage_minimumdamage ] ) :
                            ( overrider ? _cfg->int_elem[ int_features::rage_minimumdamage_override ] :
                              _cfg->int_elem[ int_features::rage_minimumdamage_wall ] );
                    } else {
                        damage = overrider ? _cfg->int_elem[ int_features::rage_minimumdamage_override ] :
                            _cfg->int_elem[ int_features::rage_minimumdamage ];
                    }

                    // gheto minimum damage
                    // since our is_tracing_player gets modified only while trace_data is valid
                    // we might want to do a little hoking around
                    if ( this->trace_damage < damage ) {
                        // we might use this for a flag later
                        this->ignored_by_damage = true;

                        // now continue till we have a valid damage
                        continue;
                    }

                    // set subtick
                    cmd->set_subtick_angle( exit_point );

                    static bool was_in_fire = false;
                    
                }
            }
        }
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
21 Июл 2022
Сообщения
10
Реакции[?]
4
Поинты[?]
4K
I dont see a reason to post this, everyone that already knows how to make a ragebot already knows how to initialize the ragebot, it really isnt that hard.
 
Начинающий
Статус
Оффлайн
Регистрация
13 Авг 2022
Сообщения
132
Реакции[?]
12
Поинты[?]
5K
dut do u have a internal source? I messed with your external but I'm not really a fan of externals
 
Сверху Снизу