🔧Engine
Table to work with game engine.
IsInGame(): boolean
boolean
Returns true
if the game is in progress.
IsShopOpen(): boolean
boolean
Returns true
if the shop is open.
SetQuickBuy(item_name: string
, reset [?]
: boolean
): nil
string
, reset [?]
: boolean
): nil
item_name
string
The name of the item to quick buy. (e.g. blink
, relic
)
reset [?]
boolean
Reset the quick buy list. (default: true)
Add item to quick buy list.
RunScript(script: string
, contextPanel [?]
: string
): boolean
string
, contextPanel [?]
: string
): boolean
script
string
The script to run.
contextPanel [?]
string
The name of the panel to run the script in. (default: "Dashboard")
Run a JS script in the panorama context. Return true
if the script was executed
successfully. JS
documentation
Example
ExecuteCommand(command: string
): nil
string
): nil
command
string
The command to execute.
Execute a console command.
Example
PlayVol(sound: string
, volume [?]
: number
): nil
string
, volume [?]
: number
): nil
sound
string
The sound to play. Could find in sounds
folder in pak01_dir.vpk
file.
volume [?]
number
The volume of the sound. (default: 0.1)
Play a sound with a specific volume.
Example
CanAcceptMatch(): boolean
boolean
Returns true
if the player can accept the match.
GetGameDirectory(): string
string
Returns the current game directory. (e.g. dota 2 beta
)
GetCheatDirectory(): string
string
Returns the current cheat directory.
GetLevelName(): string
string
Returns the current level name. (e.g. maps/hero_demo_main.vpk
)
GetLevelNameShort(): string
string
Returns the current level name without the extension and folder. (e.g. hero_demo_main
)
AcceptMatch(state: integer
): nil
integer
): nil
state
integer
DOTALobbyReadyState
Accept match.
ConsoleColorPrintf(r: integer
, g: integer
, b: integer
, a [?]
: integer
, text: string
): nil
integer
, g: integer
, b: integer
, a [?]
: integer
, text: string
): nil
r
integer
Red value.
g
integer
Green value.
b
integer
Blue value.
a [?]
integer
Alpha value. (default: 255)
text
string
Text to print.
Print a message to the dota console.
GetMMR(): integer
integer
Returns the current MMR.
GetMMRV2(): integer
integer
Returns the current MMR. Works better than Engine.GetMMR
.
Must be called from the game thread. Ex: OnNetUpdateEx, OnGCMessage, not OnFrame or on
initialization.
ReloadScriptSystem(): nil
nil
Executes script system reload.
ShowDotaWindow(): nil
nil
Brings the game window to the forefront if it is minimized. Use this function to make the game window the topmost window.
IsInLobby(): boolean
boolean
Returns true
if the player is in a lobby.
GetBuildVersion(): string
string
Returns the cheat version.
GetHeroIDByName(unitName: string
): integer|nil
string
): integer|nil
unitName
string
Can be retrieved from NPC.GetUnitName
Returns hero ID by unit name.
Example
GetDisplayNameByUnitName(unitName: string
): string|nil
string
): string|nil
unitName
string
Can be retrieved from NPC.GetUnitName
Returns hero display name by unit name.
Example
GetHeroNameByID(heroID: integer
): string|nil
integer
): string|nil
heroID
integer
Returns hero name by ID.
GetUIState(): Enum.UIState
Enum.UIState
Returns current UI state.
Last updated