📜GameRules
Table to work with GameRules.
GetServerGameState(): Enum.GameState
Enum.GameState
Returns the current server game state.
GetGameState(): Enum.GameState
Enum.GameState
Returns the current game state.
GetGameMode(): Enum.GameMode
Enum.GameMode
Returns the current game mode.
GetPreGameStartTime(): number
number
Pregame time is the time before the game starts, e.g. ban phase, pick time.
Returns pregame duration or 0 if now is pregame time.
GetGameStartTime(): number
number
Game start time is 0:00 on ingame timer.
Returns game start time duration or 0 if game is not start yet.
GetGameEndTime(): number
number
Returns game end time or 0 if game is not end yet.
GetGameLoadTime(): number
number
No idea what this function does. Returns 0 in all cases what I've tested.
GetGameTime(): number
number
Can be used to calculate time in an in-game timer. See the example.
Returns the current game time. Starts counting from pregame state.
Example
IsPaused(): boolean
boolean
Returns true
if game is paused.
IsTemporaryDay(): boolean
boolean
Example: Phoenix's Supernova.
Returns true
if it's temporary day.
IsTemporaryNight(): boolean
boolean
Example: Luna's Eclipse.
Returns true
if it's temporary night.
IsNightstalkerNight(): boolean
boolean
Returns true
if it's nightstalker's night.
GetMatchID(): integer
integer
Returns current match id.
GetLobbyID(): integer
integer
Returns current lobby id.
GetGoodGlyphCD(): number
number
Could be less than current game time if glyph is already available.
Returns game time when next radiant glyph will be available.
GetBadGlyphCD(): number
number
Could be less than current game time if glyph is already available.
Returns game time when next dire glyph will be available.
GetGoodScanCD(): number
number
Could be less than current game time if scan is already available.
Returns game time when next radiant scan will be available.
GetBadScanCD(): number
number
Could be less than current game time if scan is already available.
Returns game time when next dire scan will be available.
GetGoodScanCharges(): integer
integer
Returns current radiant scan charges.
GetGoodScanCharges(): integer
integer
Returns current dire scan charges.
GetStockCount(item_id: integer
): integer
integer
): integer
Item id can be found in `assets/data/items.json` file in cheat folder.
Returns amount of remaining items in shop by item id.
Example
GetNextCycleTime(): number
, boolean
number
, boolean
Return time remaining to the next cycle.
GetDaytimeStart(): number
number
Returns day start time. To work with it use GameRules.GetTimeOfDay
GetNighttimeStart(): number
number
Returns night start time. To work with it use GameRules.GetTimeOfDay
GetTimeOfDay(): number
number
Returns current time of day time.
IsInBanPhase(): boolean
boolean
Returns true
if game is in ban phase.
GetAllDraftPhase(): integer
integer
Returns index of the current draft phase.
IsAllDraftPhaseRadiantFirst(): boolean
boolean
Returns true
if Radiant picks first.
GetDOTATime(pregame [?]
: boolean
, negative [?]
: boolean
): number
[?]
: boolean
, negative [?]
: boolean
): number
Returns the actual DOTA in-game clock time.
GetLobbyObjectJson(): string|nil
string|nil
Returns CSODOTALobby protobuf object as JSON string.
GetBannedHeroes(): integer[]|nil
integer[]|nil
Returns zero-based array of banned heroes where index corresponds to the player id.
GetStateTransitionTime(): number
number
Returns time remaining between state changes.
Last updated