Heroes of Newerth Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Recent changes
Random page
Community portal
Information
Heroes
Items
Units
HoN Store
Social Media
Facebook
Twitter
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Heroes of Newerth Wiki
2,525
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Recent changes
Random page
Community portal
Information
Heroes
Items
Units
HoN Store
Social Media
Facebook
Twitter
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
Bot API
Back to page
Edit
VisualEditor
View history
Talk (0)
Edit Page
Bot API
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Botapi}} __FORCETOC__ Below are the bot API functions available. A copy of the list can be found [https://forums.heroesofnewerth.com/showthread.php?472609-LuaFunctions-bot-functions-list here]. Please use the documentation for [[API HoN.DrawDebugLine|HoN.DrawDebugLine]] as a template when adding new function pages. Leave out any empty categories and don't forget to add a minimal function description to this page. == Global functions == * <span style="color:#9000FF">void</span> AddBot(nTeam, sDefinitionName) - Add a bot with the provided definition name to the the provided team. * <span style="color:#9000FF">void</span> StartGame(String type, String name, String options) - Start a game with the provided settings. Same as the equally named console command. * <span style="color:#9000FF">void</span> Echo(String text) - Prints a line of text in the console. * <span style="color:#0080FF">Number</span> GetTime() * <span style="color:#0080FF">Number</span> GetTimeOfDawn() * <span style="color:#9000FF">void</span> Print(...) - Prints the provided text in the console. Does not start a new line. * <span style="color:#0080FF">Number</span> Round(Number) - Rounds a floating number. Same as ''math.floor(Number + .5)''. * <span style="color:#9000FF">void</span> [[API StartProfile|StartProfile]](sName) - Does not work in the retail client. * <span style="color:#9000FF">void</span> StopProfile() - Does not work in the retail client. == Vector3 library == For a tutorial on Vector3 visit [https://forums.heroesofnewerth.com/showthread.php?470684-Vector3-Basics-Tutorial this thread]. * <span style="color:#FF8800">Vector3</span> Vector3.Create([nX, nY, nZ]) - Create a new Vector3 instance. * <span style="color:#FF8800">Vector3</span> Vector3.Cross(vec1, vec2) * <span style="color:#0080FF">Number</span> Vector3.Distance(vec1, vec2) - Calculate the 3D distance (x,y,z) between the two vectors. Expensive function. Should not be used. * <span style="color:#0080FF">Number</span> Vector3.Distance2D(vec1, vec2) - Calculate the 2D distance (x,y) between two vectors. Expensive function. Should not be used. If you ever do need to calculate the 2D distance (e.g. for averages) you can use [https://forums.heroesofnewerth.com/showthread.php?470402-Snippet-Compedium#VecLen this snippet] instead. * <span style="color:#0080FF">Number</span> Vector3.Distance2DSq(vec1, vec2) - Calculate the 2D distance (x,y) between two vectors using a much cheaper formula. Should be used for most (if not all) distance calculations. * <span style="color:#0080FF">Number</span> Vector3.DistanceSq(vec1, vec2) - Calculate the 3D distance (x,y,z) between two vectors. Vector3.Distance2DSq usually suffices. * <span style="color:#0080FF">Number</span> Vector3.Dot(vec1, vec2) * <span style="color:#0080FF">Number</span> Vector3.Length(vec) * <span style="color:#0080FF">Number</span> Vector3.LengthSq(vec) * <span style="color:#FF8800">Vector3</span> Vector3.Normalize(vec) * <span style="color:#FF8800">Vector3</span> Vector3.Project(vecOnto, vecToProject) == HoN library == This section is for functions in the HoN library. The HoN library returns different information for each team and may not return anything useful when executed from the console. * <span style="color:#00FFE1">Boolean</span> HoN.CanSeePosition(vecPos) - Returns true if the position is currently visible. * <span style="color:#9000FF">void</span> [[API HoN.DrawDebugLine|HoN.DrawDebugLine]](vecStart, vecEnd[, bArrow = false, sColor = "yellow"]) - Draw a debug line in the game world at the provided location. * <span style="color:#00FFE1">Boolean</span> HoN.GameEntityExists(nIndex) * <span style="color:#0080FF">Number</span> HoN.GetCreepWaveSpawnInterval() * <span style="color:#0080FF">Number</span> HoN.GetExperienceForLevel(nLevel) * <span style="color:#0080FF">Number</span> HoN.GetGameTime() - Get the time since the lobby started. * <span style="color:#0080FF">Number</span> [[API HoN.GetHellbourneTeam|HoN.GetHellbourneTeam]]() - Returns the number identifier for the Hellbourne team (2). * <span style="color:#FFF700">Table</span>{unit} HoN.GetHeroes(nTeam) - Returns a table of all heroes in the provided nTeam. * CItemDefinition HoN.GetItemDefinition(sItemName) * <span style="color:#0080FF">Number</span> [[API HoN.GetLegionTeam|HoN.GetLegionTeam]]() - Returns the number identifier for the Legion team (1). * <span style="color:#0080FF">Number</span> HoN.GetMatchTime() - Returns the time since the 0:00 mark. * <span style="color:#FFF700">Table</span> HoN.GetMetaTable(sObjectType) * <span style="color:#0080FF">Number</span> [[API HoN.GetNeutralTeam|HoN.GetNeutralTeam]]() - Returns the number identifier for the Neutral team (0). * <span style="color:#0080FF">Number</span> HoN.GetRemainingPreMatchTime() - Returns the remaining pre-match time (time before the 0:00 mark). * <span style="color:#FFF700">Table</span> HoN.GetScores() - Returns a table with the scores for all heroes. * teambot HoN.GetTeamBotBrain() - Returns the TeamBotBrain for the current bot's team. * <span style="color:#0080FF">Number</span> HoN.GetTimeUntilCreepWaveSpawn() * <span style="color:#0080FF">Number</span> HoN.GetTotalTime() * <span style="color:#FFF700">Table</span>{unit, ...} HoN.GetTreesInRadius(vecCenter, nRadius) * <span style="color:#FFF700">Table</span>{unit, ...} HoN.GetUnitsInRadius(vecCenter, nRadius, nMask) * <span style="color:#00FFE1">Boolean</span> HoN.WillBlockNeutralSpawn(vecPos) == CBotBrain members == * <span style="color:#00FFE1">Boolean</span> CBotBrain:CanSeeUnit(unitTarget) * <span style="color:#00FFE1">Boolean</span> CBotBrain:CanSelectHero(sHeroName) * <span style="color:#9000FF">void</span> CBotBrain:Chat(sText) - Send a message to everybody in the game. * <span style="color:#9000FF">void</span> CBotBrain:ChatTeam(sText) - Send a message to the team. * <span style="color:#0080FF">Number</span> CBotBrain:GetGold() - Returns the current gold available. * <span style="color:#0080FF">Number</span> CBotBrain:GetGoldEarned() - Returns the gold earned. * <span style="color:#0080FF">Number</span> CBotBrain:GetGPM() - Returns the GPM. * unit CBotBrain:GetHeroUnit() * <span style="color:#00F539">String</span> CBotBrain:GetName() * <span style="color:#00F539">String</span> CBotBrain:GetPotentialHero() * <span style="color:#0080FF">Number</span> CBotBrain:GetTeam() - Returns the team of the current bot. * <span style="color:#00FFE1">Boolean</span> CBotBrain:HasSelectedHero() * <span style="color:#00FFE1">Boolean</span> CBotBrain:IsHeroLocked() - Returns if the hero is locked in a lock picking game. * <span style="color:#9000FF">void</span> CBotBrain:Order(Unit unit, String order, String queue = "none") * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbility|CBotBrain:OrderAbility]](Ability ability, [bool queueCommand = false]) - Order the bot to cast an ability that requires no target. * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbility2|CBotBrain:OrderAbility2]](Ability ability, [bool queueCommand = false]) - Orders the bot to toggle an auto cast ability on or off. * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbilityEntity|CBotBrain:OrderAbilityEntity]](Ability ability, Unit target, [bool queueCommand = false]) - Orders the bot to use an ability at the provided target. * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbilityEntityVector|CBotBrain:OrderAbilityEntityVector]](Ability ability, Unit target, Vector3 delta, [bool queueCommand = false]) - Orders the bot to use a Vector Entity ability at the provided target in the provided direction (e.g. Rally's Compell). * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbilityPosition|CBotBrain:OrderAbilityPosition]](Ability ability, Vector3 pos, [bool queueCommand = false]) - Orders the bot to use the ability at the provided target position. * <span style="color:#9000FF">void</span> [[API CBotBrain:OrderAbilityVector|CBotBrain:OrderAbilityVector]](Ability ability, Vector3 startPos, Vector3 endPos, [bool queueCommand = false]) - Orders the bot to use the Vector ability in the provided direction (e.g. Zephyr's Gust). * <span style="color:#9000FF">void</span> CBotBrain:OrderEntity(Unit unit, String order, [Unit target = NULL, String queue = "none", Item item = NULL, bool useDirectPathing = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderItem(Item item, [bool queueCommand = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderItem2(Item item, [bool queueCommand = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderItemEntity(Item item, Unit target, [bool queueCommand = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderItemPosition(Item item, Vector3 pos, [bool queueCommand = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderItemVector(Item item, Vector3 startPos, Vector3 endPos, [bool queueCommand = false]) * <span style="color:#9000FF">void</span> CBotBrain:OrderPosition(Unit unit, String order, Vector3 position, [String queue = "none", Item item = NULL, bool useDirectPathing = false]) * <span style="color:#9000FF">void</span> [[API CBotBrain:Ready|CBotBrain:Ready]]() - Mark as ready in the hero picking phase. * <span style="color:#9000FF">void</span> [[API CBotBrain:SelectHero|CBotBrain:SelectHero]](sHeroName) - Select a hero in the hero picking phase. * <span style="color:#9000FF">void</span> CBotBrain:SelectPotentialHero(sHeroName) - Shadow pick a hero in the hero picking phase. * <span style="color:#9000FF">void</span> CBotBrain:SendBotMessage(bAllChat, sMessageKey, tMessageTokens) * <span style="color:#9000FF">void</span> CBotBrain:ShareControl(player, bShare, bFullControl) - Share unit control with another player. == CTeamBotBrain members == This section is for functions provided in the "object" variable of a TeamBotBrain. * <span style="color:#00FFE1">Boolean</span> CTeamBotBrain:CanSeeUnit(unitTarget) - Returns if the provided unit can be seen. * <span style="color:#FF8800">Vector3</span> CTeamBotBrain:GetFrontOfCreepWavePosition(sLane) * <span style="color:#0080FF">Number</span> CTeamBotBrain:GetTeam() - Returns the team of the bot. == IEntityAbility members == This section is for functions for unit abilities (heroes, pets, couriers, etc.). * <span style="color:#00FFE1">Boolean</span> IEntityAbility:CanActivate() - Returns if the ability can be activated. * <span style="color:#00FFE1">Boolean</span> [[API IEntityAbility:CanLevelUp|IEntityAbility:CanLevelUp]]() - Returns if the ability can be leveled up. * <span style="color:#0080FF">Number</span> IEntityAbility:GetActiveChannelPercent() - Returns how far along the channeling is in percentages. * <span style="color:#0080FF">Number</span> IEntityAbility:GetActiveChannelTime() - Returns how far along the channeling is in time. * <span style="color:#0080FF">Number</span> IEntityAbility:GetActiveManaCost() * <span style="color:#00F539">String</span> IEntityAbility:GetActiveModifierKey() * <span style="color:#0080FF">Number</span> IEntityAbility:GetActualRemainingCooldownPercent() * <span style="color:#0080FF">Number</span> IEntityAbility:GetActualRemainingCooldownTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetAdjustedActionTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetAdjustedCastTime() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetAllowAutoCast() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetAllowOutOfBoundsCast() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetAllowOutOfRangeCast() * <span style="color:#0080FF">Number</span> IEntityAbility:GetAreaCastRange() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetAutoToggleOffWhenDisabled() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetAutoToggleOffWithTriggeredManaCost() * <span style="color:#0080FF">Number</span> IEntityAbility:GetCastActionTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetCastTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetChannelRange() * <span style="color:#0080FF">Number</span> IEntityAbility:GetChannelTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetChargeCost() * <span style="color:#0080FF">Number</span> IEntityAbility:GetCharges() * <span style="color:#0080FF">Number</span> IEntityAbility:GetConeCastRange() * <span style="color:#0080FF">Number</span> IEntityAbility:GetConeCastWidth() * <span style="color:#0080FF">Number</span> IEntityAbility:GetCooldownOnDamage() * <span style="color:#0080FF">Number</span> IEntityAbility:GetCooldownTime() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetDeferChannelCost() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetDeferChannelImpact() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetDoubleActivate() * <span style="color:#0080FF">Number</span> IEntityAbility:GetForceRange() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetFrontQueue() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetIgnoreCooldown() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetIgnoreInvulnerable() * <span style="color:#0080FF">Number</span> IEntityAbility:GetInitialCharges() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetIsChanneling() - Currently bugged: returns whether the hero is channeling (same as IUnitEntity:IsChanneling()). Should return whether the ability is being channeled. * <span style="color:#0080FF">Number</span> IEntityAbility:GetLevel() * <span style="color:#0080FF">Number</span> IEntityAbility:GetLineCastMaxRange() * <span style="color:#0080FF">Number</span> IEntityAbility:GetLineCastRange() * <span style="color:#0080FF">Number</span> IEntityAbility:GetLineCastWidth() * <span style="color:#0080FF">Number</span> IEntityAbility:GetManaCost() * <span style="color:#0080FF">Number</span> IEntityAbility:GetMaxCharges() * <span style="color:#0080FF">Number</span> IEntityAbility:GetMaxLevel() * <span style="color:#0080FF">Number</span> IEntityAbility:GetMinRange() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNeedVision() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNonInterrupting() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNoRangeClamp() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNoStun() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNoTargetIgnoreInvulnerable() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetNoTurnToTarget() * <span style="color:#0080FF">Number</span> IEntityAbility:GetRange() * <span style="color:#0080FF">Number</span> IEntityAbility:GetRangeBuffer() * <span style="color:#0080FF">Number</span> IEntityAbility:GetSlot() * <span style="color:#0080FF">Number</span> IEntityAbility:GetTargetRadius() * <span style="color:#0080FF">Number</span> IEntityAbility:GetToggleOffCooldownTime() * <span style="color:#0080FF">Number</span> IEntityAbility:GetToggleOffManaCost() * <span style="color:#0080FF">Number</span> IEntityAbility:GetTriggeredManaCost() * <span style="color:#0080FF">Number</span> IEntityAbility:GetType() * <span style="color:#00F539">String</span> IEntityAbility:GetTypeName() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:GetUsePathForRange() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:IsActive() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:IsDisabled() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:IsReady() * <span style="color:#00FFE1">Boolean</span> IEntityAbility:IsValid() * <span style="color:#9000FF">void</span> [[API IEntityAbility:LevelUp|IEntityAbility:LevelUp]]() == IBehavior members == * ActionState IBehavior:GetAttackingActionState() * Unit IBehavior:GetAttackTarget() * ActionState IBehavior:GetCastingActionState() * <span style="color:#FF8800">Vector3</span> IBehavior:GetGoalPosition() * Player IBehavior:GetIssuedPlayer() * <span style="color:#00FFE1">Boolean</span> IBehavior:GetMoving() * ActionState IBehavior:GetMovingActionState() * unit IBehavior:GetOwnerUnit() * Unit IBehavior:GetTarget() * <span style="color:#00F539">String</span> IBehavior:GetType() * <span style="color:#00FFE1">Boolean</span> IBehavior:IsChanneling() * <span style="color:#00FFE1">Boolean</span> IBehavior:IsForced() * <span style="color:#00FFE1">Boolean</span> IBehavior:IsIdle() * <span style="color:#00FFE1">Boolean</span> IBehavior:IsTraveling() == IUnitEntity members == * <span style="color:#00FFE1">Boolean</span> IUnitEntity:CanAccess(item) - Returns whether this user can access the provided item. * <span style="color:#FFF700">Table</span>{item} IUnitEntity:FindItemInInventory(sItemName) * ability IUnitEntity:GetAbility(nSlot) * <span style="color:#0080FF">Number</span> IUnitEntity:GetAbilityPointsAvailable() * <span style="color:#00F539">String</span> IUnitEntity:GetActionState() * <span style="color:#0080FF">Number</span> IUnitEntity:GetAdjustedAttackActionTime() * <span style="color:#0080FF">Number</span> IUnitEntity:GetAdjustedAttackCooldown() * <span style="color:#0080FF">Number</span> IUnitEntity:GetAdjustedAttackDuration() * <span style="color:#0080FF">Number</span> IUnitEntity:GetArmor() * <span style="color:#0080FF">Number</span> [[API IUnitEntity:GetAttackDamageMax|IUnitEntity:GetAttackDamageMax]]() - Returns the base attack damage max. * <span style="color:#0080FF">Number</span> [[API IUnitEntity:GetAttackDamageMin|IUnitEntity:GetAttackDamageMin]]() - Returns the base attack damage min. * <span style="color:#0080FF">Number</span> IUnitEntity:GetAttackProjectileSpeed() * <span style="color:#0080FF">Number</span> IUnitEntity:GetAttackRange() * <span style="color:#0080FF">Number</span> IUnitEntity:GetAttackSpeed() * <span style="color:#00F539">String</span> IUnitEntity:GetAttackTarget() * <span style="color:#00F539">String</span> IUnitEntity:GetAttackType() * <span style="color:#0080FF">Number</span> IUnitEntity:GetBaseDamage() - Returns a random base attack damage between the base min and base max. * Behavior IUnitEntity:GetBehavior() * <span style="color:#0080FF">Number</span> IUnitEntity:GetBoundsRadius() * <span style="color:#0080FF">Number</span> IUnitEntity:GetBuyBackCost() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:GetCanAttack() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:GetCliffwalking() * sName IUnitEntity:GetDisplayName() * <span style="color:#0080FF">Number</span> IUnitEntity:GetEvasionMelee() * <span style="color:#0080FF">Number</span> IUnitEntity:GetEvasionRanged() * <span style="color:#0080FF">Number</span> IUnitEntity:GetExperienceForCurrentLevel() * <span style="color:#0080FF">Number</span> IUnitEntity:GetExperienceForNextLevel() * <span style="color:#0080FF">Number</span> IUnitEntity:GetFinalAttackDamageMax() - Returns the actual attack damage max. * <span style="color:#0080FF">Number</span> IUnitEntity:GetFinalAttackDamageMin() - Returns the actual attack damage min. * <span style="color:#0080FF">Number</span> IUnitEntity:GetHealth() - Returns the current health. * <span style="color:#0080FF">Number</span> IUnitEntity:GetHealthPercent() - Returns the current health percentage. * <span style="color:#0080FF">Number</span> IUnitEntity:GetHealthRegen() - Returns the current health regeneration. * <span style="color:#FFF700">Table</span>{Item} IUnitEntity:GetInventory([bAppendStash = false]) - Returns the current inventory. * item IUnitEntity:GetItem(nSlot) * <span style="color:#FFF700">Table</span>{CItemDefinition} IUnitEntity:GetItemComponentsRemaining(itemdef) * <span style="color:#0080FF">Number</span> IUnitEntity:GetItemCostRemaining(itemdef) * <span style="color:#0080FF">Number</span> IUnitEntity:GetLevel() * <span style="color:#0080FF">Number</span> IUnitEntity:GetLifeSteal() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMagicArmor() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMagicResistance() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMana() * <span style="color:#0080FF">Number</span> IUnitEntity:GetManaPercent() * <span style="color:#0080FF">Number</span> IUnitEntity:GetManaRegen() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMaxHealth() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMaxMana() * <span style="color:#0080FF">Number</span> IUnitEntity:GetMoveSpeed() * <span style="color:#0080FF">Number</span> IUnitEntity:GetNumBuyBacks() * player IUnitEntity:GetOwnerPlayer() * <span style="color:#0080FF">Number</span> IUnitEntity:GetPhysicalResistance() * <span style="color:#FF8800">Vector3</span> IUnitEntity:GetPosition() * <span style="color:#00F539">String</span> IUnitEntity:GetPrimaryAttribute() * <span style="color:#0080FF">Number</span> IUnitEntity:GetRemainingCooldownTime(sName | CItemDefinition) * <span style="color:#0080FF">Number</span> IUnitEntity:GetRemainingRespawnTime() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:GetStashAccess() * <span style="color:#FFF700">Table</span>{Number} IUnitEntity:GetStats() * <span style="color:#0080FF">Number</span> IUnitEntity:GetTeam() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:GetTreewalking() * <span style="color:#00F539">String</span> IUnitEntity:GetTypeName() * <span style="color:#0080FF">Number</span> IUnitEntity:GetUniqueID() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:GetUnitwalking() * <span style="color:#0080FF">Number</span> IUnitEntity:GetXPM() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:HasDeniablePotential() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:HasState(sName) * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsAlive() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsAttackReady() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsBase() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsBotControlled() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsBuilding() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsChanneling() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsDeniable() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsDisarmed() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsHero() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsImmobilized() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsInvulnerable() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsPerplexed() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsRax() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsShop() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsSilenced() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsStealth() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsStunned() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsTower() * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsUnitType(sType) * <span style="color:#00FFE1">Boolean</span> IUnitEntity:IsValid() * <span style="color:#9000FF">void</span> IUnitEntity:PurchaseRemaining(CItemDefinition) * <span style="color:#9000FF">void</span> IUnitEntity:Sell(item) * <span style="color:#9000FF">void</span> IUnitEntity:SellBySlot(nSlot) * <span style="color:#9000FF">void</span> IUnitEntity:SwapItems(nSlot1, nSlot2) * <span style="color:#9000FF">void</span> IUnitEntity:TeamShare() * <span style="color:#FFF700">Table</span> IUnitEntity:GetKDA() == IActionState members == * <span style="color:#00FFE1">Boolean</span> IActionState:IsActive() * <span style="color:#00FFE1">Boolean</span> IActionState:IsAllDone() * <span style="color:#00FFE1">Boolean</span> IActionState:IsAttackReady() * <span style="color:#00FFE1">Boolean</span> IActionState:IsCommitted() * <span style="color:#00FFE1">Boolean</span> IActionState:IsCompleted() * <span style="color:#00FFE1">Boolean</span> IActionState:IsInterrupted() == CItemDefinition members == * <span style="color:#0080FF">Number</span> CItemDefinition:GetActiveManaCost() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowAutoCast() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowDisassemble() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowOutOfBoundsCast() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowOutOfRangeCast() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowSharing() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAllowTransfer() * <span style="color:#0080FF">Number</span> CItemDefinition:GetAreaCastRange() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAutoAssemble() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAutoRecharge() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAutoToggleOffWhenDisabled() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetAutoToggleOffWithTriggeredManaCost() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetBindOnPickup() * <span style="color:#0080FF">Number</span> CItemDefinition:GetCastActionTime() * <span style="color:#0080FF">Number</span> CItemDefinition:GetCastTime() * <span style="color:#0080FF">Number</span> CItemDefinition:GetChannelRange() * <span style="color:#0080FF">Number</span> CItemDefinition:GetChannelTime() * <span style="color:#0080FF">Number</span> CItemDefinition:GetChargeCost() * <span style="color:#FFF700">Table</span>{CItemDefinition} CItemDefinition:GetComponents() * <span style="color:#0080FF">Number</span> CItemDefinition:GetConeCastRange() * <span style="color:#0080FF">Number</span> CItemDefinition:GetConeCastWidth() * <span style="color:#0080FF">Number</span> CItemDefinition:GetCooldownOnDamage() * <span style="color:#0080FF">Number</span> CItemDefinition:GetCooldownTime() * <span style="color:#0080FF">Number</span> CItemDefinition:GetCost() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDeferChannelCost() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDeferChannelImpact() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDestroyOnEmpty() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDisabled() * <span style="color:#00F539">String</span> CItemDefinition:GetDisplayName() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDoubleActivate() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetDropOnDeath() * <span style="color:#0080FF">Number</span> CItemDefinition:GetForceRange() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetFrontQueue() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetIgnoreCooldown() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetIgnoreInvulnerable() * <span style="color:#0080FF">Number</span> CItemDefinition:GetInitialCharges() * <span style="color:#0080FF">Number</span> CItemDefinition:GetInitialStock() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetIsChanneling() * <span style="color:#0080FF">Number</span> CItemDefinition:GetLineCastMaxRange() * <span style="color:#0080FF">Number</span> CItemDefinition:GetLineCastRange() * <span style="color:#0080FF">Number</span> CItemDefinition:GetLineCastWidth() * <span style="color:#0080FF">Number</span> CItemDefinition:GetManaCost() * <span style="color:#0080FF">Number</span> CItemDefinition:GetMaxLevel() * <span style="color:#0080FF">Number</span> CItemDefinition:GetMaxOwned() * <span style="color:#0080FF">Number</span> CItemDefinition:GetMaxStock() * <span style="color:#0080FF">Number</span> CItemDefinition:GetMinRange() * <span style="color:#00F539">String</span> CItemDefinition:GetName() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNeedVision() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNew() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoDrop() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNonInterrupting() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoPurchase() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoRangeClamp() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoSell() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoStash() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoStun() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoTargetIgnoreInvulnerable() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetNoTurnToTarget() * <span style="color:#0080FF">Number</span> CItemDefinition:GetRange() * <span style="color:#0080FF">Number</span> CItemDefinition:GetRangeBuffer() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetRechargeable() * <span style="color:#0080FF">Number</span> CItemDefinition:GetRestockDelay() * <span style="color:#0080FF">Number</span> CItemDefinition:GetTargetRadius() * <span style="color:#0080FF">Number</span> CItemDefinition:GetToggleOffCooldownTime() * <span style="color:#0080FF">Number</span> CItemDefinition:GetToggleOffManaCost() * <span style="color:#0080FF">Number</span> CItemDefinition:GetTotalCost([nIndex = 0]) * <span style="color:#0080FF">Number</span> CItemDefinition:GetTriggeredManaCost() * <span style="color:#0080FF">Number</span> CItemDefinition:GetTypeID() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetUnkillable() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:GetUsePathForRange() * <span style="color:#00FFE1">Boolean</span> CItemDefinition:IsValid() == IEntityItem members == * ItemList - The list of items internal names. * <span style="color:#00FFE1">Boolean</span> IEntityItem:CanActivate() - Returns whether the item can be activated. * <span style="color:#00FFE1">Boolean</span> IEntityItem:CanDrop() - Returns whether the item can be dropped on the ground. * <span style="color:#00FFE1">Boolean</span> IEntityItem:CanUse() - Returns whether the item can be used. * <span style="color:#0080FF">Number</span> IEntityItem:GetActiveManaCost() * <span style="color:#00F539">String </span> IEntityItem:GetActiveModifierKey() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowAutoCast() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowDisassemble() - Returns whether the item can be disassembled. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowOutOfBoundsCast() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowOutOfRangeCast() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowSharing() - Returns whether the item can be shared with other players. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAllowTransfer() - Returns whether the item can be given transferred. * <span style="color:#0080FF">Number</span> IEntityItem:GetAreaCastRange() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAutoAssemble() - Returns whether the item auto assembles. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAutoRecharge() - Returns whether the item automatically gains a charge (e.g. . * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAutoToggleOffWhenDisabled() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetAutoToggleOffWithTriggeredManaCost() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetBindOnPickup() * <span style="color:#0080FF">Number</span> IEntityItem:GetCastActionTime() * <span style="color:#0080FF">Number</span> IEntityItem:GetCastTime() - Returns the cast time when using the item. * <span style="color:#00F539">String</span> IEntityItem:GetCategory() * <span style="color:#0080FF">Number</span> IEntityItem:GetChannelRange() * <span style="color:#0080FF">Number</span> IEntityItem:GetChannelTime() * <span style="color:#0080FF">Number</span> IEntityItem:GetChargeCost() * <span style="color:#0080FF">Number</span> IEntityItem:GetCharges() - Returns the amount of charges available. * <span style="color:#FFF700">Table</span>{CItemDefinition} IEntityItem:GetComponents() * <span style="color:#0080FF">Number</span> IEntityItem:GetConeCastRange() * <span style="color:#0080FF">Number</span> IEntityItem:GetConeCastWidth() * <span style="color:#0080FF">Number</span> IEntityItem:GetCooldownOnDamage() * <span style="color:#0080FF">Number</span> IEntityItem:GetCooldownTime() * <span style="color:#0080FF">Number</span> IEntityItem:GetCost() - Returns the cost of the recipe used to make the item. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDeferChannelCost() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDeferChannelImpact() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDestroyOnEmpty() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDisabled() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDoubleActivate() - Returns whether the item can be activated twice (e.g. to teleport to base). * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetDropOnDeath() - Returns whether the item drops on death. * <span style="color:#0080FF">Number</span> IEntityItem:GetForceRange() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetFrontQueue() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetIgnoreCooldown() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetIgnoreInvulnerable() * <span style="color:#0080FF">Number</span> IEntityItem:GetInitialCharges() - Returns the amount of charges you get when buying the item. * <span style="color:#0080FF">Number</span> IEntityItem:GetInitialStock() - Returns the initial amount of items in stock (when the game starts). * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetIsChanneling() * CItemDefinition [[API IEntityItem:GetItemDefinition|IEntityItem:GetItemDefinition() - Get the item definition of the item. * <span style="color:#0080FF">Number</span> IEntityItem:GetLevel() - Returns the level of the item (e.g. Codex level 5). Always returns nil for hostile units. As a workaround you can check the value of an item like so: local nLevel = (itemSpellShards:GetValue() == 1187 and 1) or (itemSpellShards:GetValue() == 1587 and 2) or (itemSpellShards:GetValue() == 1987 and 3); * <span style="color:#0080FF">Number</span> IEntityItem:GetLineCastMaxRange() * <span style="color:#0080FF">Number</span> IEntityItem:GetLineCastRange() * <span style="color:#0080FF">Number</span> IEntityItem:GetLineCastWidth() * <span style="color:#0080FF">Number</span> IEntityItem:GetManaCost() * <span style="color:#0080FF">Number</span> IEntityItem:GetMaxCharges() - Returns the max amount of charges in one stack in your inventory. * <span style="color:#0080FF">Number</span> IEntityItem:GetMaxLevel() * <span style="color:#0080FF">Number</span> IEntityItem:GetMaxStock() - Returns the max amount of this item available at once in the store. * <span style="color:#0080FF">Number</span> IEntityItem:GetMinRange() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNeedVision() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoDrop() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNonInterrupting() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoPurchase() - Returns whether the item can't be bought. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoRangeClamp() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoSell() - Returns whether the item can't be sold. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoStash() - Returns whether the item can't be placed in the stash. * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoStun() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoTargetIgnoreInvulnerable() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetNoTurnToTarget() * <span style="color:#0080FF">Number</span> IEntityItem:GetRange() - Returns the range on using the item. * <span style="color:#0080FF">Number</span> IEntityItem:GetRangeBuffer() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetRechargeable() * <span style="color:#0080FF">Number</span> IEntityItem:GetRemainingCooldownTime() * <span style="color:#0080FF">Number</span> IEntityItem:GetRestockDelay() - Returns the time it takes for the item to restock in the store. * <span style="color:#0080FF">Number</span> IEntityItem:GetSlot() - Returns the slot of the item in your inventory. * <span style="color:#0080FF">Number</span> IEntityItem:GetTargetRadius() * <span style="color:#0080FF">Number</span> IEntityItem:GetToggleOffCooldownTime() * <span style="color:#0080FF">Number</span> IEntityItem:GetToggleOffManaCost() * <span style="color:#0080FF">Number</span> IEntityItem:GetTotalCost() - Returns the cost of the item and all of it's components. If the item has been upgraded the value of a level 1 version will be returned instead. * <span style="color:#0080FF">Number</span> IEntityItem:GetTriggeredManaCost() * <span style="color:#0080FF">Number</span> IEntityItem:GetType() * <span style="color:#00F539">String</span> IEntityItem:GetTypeName() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetUnkillable() * <span style="color:#00FFE1">Boolean</span> IEntityItem:GetUsePathForRange() * <span style="color:#0080FF">Number</span> IEntityItem:GetValue() - Returns the worth of the item. * <span style="color:#00FFE1">Boolean</span> IEntityItem:IsActive() - Returns whether the item is currently active. * <span style="color:#00FFE1">Boolean</span> IEntityItem:IsRecipe() - Returns whether the item is a recipe. * <span style="color:#00FFE1">Boolean</span> IEntityItem:IsValid() - Returns whether the item instance (i.e. the object) is still valid. == BotMetaData library == * <span style="color:#FFF700">Table</span> BotMetaData.FindPath(vecStartPos, vecEndPos[, funcGetCost, funcGetHeuristic]) - Find a path using nodes in the currently active BotMetaData layer. * CBotMetaDataNode BotMetaData.GetClosestNode(vecPos) - Get the closest node to the provided location in the currently active BotMetaData layer. * CBotMetaDataNode,Number BotMetaData.GetClosestNodeOnPath(tPath, vecPos) * <span style="color:#FFF700">Table</span> BotMetaData.RegisterLayer(sPath) - Make a new BotMetaData layer available. * <span style="color:#FFF700">Table</span> BotMetaData.SetActiveLayer(sPath) - Make a different BotMetaData layer active. Note that this breaks pathing if not reverted to the default layer. == CBotMetaDataNode members == * <span style="color:#00F539">String</span> CBotMetaDataNode:GetName() - Returns the name of a node. * <span style="color:#FF8800">Vector3</span> CBotMetaDataNode:GetPosition() - Returns the position of a node. * <span style="color:#00F539">String</span>/<span style="color:#0080FF">Number</span>/<span style="color:#00FFE1">Boolean</span> CBotMetaDataNode:GetProperty(sName) - Returns the value of the property with the provided name. == CBotMetaDataLink members == * <span style="color:#00F539">String</span> CBotMetaDataLink:GetName() * <span style="color:#FF8800">Vector3</span> CBotMetaDataLink:GetPosition() * <span style="color:#00F539">String</span>/<span style="color:#0080FF">Number</span>/<span style="color:#00FFE1">Boolean</span> CBotMetaDataLink:GetProperty(sName) There is also a ton of useful functions in the scripts themselves (such as those in core and botbraincore), and on the [https://forums.heroesofnewerth.com/forumdisplay.php?291-Technical-Discussion-Code-Snippet-Sharing snippets subforum].
Summary:
Please note that all contributions to the Heroes of Newerth Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
view source
)
Template:Botapi
(
view source
)
Follow on IG
TikTok
Join Fan Lab