CDOTABaseAbility_BotScript

####

  • CanAbilityBeUpgraded( ) : bool
    • Can this Ability be upgraded?
  • CanBeDisassembled( ) : bool
    • Can this item be disassembled?
  • GetAOERadius( ) : int
    • Gets the AoE radius of this Ability.
  • GetAbilityDamage( ) : int
    • Get the basic damage value of this Ability.
  • GetAutoCastState( ) : bool
    • Get the autocast state of this Ability.
  • GetBehavior( ) : int
    • Get the behavior type of this Ability.
  • GetCastPoint( ) : float
    • Gets the cast point of this Ability.
  • GetCastRange( ) : int
    • Gets the cast range of this Ability.
  • GetCaster( ) : handle
    • Get the unit who owns this Ability.
  • GetChannelTime( ) : float
    • How long does this Ability channel?
  • GetChannelledManaCostPerSecond( ) : int
    • Get the mana cost per second of this Ability while channeling it.
  • GetCooldown( ) : float
    • Get the cooldown of this Abilty.
  • GetCooldownTimeRemaining( ) : float
    • Get the cooldown time remaning for this Ability.
  • GetCurrentCharges( ) : int
    • Get the current charges of this item.
  • GetDamageType( ) : int
    • Get the damage type of this Ability.
  • GetDuration( ) : float
    • How long does this Ability persist once cast?
  • GetEstimatedDamageToTarget( handle hTarget, float fDuration, int nDamageTypes ) : int
    • How much damage would this ability do to the specified target over the specified duration?
  • GetHeroLevelRequiredToUpgrade( ) : int
    • Get the Hero level required to upgrade this Ability.
  • GetInitialCharges( ) : int
    • Get the initial charges of this item.
  • GetLevel( ) : int
    • Get the current level of the Ability.
  • GetManaCost( ) : int
    • Get the mana cost of this Ability.
  • GetMaxLevel( ) : int
    • Get the max level of this Ability.
  • GetName( ) : cstring
    • Get the name of this Ability.
  • GetPowerTreadsStat( ) : int
    • Get the stat these power treads are set to.
  • GetSecondaryCharges( ) : int
    • Get the secondary charges of this item.
  • GetSpecialValueFloat( cstring pszKey ) : float
    • Get an int internal data parameter of this Abilty.
  • GetSpecialValueInt( cstring pszKey ) : int
    • Get an int internal data parameter of this Abilty.
  • GetTargetFlags( ) : int
    • Get the flags for this Ability.
  • GetTargetTeam( ) : int
    • Get the target team of this Ability.
  • GetTargetType( ) : int
    • Get the target type of this Ability.
  • GetToggleState( ) : bool
    • Get the toggle state of this Ability.
  • IsActivated( ) : bool
    • Is this Ability currently activated?
  • IsChanneling( ) : bool
    • Is this Ability being channelled?
  • IsCombineLocked( ) : bool
    • Is this item combine locked?
  • IsCooldownReady( ) : bool
    • Is this Ability off cooldown?
  • IsFullyCastable( ) : bool
    • Does the caster have the mana to use this Ability, and is it off cooldown?
  • IsHidden( ) : bool
    • Is this Ability currently hidden?
  • IsInAbilityPhase( ) : bool
    • Is this Ability being cast?
  • IsItem( ) : bool
    • Is this an Item?
  • IsOwnersManaEnough( ) : bool
    • Does the caster have the mana to use this Ability?
  • IsPassive( ) : bool
    • Is this a passive Ability?
  • IsStealable( ) : bool
    • Can this Ability be stolen?
  • IsStolen( ) : bool
    • Is this the stolen version of an Ability?
  • IsTalent( ) : bool
    • Is this a talent ability?
  • IsToggle( ) : bool
    • Is this a toggled Ability?
  • IsTrained( ) : bool
    • Is this Ability Trained at all?
  • IsUltimate( ) : bool
    • Is this an ultimate ability?
  • ProcsMagicStick( ) : bool
    • Does this Ability proc Magic Stick?
  • ToggleAutoCast( ) : void
    • Toggle the autocast state of this Ability.

CDOTA_Bot_Script

A unit referenced from Dota bot script

  • ActionImmediate_Buyback( ) : void
    • Tell a bot to buy back into the game.
  • ActionImmediate_Chat( cstring pszMessage, bool bAllChat ) : void
    • Tell a bot to say something.
  • ActionImmediate_Courier( handle hCourier, int eAction ) : bool
    • Tell a bot to use the courier.
  • ActionImmediate_DisassembleItem( handle hItem ) : void
    • Tell a bot to disassemble an item.
  • ActionImmediate_Glyph( ) : void
    • Tell a bot to use glyph.
  • ActionImmediate_LevelAbility( cstring pszAbilityName ) : void
    • Tell a bot to level up a specific ability.
  • ActionImmediate_Ping( float x, float y, bool bNormalPing ) : void
    • Tell a bot to ping a location.
  • ActionImmediate_PurchaseItem( cstring pszItemName ) :
    • Tell a bot to purchase an item by name.
  • ActionImmediate_SellItem( handle hItem ) : void
    • Tell a bot to sell an item.
  • ActionImmediate_SetItemCombineLock( handle hItem, bool bLocked ) : void
    • Set the combine state on an item.
  • ActionImmediate_SwapItems( int nSlot1, int nSlot2 ) : void
    • Tell a bot to swap the contents of two item slots.
  • ActionPush_AttackMove( vector location ) : void
    • Tell a bot to attack-move a location.
  • ActionPush_AttackUnit( handle hTarget, bool bOnce ) : void
    • Tell a bot to attack a target unit. If bOnce is specified, it will auto-pop the action after one attack.
  • ActionPush_Delay( float fDelay ) : void
    • Tell a bot to delay for the specified number of seconds.
  • ActionPush_DropItem( handle hItem, vector location ) : void
    • Tell a bot to drop an item.
  • ActionPush_MoveDirectly( vector location ) : void
    • Tell a bot to move to a location.
  • ActionPush_MovePath( handle hPathTable ) : void
    • Tell a bot to move along a specified path.
  • ActionPush_MoveToLocation( vector location ) : void
    • Tell a bot to bot-pathfind to a location.
  • ActionPush_MoveToUnit( handle hTarget ) : void
    • Tell a bot to move to a unit and start following them.
  • ActionPush_PickUpItem( handle hItem ) : void
    • Tell a bot to pick up a dropped item.
  • ActionPush_PickUpRune( int nRune ) : void
    • Tell a bot to pick up a rune.
  • ActionPush_UseAbility( handle hAbility ) : void
    • Tell a bot to use a non-targeted ability.
  • ActionPush_UseAbilityOnEntity( handle hAbility, handle hTarget ) : void
    • Tell a bot to use a unit-targeted ability.
  • ActionPush_UseAbilityOnLocation( handle hAbility, vector location ) : void
    • Tell a bot to use a location-targeted ability.
  • ActionPush_UseAbilityOnTree( handle hAbility, int iTree ) : void
    • Tell a bot to use a tree-targeted ability.
  • ActionPush_UseShrine( handle hShrine ) : void
    • Tell a bot to use the specified shrine.
  • ActionQueue_AttackMove( vector location ) : void
    • Tell a bot to attack-move a location.
  • ActionQueue_AttackUnit( handle hTarget, bool bOnce ) : void
    • Tell a bot to attack a target unit. If bOnce is specified, it will auto-pop the action after one attack.
  • ActionQueue_Delay( float fDelay ) : void
    • Tell a bot to delay for the specified number of seconds.
  • ActionQueue_DropItem( handle hItem, vector location ) : void
    • Tell a bot to drop an item.
  • ActionQueue_MoveDirectly( vector location ) : void
    • Tell a bot to move to a location.
  • ActionQueue_MovePath( handle hPathTable ) : void
    • Tell a bot to move along a specified path.
  • ActionQueue_MoveToLocation( vector location ) : void
    • Tell a bot to bot-pathfind to a location.
  • ActionQueue_MoveToUnit( handle hTarget ) : void
    • Tell a bot to move to a unit and start following them.
  • ActionQueue_PickUpItem( handle hItem ) : void
    • Tell a bot to pick up a dropped item.
  • ActionQueue_PickUpRune( int nRune ) : void
    • Tell a bot to pick up a rune.
  • ActionQueue_UseAbility( handle hAbility ) : void
    • Tell a bot to use a non-targeted ability.
  • ActionQueue_UseAbilityOnEntity( handle hAbility, handle hTarget ) : void
    • Tell a bot to use a unit-targeted ability.
  • ActionQueue_UseAbilityOnLocation( handle hAbility, vector location ) : void
    • Tell a bot to use a location-targeted ability.
  • ActionQueue_UseAbilityOnTree( handle hAbility, int iTree ) : void
    • Tell a bot to use a tree-targeted ability.
  • ActionQueue_UseShrine( handle hShrine ) : void
    • Tell a bot to use the specified shrine.
  • Action_AttackMove( vector location ) : void
    • Tell a bot to attack-move a location.
  • Action_AttackUnit( handle hTarget, bool bOnce ) : void
    • Tell a bot to attack a target unit. If bOnce is specified, it will auto-pop the action after one attack.
  • Action_ClearActions( bool bStop ) : void
    • Clear current action stack and return to idle. Optionally stop in place.
  • Action_Delay( float fDelay ) : void
    • Tell a bot to delay for the specified number of seconds.
  • Action_DropItem( handle hItem, vector location ) : void
    • Tell a bot to drop an item.
  • Action_MoveDirectly( vector location ) : void
    • Tell a bot to move to a location.
  • Action_MovePath( handle hPathTable ) : void
    • Tell a bot to move along a specified path.
  • Action_MoveToLocation( vector location ) : void
    • Tell a bot to bot-pathfind to a location.
  • Action_MoveToUnit( handle hTarget ) : void
    • Tell a bot to move to a unit and start following them.
  • Action_PickUpItem( handle hItem ) : void
    • Tell a bot to pick up a dropped item.
  • Action_PickUpRune( int nRune ) : void
    • Tell a bot to pick up a rune.
  • Action_UseAbility( handle hAbility ) : void
    • Tell a bot to use a non-targeted ability.
  • Action_UseAbilityOnEntity( handle hAbility, handle hTarget ) : void
    • Tell a bot to use a unit-targeted ability.
  • Action_UseAbilityOnLocation( handle hAbility, vector location ) : void
    • Tell a bot to use a location-targeted ability.
  • Action_UseAbilityOnTree( handle hAbility, int iTree ) : void
    • Tell a bot to use a tree-targeted ability.
  • Action_UseShrine( handle hShrine ) : void
    • Tell a bot to use the specified shrine.
  • CanBeSeen( ) : bool
    • Can we currently see this bot? Always true for bots on our team. Many functions will not return valid data without this being true.
  • DistanceFromFountain( ) : int
    • Gets the unit’s straight-line distance from the team’s fountain (0 is in the fountain).
  • DistanceFromSecretShop( ) : int
    • Gets the unit’s straight-line distance from the closest secret shop (0 is in a secret shop).
  • DistanceFromSideShop( ) : int
    • Gets the unit’s straight-line distance from the closest side shop (0 is in a side shop).
  • FindAoELocation( bool bEnemies, bool bHeroes, vector vBaseLocation, int nMaxDistanceFromBase, int nRadius, float fTimeInFuture, int nMaxHealth ) : variant
    • Finds optimal AoE location that overlaps heroes/creeps.
  • FindItemSlot( cstring pszItemName ) : int
    • Get the slot a named item is in
  • GetAbilityByName( cstring pszAbilityName ) : handle
    • Get a bot’s ability by name
  • GetAbilityInSlot( int iAbility ) : handle
    • Get a bot’s ability by slot
  • GetAbilityPoints( ) : int
    • Get the number of ability points the bot can spend.
  • GetAbilityTarget( ) : handle
    • Get the unit being targeted by an ability.
  • GetAcquisitionRange( ) : int
    • Get the range at which this unit will start to attack a target.
  • GetActiveMode( ) : int
    • Get the active mode ID
  • GetActiveModeDesire( ) : float
    • Get the desire value of the active mode
  • GetActualIncomingDamage( int nDamage, int eDamageType ) : int
    • Gets the incoming damage value after reductions.
  • GetAnimActivity( ) : int
    • Get the action the unit is currently performing.
  • GetAnimCycle( ) : float
    • Get the amount the unit is through its current animation.
  • GetArmor( ) : float
    • Gets the armor of the unit.
  • GetAssignedLane( ) : int
    • Get the lane that a unit is assigned to.
  • GetAttackCombatProficiency( handle hTarget ) : float
    • Gets the damage multiplier for attacks on the specified unit.
  • GetAttackDamage( ) : float
    • Gets the total attack damage.
  • GetAttackPoint( ) : float
    • Gets the attack point of the unit.
  • GetAttackProjectileSpeed( ) : int
    • Get the speed of the attack projectile for ranged units.
  • GetAttackRange( ) : int
    • Gets the attack range of the unit.
  • GetAttackSpeed( ) : float
    • Gets the attack speed of the unit.
  • GetAttackTarget( ) : handle
    • Get the unit being attacked.
  • GetAttributeValue( int nAttribute ) : int
    • Gets the evasion resist of the unit.
  • GetBaseDamage( ) : float
    • Gets the base attack damage of the unit.
  • GetBaseDamageVariance( ) : float
    • Gets the variance of the base attack damage.
  • GetBaseHealthRegen( ) : float
    • Get a bot’s base health regen rate.
  • GetBaseManaRegen( ) : float
    • Get a bot’s base mana regen rate.
  • GetBaseMovementSpeed( ) : int
    • Get a bot’s base movement speed.
  • GetBoundingRadius( ) : float
    • Get the size of the unit’s bounding radius.
  • GetBountyGoldMax( ) : int
    • Gets the maximum amount of gold rewarded by killing this unit.
  • GetBountyGoldMin( ) : int
    • Gets the minimum amount of gold rewarded by killing this unit.
  • GetBountyXP( ) : int
    • Gets the amount of XP rewarded by killing this unit.
  • GetBuybackCooldown( ) : float
    • Get the current cooldown on buying back.
  • GetBuybackCost( ) : int
    • Get the current cost of buying back.
  • GetCourierValue( ) : int
    • Get the value of items on the courier owned by this bot.
  • GetCurrentActionType( ) : int
    • Get the type of the current action.
  • GetCurrentActiveAbility( ) : handle
    • Get the ability this bot is currently casting.
  • GetCurrentMovementSpeed( ) : int
    • Get a bot’s current movement speed.
  • GetCurrentVisionRange( ) : int
    • Get the unit’s current vision range.
  • GetDayTimeVisionRange( ) : int
    • Get the unit’s vision range during the day.
  • GetDefendCombatProficiency( handle hAttacker ) : float
    • Gets the damage multiplier for attacks from the specified unit.
  • GetDenies( ) : int
    • Get the deny count of this bot.
  • GetDifficulty( ) : int
    • Get the bot’s difficulty settings.
  • GetEstimatedDamageToTarget( bool bCurrentlyAvailable, handle hTarget, float fDuration, int nDamageTypes ) : int
    • Get an estimate of how much damage a bot can do in the specified timeframe. Takes into account item and ability usage based on current mana/cooldowns for allies, for enemies it assumes all items/abilities are available. Uses no positional/situation info. Basically asks ‘How scary is X to Y?’.
  • GetEvasion( ) : float
    • Gets the evasion resist of the unit.
  • GetExtrapolatedLocation( float fDelay ) : vector
    • Extrapolates their location in the future, based on past movement.
  • GetFacing( ) : int
    • Get a bot’s facing (0-359).
  • GetGold( ) : int
    • Get the bot’s current gold.
  • GetGroundHeight( ) : int
    • Get a bot’s height value.
  • GetHealth( ) : int
    • Get a bot’s current health.
  • GetHealthRegen( ) : float
    • Get a bot’s health regen rate.
  • GetHealthRegenPerStr( ) : float
    • Get amount of health regen given per unit of strength.
  • GetIncomingTrackingProjectiles( ) : variant
    • Gets the location and ability of projectiles incoming at this unit.
  • GetItemInSlot( int nSlot ) : handle
    • Get a bot’s item by slot
  • GetItemSlotType( int nSlot ) : int
    • Get the type of the specified item slot
  • GetLastAttackTime( ) : float
    • Gets the last attack time of the unit.
  • GetLastHits( ) : int
    • Get the last hit count of this bot.
  • GetLevel( ) : int
    • Get the bot’s current level.
  • GetLocation( ) : vector
    • Geta bot’s 2D location.
  • GetMagicResist( ) : float
    • Gets the magic resist of the unit.
  • GetMana( ) : int
    • Get a bot’s current mana.
  • GetManaRegen( ) : float
    • Get a bot’s mana regen rate.
  • GetManaRegenPerInt( ) : float
    • Get amount of mana regen given per unit of intellect.
  • GetMaxHealth( ) : int
    • Get a bot’s maximum health.
  • GetMaxMana( ) : int
    • Get a bot’s maximum mana.
  • GetModifierAuxiliaryUnits( int nModifier ) : variant
    • Get a table of a modifier’s auxiliary units.
  • GetModifierByName( cstring pszModifierName ) : int
    • Get the modifier index of a specified modifier.
  • GetModifierList( ) : variant
    • Gets a table of all the modifiers on this unit.
  • GetModifierName( int nModifier ) : cstring
    • Get a specific modifier name.
  • GetModifierRemainingDuration( int nModifier ) : float
    • Get a modifier’s remaining duration.
  • GetModifierStackCount( int nModifier ) : int
    • Get a modifier’s stack count.
  • GetMostRecentPing( ) : variant
    • Get the most recent ping by this player.
  • GetMovementDirectionStability( ) : float
    • Indicates how consistent the unit’s movement has been over the last few seconds. 1 is a straight line, 0 is serpentine.
  • GetNearbyBarracks( int nRadius, bool bEnemies ) : variant
    • Get all nearby barracks.
  • GetNearbyCreeps( int nRadius, bool bEnemies ) : variant
    • Get nearby creeps (lane or neutral) that we can see.
  • GetNearbyFillers( int nRadius, bool bEnemies ) : variant
    • Get all nearby filler buildings.
  • GetNearbyHeroes( int nRadius, bool bEnemies, int eBotMode ) : variant
    • Get nearby heroes that we can see in a mode. Can specify a bot mode when querying allies. BOT_MODE_NONE does no mode filtering.
  • GetNearbyLaneCreeps( int nRadius, bool bEnemies ) : variant
    • Get nearby lane creeps that we can see.
  • GetNearbyNeutralCreeps( int nRadius ) : variant
    • Get nearby neutral creeps that we can see.
  • GetNearbyShrines( int nRadius, bool bEnemies ) : variant
    • Get all nearby shrines.
  • GetNearbyTowers( int nRadius, bool bEnemies ) : variant
    • Get all nearby towers.
  • GetNearbyTrees( int nRadius ) : variant
    • Get nearby trees.
  • GetNetWorth( ) : int
    • Get the bot’s current net worth.
  • GetNextItemPurchaseValue( ) : int
    • Gets the purchase value of the next item the unit wants to purchase.
  • GetNightTimeVisionRange( ) : int
    • Get the unit’s vision range during the night.
  • GetOffensivePower( ) : float
    • Get the unit’s current offensive power.
  • GetPlayerID( ) : int
    • Get the unit’s controlling player id.
  • GetPrimaryAttribute( ) : int
    • Gets the evasion resist of the unit.
  • GetQueuedActionType( int nQueuedAction ) : int
    • Get the specified action in the queue.
  • GetRawOffensivePower( ) : float
    • Get the unit’s raw offensive power.
  • GetRemainingLifespan( ) : float
    • Get remaining lifespan of a unit.
  • GetRespawnTime( ) : float
    • Get the time in seconds until a bot respawns.
  • GetSecondsPerAttack( ) : float
    • Gets the number of seconds per attack that a unit can do.
  • GetSlowDuration( bool bCurrentlyAvailable ) : float
    • Get the duration of available slows.
  • GetSpellAmp( ) : float
    • Gets the spell damage amplification of the unit.
  • GetStashValue( ) : int
    • Get the value of the items in the bot’s stash.
  • GetStunDuration( bool bCurrentlyAvailable ) : float
    • Get the duration of available stuns.
  • GetTalent( int nLevel, int nSide ) : handle
    • Get one of the talents at the specified level
  • GetTarget( ) : handle
    • Get the current target of this bot.
  • GetTeam( ) : int
    • Get the unit’s team.
  • GetUnitName( ) : cstring
    • Get the unit’s name.
  • GetVelocity( ) : vector
    • Get the velocity the unit has moved over the last two seconds.
  • GetXPNeededToLevel( ) : int
    • Get the amount of XP needed to level up.
  • HasBlink( bool bCurrentlyAvailable ) : bool
    • Does the bot have a blink available?
  • HasBuyback( ) : bool
    • Can the bot buy back?
  • HasInvisibility( bool bCurrentlyAvailable ) : bool
    • Does the bot have invisibility available?
  • HasMinistunOnAttack( ) : bool
    • Does the bot have ministuns on attack?
  • HasModifier( cstring pszModifierName ) : bool
    • Does the bot have the specified modifier?
  • HasScepter( ) : bool
    • Does the unit have Aghanim’s Scepter?
  • HasSilence( bool bCurrentlyAvailable ) : bool
    • Does the bot have a silence available?
  • IsAlive( ) : bool
    • Is a bot alive?
  • IsAncientCreep( ) : bool
    • Is this unit an ancient creep?
  • IsAttackImmune( ) : bool
    • Is the unit attack immune?
  • IsBlind( ) : bool
    • Is the unit blind?
  • IsBlockDisabled( ) : bool
    • Is the unit block disabled?
  • IsBot( ) : bool
    • Is this unit owned by a bot?
  • IsBuilding( ) : bool
    • Is this unit a building?
  • IsCastingAbility( ) : bool
    • Is this bot currently casting an ability?
  • IsChanneling( ) : bool
    • Is this bot currently channeling an ability?
  • IsCourier( ) : bool
    • Is this a courier?
  • IsCreep( ) : bool
    • Is this unit a creep?
  • IsDisarmed( ) : bool
    • Is the unit disarmed?
  • IsDominated( ) : bool
    • Is the unit dominated?
  • IsEvadeDisabled( ) : bool
    • Is the unit evade disabled?
  • IsFacingLocation( vector vLocation, int nDegrees ) : bool
    • Is the unit facing this location, within the specified degree tolerance?
  • IsFort( ) : bool
    • Is this unit a fort (the main ancient building)?
  • IsHero( ) : bool
    • Is this unit a hero?
  • IsHexed( ) : bool
    • Is the unit hexed?
  • IsIllusion( ) : bool
    • Is this unit an illusion?
  • IsInvisible( ) : bool
    • Is the unit invisible?
  • IsInvulnerable( ) : bool
    • Is the unit invulnerable?
  • IsMagicImmune( ) : bool
    • Is the unit magic immune?
  • IsMinion( ) : bool
    • Is this a bot’s minion?
  • IsMuted( ) : bool
    • Is the unit muted?
  • IsNightmared( ) : bool
    • Is the unit nightmared?
  • IsRooted( ) : bool
    • Is the unit rooted?
  • IsSilenced( ) : bool
    • Is the unit silenced?
  • IsSpeciallyDeniable( ) : bool
    • Is the unit specially deniable?
  • IsStunned( ) : bool
    • Is the unit stunned?
  • IsTower( ) : bool
    • Is this unit a tower?
  • IsUnableToMiss( ) : bool
    • Is the unit unable to miss?
  • IsUsingAbility( ) : bool
    • Is this bot currently using an ability?
  • NumModifiers( ) : int
    • Get the number of modifiers on this bot.
  • NumQueuedActions( ) : int
    • Get the number actions currently queued.
  • SetNextItemPurchaseValue( int nGold ) : void
    • Sets the value of the next item the unit wants to purchase.
  • SetTarget( handle ) : void
    • Set the current target of this bot. Causes no actions, but is used for coordinating between modes and ability/item usage.
  • TimeSinceDamagedByAnyHero( ) : float
    • How long as it been since the unit was damaged by any enemy?
  • TimeSinceDamagedByCreep( ) : float
    • How long as it been since the unit was damaged by a creep?
  • TimeSinceDamagedByHero( handle hHero ) : float
    • How long as it been since the unit was damaged by an specific enemy?
  • TimeSinceDamagedByPlayer( int nPlayerID ) : float
    • How long as it been since the unit was damaged by an specific player?
  • TimeSinceDamagedByTower( ) : float
    • How long as it been since the unit was damaged by a tower?
  • UsingItemBreaksInvisibility( ) : bool
    • Will using an item break invisibiilty?
  • WasRecentlyDamagedByAnyHero( float fTime ) : bool
    • Was the unit recently damaged by any enemy?
  • WasRecentlyDamagedByCreep( float fTime ) : bool
    • Was the unit recently damaged by a creep?
  • WasRecentlyDamagedByHero( handle hHero, float fTime ) : bool
    • Was the unit recently damaged by an specific enemy?
  • WasRecentlyDamagedByPlayer( int nPlayerID, float fTime ) : bool
    • Was the unit recently damaged by an specific player?
  • WasRecentlyDamagedByTower( float fTime ) : bool
    • Was the unit recently damaged by a tower?

CDOTA_TeamCommander

A Dota Bot Team Commander

Global

####

  • AddAvoidanceZone( vector, float ) : int
    • Adds a global avoidance zone for use with GeneratePath.
  • AddConditionalAvoidanceZone( vector, handle ) : int
    • Adds a global avoidance zone for use with GeneratePath, with a conditional function for whether it’s active or not.
  • CMBanHero( cstring ) : void
    • Ban a hero in Captain’s mode by name.
  • CMPickHero( cstring ) : void
    • Pick a hero in Captain’s mode by name.
  • Clamp( float, float, float ) : float
    • Clamps the value between the two supplied values.
  • CreateHTTPRequest( cstring ) : handle
    • Create a localhost HTTP request.
  • CreateRemoteHTTPRequest( cstring ) : handle
    • Create a remote HTTP request.
  • DebugDrawCircle( vector, float, int, int, int ) : void
    • Draws a circle for one frame
  • DebugDrawLine( vector, vector, int, int, int ) : void
    • Draws a line for one frame
  • DebugDrawText( float, float, cstring, int, int, int ) : void
    • Draws text for one frame
  • DebugPause( ) : void
    • Pauses the game
  • DotaTime( ) : float
    • Gets the game time – matches the in-game clock. Pauses with game pause.
  • GameTime( ) : float
    • Gets the time since the hero picking phase started. Pauses with game pause.
  • GeneratePath( vector, vector, handle, handle ) : int
    • Generates a path, avoiding the specified zones.
  • GetAllTrees( ) : variant
    • Returns a table with all tree locations
  • GetAmountAlongLane( int, vector ) : variant
    • Calculates the amount along the lane (and distance from the lane) for the specified location.
  • GetAncient( int ) : handle
    • Gets the ancient on the specified team.
  • GetAvoidanceZones( ) : variant
    • Gets an array of all visible avoidance zones in a {ability, location, radius} table.
  • GetBarracks( int, int ) : handle
    • Gets the specified barracks on the specified team.
  • GetBot( ) : handle
    • Get the bot on which script is currently being run.
  • GetBotAbilityByHandle( uint ) : handle
    • Get the bot ability specified by the supplied handle.
  • GetBotByHandle( uint ) : handle
    • Get the bot specified by the supplied handle.
  • GetCMCaptain( ) : int
    • Gets player ID of the Captain’s Mode captain.
  • GetCMPhaseTimeRemaining( ) : float
    • Get the amount of time remaining in the current Captain’s Mode phase.
  • GetCourier( int ) : handle
    • Gets a specific courier.
  • GetCourierState( handle ) : int
    • Gets a specific courier’s current state.
  • GetDefendLaneDesire( int ) : float
    • Gets the team-wide desire to defend a lane.
  • GetDroppedItemList( ) : variant
    • Returns the array of items that we can see that have been dropped on the ground.
  • GetFarmLaneDesire( int ) : float
    • Gets the team-wide desire to farm a lane.
  • GetGameMode( ) : int
    • Gets the game mode type.
  • GetGameState( ) : int
    • Gets the current state of the game.
  • GetGameStateTimeRemaining( ) : float
    • Gets how much time is remaining in the current game state.
  • GetGlyphCooldown( ) : float
    • Returns the cooldown on glyph (0 if available).
  • GetHeightLevel( vector ) : int
    • Get the height level (1 through 5) of the specified location.
  • GetHeroAssists( int ) : int
    • Gets the assists of the hero controlled by the specified PlayerID.
  • GetHeroDeaths( int ) : int
    • Gets the deaths of the hero controlled by the specified PlayerID.
  • GetHeroKills( int ) : int
    • Gets the kills of the hero controlled by the specified PlayerID.
  • GetHeroLastSeenInfo( int ) : variant
    • Gets the {location, time} of the last seen PlayerID unit.
  • GetHeroLevel( int ) : int
    • Gets the level of the hero controlled by the specified PlayerID.
  • GetHeroPickState( ) : int
    • Gets the current phase of hero picking.
  • GetIncomingTeleports( ) : variant
    • Gets a table of all the teleports that are visibly happening.
  • GetItemComponents( cstring ) : variant
    • Returns a table of items required to make the specified item.
  • GetItemCost( cstring ) : int
    • Get the cost of an item by name.
  • GetItemStockCount( cstring ) : int
    • Get the current stock count for the named item.
  • GetLaneFrontAmount( int, int, bool ) : float
    • Gets the lane front amount (0.0 - 1.0) of the specified team’s creeps along the specified lane. Optionally can ignore towers for front calculation.
  • GetLaneFrontLocation( int, int, float ) : vector
    • Gets the location of the lane front for the specified team and lane. Always ignores towers. Has a third parameter for a distance delta from the front.
  • GetLinearProjectileByHandle( int ) : variant
    • Gets a specific linear projectile’s info using its handle.
  • GetLinearProjectiles( ) : variant
    • Gets an array of all visible linear projectiles in a {ability, location, velocity, radius} table.
  • GetLocationAlongLane( int, float ) : vector
    • Calculates the location of the specified amount (0.0 - 1.0) along the specified lane.
  • GetNeutralSpawners( ) : variant
    • Get the location of all neutral spawners, and what side of the river they’re on.
  • GetNumCouriers( ) : int
    • Gets the number of couriers on the team.
  • GetOpposingTeam( ) : int
    • Gets the team that you’re fighting against.
  • GetPushLaneDesire( int ) : float
    • Gets the team-wide desire to push a lane.
  • GetRoamDesire( ) : float
    • Gets the team-wide desire to roam to a target.
  • GetRoamTarget( ) : handle
    • Gets the target of the team-wide roam desire.
  • GetRoshanDesire( ) : float
    • Gets the team-wide desire to kill Roshan.
  • GetRoshanKillTime( ) : float
    • Returns the last time that Roshan was killed.
  • GetRuneSpawnLocation( int ) : vector
    • Gets the spawn location of the specified rune.
  • GetRuneStatus( int ) :
    • Gets the status of the specified rune.
  • GetRuneTimeSinceSeen( int ) : float
    • Gets the time since we’ve seen the specified rune.
  • GetRuneType( int ) : int
    • Gets the type of the specified rune, if known.
  • GetScriptDirectory( ) : cstring
    • Get the directory from which bot scripts are being run.
  • GetSelectedHeroName( int ) : cstring
    • Gets the name of the hero selected by a player.
  • GetShopLocation( int, int ) : vector
    • Get location for the specified shop.
  • GetShrine( int, int ) : handle
    • Gets the specified shrine on the specified team.
  • GetShrineCooldown( handle ) : float
    • Gets the healing cooldown of the specified shrine.
  • GetTeam( ) : int
    • Get the team on which script is currently being run.
  • GetTeamForPlayer( int ) : int
    • Gets the team of the specified player.
  • GetTeamMember( int ) : handle
    • Get a member of a team.
  • GetTeamPlayers( int ) : variant
    • Gets a list of Player IDs for the specified team.
  • GetTimeOfDay( ) : float
    • Gets the curren time of day (0.0 is midnight, 0.5 is noon).
  • GetTower( int, int ) : handle
    • Gets the specified tower on the specified team.
  • GetTowerAttackTarget( int, int ) : handle
    • Gets the attack target of the specified tower on the specified team.
  • GetTreeLocation( int ) : vector
    • Gets the location of the specified tree.
  • GetUnitList( int ) : variant
    • Gets a list of visible units.
  • GetUnitPotentialValue( handle, vector, float ) : int
    • Gets the 0-255 potential-value location of a hero at the specified location and radius.
  • GetUnitToLocationDistance( handle, vector ) : float
    • Get the distance between a unit and a location.
  • GetUnitToLocationDistanceSqr( handle, vector ) : float
    • Get the squared distance between a unit and a location.
  • GetUnitToUnitDistance( handle, handle ) : float
    • Get the distance between two units.
  • GetUnitToUnitDistanceSqr( handle, handle ) : float
    • Get the squared distance between two units.
  • GetWorldBounds( ) : variant
    • Gets the minimum and maximum bounds of the world.
  • InstallCastCallback( int, handle ) : void
    • Install a callback for whenever the specified player’s units cast an ability or use an item.
  • InstallChatCallback( handle ) : void
    • Install a callback for whenever a player chats.
  • InstallCourierDeathCallback( handle ) : void
    • Install a callback for whenever a courier is killed.
  • InstallDamageCallback( int, handle ) : void
    • Install a callback for whenever the specified player’s units take damage.
  • InstallRoshanDeathCallback( handle ) : void
    • Install a callback for whenever Roshan is killed.
  • IsCMBannedHero( cstring ) : bool
    • Has the named hero been banned in Captain’s Mode?
  • IsCMPickedHero( int, cstring ) : bool
    • Has the named hero been picked in Captain’s Mode?
  • IsCourierAvailable( ) : bool
    • Asks if a courier is available to use.
  • IsFlyingCourier( handle ) : bool
    • Gets whether a courier is a flying courier.
  • IsHeroAlive( int ) : bool
    • Asks if the specified PlayerID is alive.
  • IsInCMBanPhase( ) : bool
    • Is Captain’s Mode in Ban phase?
  • IsInCMPickPhase( ) : bool
    • Is Captain’s Mode in Pick phase?
  • IsItemPurchasedFromSecretShop( cstring ) : bool
    • Can the named item can be purchased from the secret shop?
  • IsItemPurchasedFromSideShop( cstring ) : bool
    • Can the named item can be purchased from the side shop?
  • IsLocationPassable( vector ) : bool
    • Can the specified location currently be pathed through?
  • IsLocationVisible( vector ) : bool
    • Can the specified location currently be seen?
  • IsPlayerBot( int ) : bool
    • Asks if a specific Player ID is a bot.
  • IsPlayerInHeroSelectionControl( int ) : bool
    • Is this player allowed to currently allowed to select a hero?
  • IsRadiusVisible( vector, float ) : bool
    • Can the specified circle currently be seen?
  • IsShrineHealing( handle ) : bool
    • Gets whether the Shrine is actively healing or not.
  • IsTeamPlayer( int ) : bool
    • Asks if a specific Player ID is a member of Radiant or Dire.
  • Max( float, float ) : float
    • Returns the smaller of the two supplied values.
  • Min( float, float ) : float
    • Returns the smaller of the two supplied values.
  • PointToLineDistance( vector, vector, vector ) : variant
    • Get the squared distance between a unit and a location.
  • RandomFloat( float, float ) : float
    • Get a random float within a range
  • RandomInt( int, int ) : int
    • Get a random int within a range
  • RandomVector( float ) : vector
    • Get a random 2D vector of the specified length.
  • RealTime( ) : float
    • Gets the real-world time since the app has started. Does not pause with game pause.
  • RemapVal( float, float, float, float, float ) : float
    • Linearly remaps X from A,B to C,D
  • RemapValClamped( float, float, float, float, float ) : float
    • Linearly remaps X from A,B to C,D, clamping to C,D
  • RemoveAvoidanceZone( int ) : void
    • Adds a global avoidance zone for use with GeneratePath.
  • RollPercentage( int ) : bool
    • Rolls a number from 1 to 100 and returns true if the roll is less than or equal to the number specified
  • SelectHero( int, cstring ) : void
    • Selects a hero for a player.
  • SetCMCaptain( int ) : void
    • Sets a player to be Captain’s Mode captain.