Engine
The Engine namespace provides Dota-side match, world, profile-request, clipboard, and runtime control helpers.
Dota Functions
CanAcceptMatch()boolean
Checks if the match can be accepted.
Returned:
- boolean - A boolean indicating whether the match can be accepted.
AcceptMatch(state?: number)void
Accepts the match.
statenumber (optional) - The state of the match. Default - 1 See DOTALobbyReadyState.
IsShopOpen()boolean
Checks if the shop is open.
Returned:
- boolean - A boolean indicating whether the shop is open.
IsScoreboardOpen()boolean
Checks if the scoreboard is open.
Returned:
- boolean - A boolean indicating whether the scoreboard is open.
IsMenuOpen()boolean
Checks if the menu is open.
Returned:
- boolean - A boolean indicating whether the menu is open.
IsInGame()boolean
Checks if the user is in game.
Returned:
- boolean - A boolean indicating whether the user is in game.
IsSearchMatch()boolean
Checks if the user is searching for a match.
Returned:
- boolean - A boolean indicating whether the user is searching for a match.
IsPointVisible(position: Vector)boolean
Checks if a point is visible (not in fog of war).
positionVector - The position vector of the point.
Returned:
- boolean - A boolean indicating whether the point is visible.
GetMapName()string
Retrieves the name of the current map.
Returned:
- string - The name of the current map.
GetGroundZ(position: Vector)number
Retrieves the ground Z coordinate at a given position.
positionVector - The position vector.
Returned:
- number - The ground Z coordinate.
GetCompetitiveMMR()number
Retrieves the competitive MMR of the player.
Returned:
- number - The competitive MMR of the player.
GetSteamID()string
Retrieves the Steam ID of the player.
Returned:
- string - The Steam ID of the player.
RegisterFireEvent(eventName: string)void
Registers a fire event.
eventNamestring - The name of the event.
WARNING
Used to add some events to OnFireEvent callback (like entity_hurt, etc). Do not use if Safe Mode is enabled. (See IsSafeMode)
ExecuteCommand(command: string)void
This function executes a command like in the console.
commandstring - The command to execute.
RequestProfile(steamID32: number, callback: (obj: any) => void)void
This function requests a profile.
steamID32number - The Steam ID of the profile.callback(obj: any) => void - The callback function to execute when the profile is retrieved.
IMPORTANT
Sends to GC CMsgProfileRequest message.
RequestProfileCard(steamID32: number, callback: (obj: any) => void)void
This function requests a profile card.
steamID32number - The Steam ID of the profile card.callback(obj: any) => void - The callback function to execute when the profile card is retrieved.
IMPORTANT
Sends to GC CMsgClientToGCGetProfileCard message.
GetDotaVersion()number
Returns current Dota version. Example: 6123
Returned:
- number - The requested dota version.
DrawWorldLine(start: Vector, end: Vector)void
Draws a world-space line between two positions.
BeginWorldLine(start: Vector)void
Begins a world-space line at the specified position.
startVector - The starting position.
ContinueWorldLine(end: Vector)void
Continues the current world-space line to the specified position.
endVector - The ending position.
EndWorldLine()void
Ends the current world-space line.
SetClipboardText(text: string)void
Copies a given text to the clipboard.
textstring - The text to be copied to the clipboard.
GetClipboardText()string
Retrieves the text from the clipboard.
Returned:
- string - The text from the clipboard.
EnableExecuteCommand(enable: boolean)void
Enables or disables Engine.ExecuteCommand.
enableboolean - Whether the feature should be enabled.
IsExecuteCommandEnabled()boolean
Checks whether Engine.ExecuteCommand is enabled.
Returned:
- boolean - True if the condition is met, false otherwise.
EnablePrepareUnitOrders(enable: boolean)void
Enables or disables prepare-unit-orders support.
enableboolean - Whether the feature should be enabled.
IsPrepareUnitOrdersEnabled()boolean
Checks whether prepare-unit-orders support is enabled.
Returned:
- boolean - True if the condition is met, false otherwise.
EnableParticles(enable: boolean)void
Enables or disables particles.
enableboolean - Whether the feature should be enabled.
IsParticlesEnabled()boolean
Checks whether particles are enabled.
Returned:
- boolean - True if the condition is met, false otherwise.
ReloadScripts()void
Reloads scripts.