February 9 Bot Update
General Changes:
Added support for a GetBotNames() function in hero_selection.lua which can return a table of names that the bots will pick from. Bots using names from this will have (Bot) postfixed to their name.
Added IsLocationVisible() function to the global bot script API.
Added GetGlyphCooldown() function to the global bot script API
Added GetRemainingLifespan() function to the unit bot script API.
Added GetNetWorth() function to the unit bot script API.
Added GetLastHits() and GetDenies() functions to the unit bot script API.
Added GetModifierRemainingDuration() function to the unit bot script API.
Fixed bad calculation in the offensive power of Focus Fire (off by a factor of 100).
Added some smoothing to GetOffensivePower() and GetRawOffensivePower().
GetHeroLastSeenInfo() will now return a valid table when you haven't seen the hero yet, rather than nil.
Fixed GetStunDuration(), GetSlowDuration() to take into account whether you have mana to cast.
Updated builds for 7.02.
Added ABILITY_BEHAVIOR_* constants.
Added GLYPH_COOLDOWN constant.
Action Queue Changes
Significant changes have been made to how bots manage their actions. There are now three variants of a number of Action functions:
Action_AttackMove
ActionPush_AttackMove
ActionQueue_AttackMove
Action_AttackUnit
ActionPush_AttackUnit
ActionQueue_AttackUnit
Action_DropItem
ActionPush_DropItem
ActionQueue_DropItem
Action_MoveToLocation
ActionPush_MoveToLocation
ActionQueue_MoveToLocation
Action_MoveToUnit
ActionPush_MoveToUnit
ActionQueue_MoveToUnit
Action_PickUpItem
ActionPush_PickUpItem
ActionQueue_PickUpItem
Action_PickUpRune
ActionPush_PickUpRune
ActionQueue_PickUpRune
Action_UseAbility
ActionPush_UseAbility
ActionQueue_UseAbility
Action_UseAbilityOnEntity
ActionPush_UseAbilityOnEntity
ActionQueue_UseAbilityOnEntity
Action_UseAbilityOnLocation
ActionPush_UseAbilityOnLocation
ActionQueue_UseAbilityOnLocation
Action_UseAbilityOnTree
ActionPush_UseAbilityOnTree
ActionQueue_UseAbilityOnTree
Action_UseShrine
ActionPush_UseShrine
ActionQueue_UseShrine
ActionPush_Delay (new action for pushing or queuing a delay between other actions)
ActionQueue_Delay
These variants allow you to interact with the action queue. Any of the ActionPush_ variants will set the specified action as the currently active action, but existing action will resume when it completes. ActionQueue_ allow you to queue a number of actions in sequence. The existing Action_ functions will clear the queue entirely and set the specified action as the active action.
So for example, if you did this:
Action_MoveTo( X )
ActionPush_UseAbility( A )
ActionPush_UseAbility( B )
ActionQueue_UseAbility( C )
Your bot will UseAbility B, UseAbility A, MoveTo X, and UseAbility C.
After each function, the queue will look like this:
X
A X
B A X
B A X C
On the other hand, if you did this:
Action_MoveTo( X )
ActionPush_UseAbility( A )
Action_MoveTo( Y )
Your bot will simply MoveTo Y, because it clears the queue when executed.
Additionally, some of the Action_ functions don't interact with the queue at all, and are simply immediately executed. They have been renamed to have a ActionImmedate_ prefix:
ActionImmediate_Buyback
ActionImmediate_Chat
ActionImmediate_Courier
ActionImmediate_DisassembleItem
ActionImmediate_Glyph
ActionImmediate_LevelAbility
ActionImmediate_Ping
ActionImmediate_PurchaseItem
ActionImmediate_SellItem
ActionImmediate_SetItemCombineLock
ActionImmediate_SwapItems
And there were some revisions to the API related to this change:
Removed HasQueuedAction() from the unit bot script API.
Removed SetActionQueueing() from the unit bot script API.
Added NumQueuedActions() and GetQueuedActionType