Skip to content

Orbwalker

Using Orbwalker SDK

WARNING

Before using the SDK you need to instantiate it using sdk_init::orbwalker() - example provided on this page

Modes

Below are all the modes that orbwalker uses:

cpp
bool sdk::orbwalker->combo()
bool sdk::orbwalker->harass()
bool sdk::orbwalker->clear()
bool sdk::orbwalker->lasthit()
bool sdk::orbwalker->flee()
bool sdk::orbwalker->freeze()
bool sdk::orbwalker->fast_clear()
bool sdk::orbwalker->combo()
bool sdk::orbwalker->harass()
bool sdk::orbwalker->clear()
bool sdk::orbwalker->lasthit()
bool sdk::orbwalker->flee()
bool sdk::orbwalker->freeze()
bool sdk::orbwalker->fast_clear()
Example
cpp
void __fastcall game_update()
{
	if ( sdk::orbwalker->combo() )
	{
		g_sdk->log_console( "In Orbwalker combo mode" );
	}
}
void __fastcall game_update()
{
	if ( sdk::orbwalker->combo() )
	{
		g_sdk->log_console( "In Orbwalker combo mode" );
	}
}

Spell Weaving

To do proper spell weaving you may use the function
bool sdk::orbwalker->can_spell( game_object* target, const float time = 0.f )

INFO

The target argument is required
The time is not but it's recommended to put the spell cast delay for perfect weaving

WARNING

Note that if your attack will come back faster than the spell cast delay, the spell will not be casted which may lead to a behaviour that you did not want If you are just trying to avoid cancelling auto attacks, take a look at how to avoid cancelling attacks

Example
cpp
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->can_spell( hovered_target, 0.25f ) )
	{
		g_sdk->log_console( "Can cast spell on hovered target" );
	}
}
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->can_spell( hovered_target, 0.25f ) )
	{
		g_sdk->log_console( "Can cast spell on hovered target" );
	}
}

Attack is Ready

To know if the attack will be ready (now or later) you may use the function
bool sdk::orbwalker->is_attack_ready_in( const float time )

INFO

The time argument is required, it takes the time in seconds - you can also pass 0.f if you want to know if the attack is ready now

Example
cpp
void __fastcall game_update()
{
	if ( sdk::orbwalker->is_attack_ready_in( 0.5f ) )
	{
		g_sdk->log_console( "Attack is ready or will be ready in 0.5 seconds" );
	}
}
void __fastcall game_update()
{
	if ( sdk::orbwalker->is_attack_ready_in( 0.5f ) )
	{
		g_sdk->log_console( "Attack is ready or will be ready in 0.5 seconds" );
	}
}

Avoid Cancelling Attacks

To avoid cancelling attacks you may use the function
bool sdk::orbwalker->would_cancel_attack()

Example
cpp
void __fastcall game_update()
{
	if ( sdk::orbwalker->would_cancel_attack() )
	{
		g_sdk->log_console( "Doing an action now will cancel the ongoing attack" );
	}
}
void __fastcall game_update()
{
	if ( sdk::orbwalker->would_cancel_attack() )
	{
		g_sdk->log_console( "Doing an action now will cancel the ongoing attack" );
	}
}

Getting the Attack Cast End Time

To get the attack cast end time you may use the function
float sdk::orbwalker->get_attack_cast_end_time()

INFO

The returned time is in seconds from the start of the game - like g_sdk->clock_facade->get_game_time()

Getting a Target in Attack Range

To get a target in attack range using the orbwalker you may use the function
game_object* sdk::orbwalker->get_target_in_attack_range()

WARNING

This function only return heroes target

Example
cpp
void __fastcall game_update()
{
    const auto target = sdk::orbwalker->get_target_in_attack_range();
	if ( target )
	{
		g_sdk->log_console( "The selected hero in attack range is: %s", target->get_char_name().c_str() );
	}
}
void __fastcall game_update()
{
    const auto target = sdk::orbwalker->get_target_in_attack_range();
	if ( target )
	{
		g_sdk->log_console( "The selected hero in attack range is: %s", target->get_char_name().c_str() );
	}
}

Is Target in Attack Range

To know if a target is in attack range you may use the function
bool sdk::orbwalker->is_in_auto_attack_range( game_object* source, game_object* target, float offset = 0.f )

INFO

The source and target arguments are required, source is often the player
The offset argument is optional, it will add the radius to the attack range

Example
cpp
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->is_in_auto_attack_range( g_sdk->object_manager->get_local_player(), hovered_target ) )
	{
		g_sdk->log_console( "The hovered target is in attack range" );
	}
}
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->is_in_auto_attack_range( g_sdk->object_manager->get_local_player(), hovered_target ) )
	{
		g_sdk->log_console( "The hovered target is in attack range" );
	}
}

Is Position in Attack Range

To know if a target is in the position's attack range you may use the function
bool sdk::orbwalker->is_in_auto_attack_range( game_object* source, const math::vector3& source_position, game_object* target, float offset = 0.f )

INFO

This is meant to be used for predictions purposes, example checking if using Caitlyn E towards target will bring you in attack range The source and target arguments are required, source is often the player
The offset argument is optional, it will add the radius to the attack range

Example
cpp
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->is_in_auto_attack_range( g_sdk->object_manager->get_local_player(), g_sdk->hud_manager->get_cursor_position(), hovered_target ) )
	{
		g_sdk->log_console( "The hovered target is in attack range" );
	}
}
void __fastcall game_update()
{
    const auto hovered_target = g_sdk->hud_manager->get_hovered_target();
	if ( hovered_target && sdk::orbwalker->is_in_auto_attack_range( g_sdk->object_manager->get_local_player(), g_sdk->hud_manager->get_cursor_position(), hovered_target ) )
	{
		g_sdk->log_console( "The hovered target is in attack range" );
	}
}

Is Target in Attack Range (Future)

To know if a target is in attack range at a specific position you may use the function
bool sdk::orbwalker->is_in_auto_attack_range( game_object* source, const math::vector3& source_position, game_object* target, float offset = 0.f );

INFO

The offset argument is optional, it will add the radius to the attack range

Spell Farming

To spell farm you may use the function
pred_sdk::pred_data sdk::orbwalker->spell_farm( pred_sdk::spell_data spell_data, const int aoe_hits_needed, const spell_farm_flag flags = spell_farm_flag::none, const dmg_sdk::damage_type damage_type = dmg_sdk::damage_type::physical )

INFO

The spell_data argument is a prediction spell data
The aoe_hits_needed argument is how many hits are needed to cast the spell (note: -1 will try to find the maximum amount of hits possible)
The flags argument takes a spell_farm_flag
The damage_type argument takes a damage_type is optional, defaults to physical damage

Return is pred_data

INFO

The following example showcases how to last hit objects with the desired spell while the player's attack is not ready

WARNING

The example is not compilable due to the lack of the q_pred_data variable, it is supposed to be a showcase on how to use it within your module

Example using Ezreal Q
cpp
void __fastcall game_update()
{
    // make sure we are in lasthit mode and we will not cancel an ongoing attack
    if ( sdk::orbwalker->lasthit() && !sdk::orbwalker->would_cancel_attack() )
    {
        const auto pred = sdk::orbwalker->spell_farm( q_pred_data, 1, static_cast< spell_farm_flag >( spell_farm_flag::lasthit | spell_farm_flag::when_attack_not_ready ), dmg_sdk::damage_type::physical );
        if ( pred.is_valid )
        {
            util::cast_spell( 0, pred.cast_position );
        }
    }
}
void __fastcall game_update()
{
    // make sure we are in lasthit mode and we will not cancel an ongoing attack
    if ( sdk::orbwalker->lasthit() && !sdk::orbwalker->would_cancel_attack() )
    {
        const auto pred = sdk::orbwalker->spell_farm( q_pred_data, 1, static_cast< spell_farm_flag >( spell_farm_flag::lasthit | spell_farm_flag::when_attack_not_ready ), dmg_sdk::damage_type::physical );
        if ( pred.is_valid )
        {
            util::cast_spell( 0, pred.cast_position );
        }
    }
}
cpp
enum spell_farm_flag: uint8_t
{
	none = 0,
	outside_of_attack_range = 1,
	lasthit = 2,
	when_attack_not_ready = 4,
};

enum class damage_type
{
    physical = 0,
    magical,
};
enum spell_farm_flag: uint8_t
{
	none = 0,
	outside_of_attack_range = 1,
	lasthit = 2,
	when_attack_not_ready = 4,
};

enum class damage_type
{
    physical = 0,
    magical,
};

Is Spell Farm Enabled

To know if spell farming is enabled by the player you may use the function
bool sdk::orbwalker->is_spell_farm_enabled()

NOTE

The function sdk::orbwalker->spell_farm already checks this variable internally

Example
cpp
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm is %s", sdk::orbwalker->is_spell_farm_enabled() ? "enabled" : "disabled" );
}
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm is %s", sdk::orbwalker->is_spell_farm_enabled() ? "enabled" : "disabled" );
}

Is Spell Farm Lasthit Enabled

To know if spell farming is enabled by the player you may use the function
bool sdk::orbwalker->is_spell_farm_lasthit_enabled()

NOTE

The function sdk::orbwalker->spell_farm already checks this variable internally

Example
cpp
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm lasthit is %s", sdk::orbwalker->is_spell_farm_lasthit_enabled() ? "enabled" : "disabled" );
}
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm lasthit is %s", sdk::orbwalker->is_spell_farm_lasthit_enabled() ? "enabled" : "disabled" );
}

Is Spell Farm Lasthit Enabled

To know if spell farming lasthit is enabled by the player you may use the function
bool sdk::orbwalker->is_spell_farm_lasthit_enabled()

Example
cpp
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm lasthit is %s", sdk::orbwalker->is_spell_farm_lasthit_enabled() ? "enabled" : "disabled" );
}
void __fastcall game_update()
{
    g_sdk->log_console( "Spell farm lasthit is %s", sdk::orbwalker->is_spell_farm_lasthit_enabled() ? "enabled" : "disabled" );
}

Getting Current Target

To get the current orbwalker target you may use the function
game_object* sdk::orbwalker->get_current_target()

Example
cpp
void __fastcall game_update()
{
    auto target = sdk::orbwalker->get_current_target();
    if( target )
        g_sdk->log_console( "Current target: %s", target->get_char_name().c_str() );
}
void __fastcall game_update()
{
    auto target = sdk::orbwalker->get_current_target();
    if( target )
        g_sdk->log_console( "Current target: %s", target->get_char_name().c_str() );
}

Forcing an Attack

To force an attack on an object you may use the function
bool sdk::orbwalker->attack( game_object* target )

DANGER

This may break kiting for one attack if used incorrectly

WARNING

The example is not compilable due to the lack of the util::get_hero_target and util::cast_spell functions (core utility), it is supposed to be a showcase on how to use it within your module

Example using Kog'Maw W

Once we casted Kog'Maw W client-side, the server will not instantly update our range but we are able to send an attack along side the spell cast in order to buffer it and makes us gain precious time instead of waiting for the range update before attacking

cpp
void __fastcall game_update()
{
    auto target = util::get_hero_target( player->get_server_position(), w_spell.pred_data.range );
    if ( !target )
        return;

    if ( sdk::orbwalker->would_cancel_attack() )
        return;

    if ( sdk::orbwalker->is_attack_ready_in( 0.f ) && util::cast_spell( w_spell.pred_data.spell_slot ) )
        sdk::orbwalker->attack( target );
}
void __fastcall game_update()
{
    auto target = util::get_hero_target( player->get_server_position(), w_spell.pred_data.range );
    if ( !target )
        return;

    if ( sdk::orbwalker->would_cancel_attack() )
        return;

    if ( sdk::orbwalker->is_attack_ready_in( 0.f ) && util::cast_spell( w_spell.pred_data.spell_slot ) )
        sdk::orbwalker->attack( target );
}

Orbwalker Event Registering

In order to register to an orbwalker event, sdk::orbwalker->register_callback must be called inside PluginLoad

Example:

cpp
bool before_attack( orb_sdk::event_data* data )
{
    if ( data.target )
        g_sdk->log_console( "Orbwalker will attack target: %s", data.target->get_char_name().c_str() );

    return true;
}

extern "C" __declspec( dllexport ) bool PluginLoad( core_sdk* sdk, void** custom_sdk )
{
    g_sdk = sdk;
    
    if ( !sdk_init::orbwalker() )
        return false;

    sdk::orbwalker->register_callback( orb_sdk::before_attack, reinterpret_cast< void* >( before_attack ) );

    g_sdk->log_console( "[+] ExampleModule loaded!" );

    return true;
}
bool before_attack( orb_sdk::event_data* data )
{
    if ( data.target )
        g_sdk->log_console( "Orbwalker will attack target: %s", data.target->get_char_name().c_str() );

    return true;
}

extern "C" __declspec( dllexport ) bool PluginLoad( core_sdk* sdk, void** custom_sdk )
{
    g_sdk = sdk;
    
    if ( !sdk_init::orbwalker() )
        return false;

    sdk::orbwalker->register_callback( orb_sdk::before_attack, reinterpret_cast< void* >( before_attack ) );

    g_sdk->log_console( "[+] ExampleModule loaded!" );

    return true;
}

Orbwalker Event Unregistering

In order to unregister from an orbwalker event, sdk::orbwalker->unregister_callback must be called inside PluginUnload

cpp
extern "C" __declspec( dllexport ) void PluginUnload()
{
    sdk::orbwalker->unregister_callback( orb_sdk::before_attack, reinterpret_cast< void* >( before_attack ) );

    g_sdk->log_console( "[-] ExampleModule unloaded!" );
}
extern "C" __declspec( dllexport ) void PluginUnload()
{
    sdk::orbwalker->unregister_callback( orb_sdk::before_attack, reinterpret_cast< void* >( before_attack ) );

    g_sdk->log_console( "[-] ExampleModule unloaded!" );
}

Orbwalker Events

cpp
enum event_type: uint8_t
{
	before_attack = 0,
	before_move,
};
enum event_type: uint8_t
{
	before_attack = 0,
	before_move,
};

INFO

The before_move event does not contain any target
The return value should be false if we want to block the attack/move

Both events are defined the same way:

cpp
class event_data
{
public:
	game_object* target{};
};
class event_data
{
public:
	game_object* target{};
};
cpp
bool before_attack( orb_sdk::event_data* data )
{
    if ( data.target )
        g_sdk->log_console( "Orbwalker will attack target: %s", data.target->get_char_name().c_str() );

    return true;
}

bool before_move( orb_sdk::event_data* data )
{
    g_sdk->log_console( "Orbwalker before move" );

    return true;
}
bool before_attack( orb_sdk::event_data* data )
{
    if ( data.target )
        g_sdk->log_console( "Orbwalker will attack target: %s", data.target->get_char_name().c_str() );

    return true;
}

bool before_move( orb_sdk::event_data* data )
{
    g_sdk->log_console( "Orbwalker before move" );

    return true;
}