Skip to content

Pings

Needs the internal running and needs_internal = true in script_info. Without it both functions return nil.

internal.ping(target)  -> true | false | nil
internal.ping_all()    -> true | nil

Sends a real in-game map ping on an enemy. It is the same ping you would make yourself, so your teammates see it.

lua
script_info = {
    name           = "my_script",
    needs_internal = true,
}

internal.ping(target)

Pings one enemy.

ArgumentTypeWhat it is
targetplayer or integerA player object from get_players() or a callback, or a pawn entity index

Pass a player object whenever you have one. The integer form is for when you only have an entity row, such as row.index from entities.by_class("C_CitadelPlayerPawn").

Do not pass p:entity_ptr(). That is an ID, not an entity index.

ReturnsMeaning
truethe ping was queued
falseno target: nil, 0, or a player object that is no longer valid
nilthe script did not declare needs_internal = true
lua
local target = get_players()[1]
if target then internal.ping(target) end

internal.ping_all()

Pings every living enemy, up to 12. It ignores where you are looking and whether you can see them. It takes no arguments.

The pings go out 0.25 seconds apart rather than all at once.

Returns true when queued, nil without needs_internal.

lua
internal.ping_all()

Worth knowing

  • true means queued, not delivered. Check internal.is_loaded() first. If the internal is not running, nothing is sent.
  • Call these on a key press or an event, never every tick. Each call goes out straight away, so rate limit your own calls.
  • A new call replaces pending pings. Calling either function while ping_all is still sending cancels the rest of it.
  • Positions are live. Each ping uses the enemy's position at the moment it is sent, and dead enemies are skipped.
  • The menu toggle is not needed. Scripts work with Misc > Better Pings turned off. That toggle only controls the hotkey.

Examples

Ping the lowest-health visible enemy on a key press:

lua
script_info = { name = "ping_weakest", needs_internal = true }

local KEY = 0x56   -- V

function on_tick()
    if not internal.is_loaded() or not input.is_key_pressed(KEY) then return end

    local best
    for _, p in ipairs(get_players()) do
        if p:is_alive() and p:is_visible() then
            if not best or p:get_health() < best:get_health() then best = p end
        end
    end
    if best then internal.ping(best) end
end

Ping an enemy when they use their ultimate, at most once every three seconds:

lua
script_info = { name = "ult_pinger", needs_internal = true }

local last = -100

function on_ability_cast(player, info)
    if not player:is_enemy() or info.slot ~= 3 then return end
    if clock() - last < 3 then return end
    last = clock()
    internal.ping(player)
end

Ping every enemy on a key press:

lua
script_info = { name = "ping_all", needs_internal = true }

function on_tick()
    if internal.is_loaded() and input.is_key_pressed(0x42) then   -- B
        internal.ping_all()
    end
end