Skip to content

Callbacks ​

The Callbacks module provides script registration functions and callback payload types exposed by the declarations.


Functions ​

RegisterScript(scriptDeclaration: ScriptDescription, scriptName: string)void ​

Registers a script with a given set of callbacks.

  • scriptDeclarationScriptDescription - An object where each key is the name of a callback and the value is the function to be called.
  • scriptNamestring - An optional name for the script. If provided, it will be used to group the callbacks.

UnregisterScript(scriptDeclaration: ScriptDescription)void ​

Unregisters a script with a given set of callbacks.

  • scriptDeclarationScriptDescription - An object where each key is the name of a callback and the value is the function to be called.

RegisterFunction(callbackName: string, fn: Function, scriptName?: string)void ​

Registers a function with a given callback name and an optional script name.

  • callbackNamestring - The name of the callback.
  • fnFunction - The function to be called.
  • scriptNamestring (optional) - An optional name for the script. If provided, it will be used to group the callbacks.

UnregisterFunction(callbackName: string, fn: Function)void ​

Unregisters a function with a given callback name.

  • callbackNamestring - The name of the callback.
  • fnFunction - The function to be unregistered.

Interfaces ​

KeyEventObject ​

The KeyEventObject interface describes the corresponding callback payload shape.


CreateClickEffectObject ​

The CreateClickEffectObject interface describes the corresponding callback payload shape.


PreparedOrder ​

The PreparedOrder interface describes the corresponding callback payload shape.

  • playerPlayer - The player.
  • orderEnum.UnitOrder - The order.
  • targetNPC | null - The target.
  • targetIndexNumber | null - The target index.
  • positionVector | null - The position.
  • abilityAbility | null - The ability.
  • abilityIndexNumber | null - The ability index.
  • orderIssuerEnum.PlayerOrderIssuer - The order issuer.
  • npcNPC | null - The npc.
  • npcIndexNumber | null - The npc index.
  • queueboolean - The queue.
  • showEffectsboolean - The show effects.

UnitAnimationCallbackObject ​

The UnitAnimationCallbackObject interface describes the corresponding callback payload shape.

  • unitNPC | null - The unit.
  • sequenceVariantnumber - Attack animation index 2
  • playbackRatenumber - Animation speed scales
  • castpointnumber - Time from start to the poke
  • typenumber - The type.
  • activitynumber - Dota 2 action variant
  • sequencenumber - Attack animation index
  • sequenceNamestring - Attack animation name

UnitAnimationEndCallbackObject ​

The UnitAnimationEndCallbackObject interface describes the corresponding callback payload shape.

  • unitNPC | null - The unit.
  • snapany - I don't fucking know

Projectile ​

The Projectile interface describes the corresponding callback payload shape.

  • sourceNPC | null - The source.
  • sourceIndexnumber - The source index.
  • targetNPC | null - The target.
  • targetIndexnumber - The target index.
  • abilityAbility | null - The ability.
  • abilityIndexnumber - The ability index.
  • moveSpeednumber - The move speed.
  • sourceAttachmentEnum.ParticleAttachment - The source attachment.
  • particleSystemHandlebigint - The particle system handle.
  • dodgeableboolean - The dodgeable.
  • isAttackboolean - The is attack.
  • isEvadedboolean - The is evaded.
  • expireTimenumber - The expire time.
  • maxImpactTimenumber - The max impact time.
  • colorGemColornumber - The color gem color.
  • fullNamestring - The full name.
  • namestring - The name.
  • handlenumber - The handle.
  • indexnumber - The index.

OnChatEventObject ​

The OnChatEventObject interface describes the corresponding callback payload shape.


OnSayMsgObject ​

The OnSayMsgObject interface describes the corresponding callback payload shape.

  • entityEntity - The entity.
  • chatboolean - The chat.
  • messageNamestring - The message name.
  • param1string - The param1.
  • param2string - The param2.
  • param3string - The param3.
  • param4string - The param4.

OnChatWriteObject ​

The OnChatWriteObject interface describes the corresponding callback payload shape.

  • channelTypenumber - The channel type.
  • messageTextstring - The message text.

OnChatMessageObject ​

The OnChatMessageObject interface describes the corresponding callback payload shape.

  • sourcePlayerIDnumber - The source player id.
  • channelTypenumber - The channel type.
  • messageTextstring - The message text.

UpdatedParticleForward ​

The UpdatedParticleForward interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • positionVector - The position.
  • controlPointnumber - The control point.

OnOverheadEventFallback ​

The OnOverheadEventFallback interface describes the corresponding callback payload shape.

  • typeEnum.OverheadAlert - The type.
  • valuenumber - The value.
  • targetIndexnumber - The target index.
  • targetNPC | null - The target.
  • sourcePlayerIndexnumber - The source player index.
  • targetPlayerIndexnumber - The target player index.

UpdatedParticleFallback ​

The UpdatedParticleFallback interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • positionVector - The position.
  • controlPointnumber - The control point.

UnitAddGestureObject ​

The UnitAddGestureObject interface describes the corresponding callback payload shape.

  • unitNPC | null - The unit.
  • unitIndexnumber - The unit index.
  • sequenceVariantnumber - The sequence variant.
  • playbackRatenumber - The playback rate.
  • fadeInnumber - The fade in.
  • fadeOutnumber - The fade out.
  • slotnumber - The slot.
  • activitynumber - The activity.
  • sequencenumber - The sequence.
  • sequenceNamestring - The sequence name.

OnProjectileLocObject ​

The OnProjectileLocObject interface describes the corresponding callback payload shape.

  • sourceNPC | null - The source.
  • sourceIndexnumber - The source index.
  • targetNPC | null - The target.
  • targetIndexnumber - The target index.
  • sourceLocVector - The source loc.
  • targetLocVector - The target loc.
  • moveSpeednumber - The move speed.
  • particleSystemHandlebigint - The particle system handle.
  • dodgeableboolean - The dodgeable.
  • isAttackboolean - The is attack.
  • expireTimenumber - The expire time.
  • colorGemColornumber - The color gem color.
  • launchTicknumber - The launch tick.
  • handlenumber - The handle.
  • fullNamestring - The full name.
  • namestring - The name.

CreatedParticle ​

The CreatedParticle interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • entityEntity | null - The entity.
  • entityIndexnumber - The entity index.
  • particleNameIndexbigint - The particle name index.
  • attachTypenumber - The attach type.
  • entityForModifiersEntity | null - The entity for modifiers.
  • entityForModifiersIndexnumber - The entity for modifiers index.
  • fullNamestring - The full name.
  • namestring - The name.

UpdatedParticle ​

The UpdatedParticle interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • positionVector - The position.
  • controlPointnumber - The control point.

ParticleUpdateEntity ​

The ParticleUpdateEntity interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • controlPointnumber - The control point.
  • entityNPC | Entity | Hero | null - The entity.
  • entityIndexnumber - The entity index.
  • attachTypenumber - The attach type.
  • attachmentEnum.ParticleAttachment - The attachment.
  • positionVector - The position.
  • includeWearablesboolean - The include wearables.

DestroyedParticle ​

The DestroyedParticle interface describes the corresponding callback payload shape.

  • indexnumber - The index.
  • destroyImmediatelyboolean - The destroy immediately.

CMsgVector ​

The CMsgVector interface describes the corresponding callback payload shape.

  • xnumber - The x.
  • ynumber - The y.
  • znumber - The z.
  • wnumber - The w.

CDOTAModifierBuffTableEntry ​

The CDOTAModifierBuffTableEntry interface describes the corresponding callback payload shape.

  • entry_typeDOTA_MODIFIER_ENTRY_TYPE - The entry type.
  • parentnumber - The parent.
  • indexnumber - The index.
  • serial_numnumber - The serial num.
  • modifier_classnumber - The modifier class.
  • ability_levelnumber - The ability level.
  • stack_countnumber - The stack count.
  • creation_timenumber - The creation time.
  • durationnumber - The duration.
  • casternumber - The caster.
  • abilitynumber - The ability.
  • armornumber - The armor.
  • fade_timenumber - The fade time.
  • subtleboolean - The subtle.
  • channel_timenumber - The channel time.
  • v_startCMsgVector | undefined - The v start.
  • v_endCMsgVector | undefined - The v end.
  • portal_loop_appearstring - The portal loop appear.
  • portal_loop_disappearstring - The portal loop disappear.
  • hero_loop_appearstring - The hero loop appear.
  • hero_loop_disappearstring - The hero loop disappear.
  • movement_speednumber - The movement speed.
  • auraboolean - The aura.
  • activitynumber - The activity.
  • damagenumber - The damage.
  • rangenumber - The range.
  • dd_modifier_indexnumber - The dd modifier index.
  • dd_ability_idnumber - The dd ability id.
  • illusion_labelstring - The illusion label.
  • activeboolean - The active.
  • player_idsstring - The player ids.
  • lua_namestring - The lua name.
  • attack_speednumber - The attack speed.
  • aura_ownernumber - The aura owner.
  • bonus_all_statsnumber - The bonus all stats.
  • bonus_healthnumber - The bonus health.
  • bonus_mananumber - The bonus mana.
  • custom_entitynumber - The custom entity.