Skip to main content

Game

Game info and functions.

Properties

localPlayer: AIHeroClient

Functions

GetLatency

Game.GetLatency() number

Returns your current latency.


GetTickCount

Game.GetTickCount() integer

Returns game tick count now.


GetTime

Game.GetTime() number

Returns game clock time now.


fnvhash

Game.fnvhash(str: string) integer

ArgumentTypeDescription
strstringString for calculate(case ignore).

Returns fnvhash of string.


spelldataHash

Game.spelldataHash(str: string) integer

ArgumentTypeDescription
strstringString for calculate(case ignore).

Returns spelldataHash of string.


TranslateString

Game.TranslateString(str: string) string

ArgumentTypeDescription
strstringString key to translate. You may use displayName value from https://127.0.0.1:2999/liveclientdata/playerlist

Returns translated string.


GameID

Game.GameID() number

Returns game id.


GameMode

Game.GameMode() string

Returns game mode.


GameType

Game.GameType() string

Returns game type.


IsMatchmadeGame

Game.IsMatchmadeGame() boolean

Returns if game is not custom.


GetCherryStage

Game.GetCherryStage() number

Returns current Arena stage. 2 - combat stage.


Region

Game.Region() string

Returns game region.


MapID

Game.MapID() integer

Returns game map id.


MapName

Game.MapName() string

Returns game map name.


IsWallOfType

Game.IsWallOfType(pos: Vector2 or Vector3, flag: CellFlag, radius: number) boolean

ArgumentTypeDescription
posVector2 or Vector3Check pos.
flagCellFlagFlag for check.
radiusnumberRange for check.

Returns pos is wall of type wall.


IsInFoW

Game.IsInFoW(pos: Vector3) boolean

ArgumentTypeDescription
posVector3Check pos.

Returns pos is in fow.


GetSpellByHash

Game.GetSpellByHash(spellHash: number) Spell

ArgumentTypeDescription
spellHashnumber - integerSpell hash.

Get Spelldata by spell hash.

Example: Get spell data info value
local WSpell = Game.GetSpellByHash(Game.spelldataHash("PickACard")) -- You can get spelldata by hash
if WSpell then
local sucusss,value = WSpell:GetCalculateInfo(Game.fnvhash("GoldBase"), W:DataInstance().level)
print(value)
end

GetHoveredUnit

Game.GetHoveredUnit() AttackableUnit

Get target under our cursor.

Example: Force target under our cursor.
Callback.Bind(CallbackType.OnTick, function()
local hover = Game.GetHoveredUnit()
TargetSelector.SetForcedTarget(hover and hover:IsValid() and hover or nil)
end)

GetSelectedTarget

Game.GetSelectedTarget() AttackableUnit

Get manually selected (clicked) target.


GetCursorWorldPosition

Game.GetCursorWorldPosition() Vector3

Get cursor world position


SpecialPathObstacle

Game.SpecialPathObstacle(position: Vector2, radius: number) SpecialPathObstacle

ArgumentTypeDescription
positionVector2Obstacle position.
radiusnumber - floatObstacle radius.

Create obstacle instance to be used with CreateSpecialPath


CreatePath

Game.CreatePath(startPos: Vector2, endPos: Vector2, bSmoothPath: boolean) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
startPosVector2Start position.
endPosVector2End position.
bSmoothPathbooleanReturn smooth path. Recommended to use true.

Returns calculated path from given start position to given end position.


CreatePath

Game.CreatePath(startPos: Vector3, endPos: Vector3, bSmoothPath: boolean) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
startPosVector3Start position.
endPosVector3End position.
bSmoothPathbooleanReturn smooth path. Recommended to use true.

Returns calculated path from given start position to given end position.


CreatePath

Game.CreatePath(endPos: Vector2, bSmoothPath: boolean) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
endPosVector2End position.
bSmoothPathbooleanReturn smooth path. Recommended to use true.

Returns calculated path from player position to given end position.


CreatePath

Game.CreatePath(endPos: Vector2, bSmoothPath: boolean) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
endPosVector2End position.
bSmoothPathbooleanReturn smooth path. Recommended to use true.

Returns calculated path from player position to given end position.


CreateSpecialPath

Game.CreateSpecialPath(
startPos: Vector2,
endPos: Vector2,
includeAllies?: boolean,
rangeFilter?: number,
extraCollisionRadius?: number,
excludeObjectHandles?: table,
smoothPath?: boolean
) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
startPosVector2Start position.
endPosVector2End position.
includeAllies?booleanInclude friendly units or not. False by default.
rangeFilter?number - floatAdd "fake walls" only to units within this range from start position. 500 by default.
extraCollisionRadius?number - floatExtra pathfinding collision radius. 0 by default.
excludeObjectHandles?table - std::unordered_set<unsigned>Handle list of all objects you want to exclude.
smoothPath?booleanReturn smooth path. True by default.

Returns special calculated path from given start position to given end position, but it adds "fake walls" under each minion and hero within given range.

Example: Get special path from player position to cursor. Useful for movement checks inside groups of minions and close to heroes.
Callback.Bind(CallbackType.OnDraw, function()
-- Example 1: Basic usage with friendly units, 1000 rangeFilter:
-- local path = Game.CreateSpecialPath(Game.localPlayer.position2D, Game.GetCursorWorldPosition():To2D(), true, 1000)

-- Example 2: include friendly units, 1000 rangeFilter, add 100 extra collision radius and ignore currently selected target:
local path = Game.CreateSpecialPath(Game.localPlayer.position2D, Game.GetCursorWorldPosition():To2D(), true, 1000, 100, { Game.GetSelectedTarget() and Game.GetSelectedTarget().handle or 0 })

if path and #path > 0 then
Renderer.DrawVectorPoly(path, 1, 0xFFFFFFFF) -- Draw full path (overload with std::vector<Vector2> argument)
end
end)

CreateSpecialPathEx

Game.CreateSpecialPathEx(
startPos: Vector2,
endPos: Vector2,
customObstacles?: table,
includeObjectTypes?: table,
includeAllies?: boolean,
rangeFilter?: number,
extraCollisionRadius?: number,
excludeObjectHandles?: table,
smoothPath?: boolean
) Vector2[] - std::vector<Vector2>

ArgumentTypeDescription
startPosVector2Start position.
endPosVector2End position.
customObstacles?table - std::vector<SpecialPathObstacle>A list of custom obstacles.
includeObjectTypes?table - std::unordered_set<ObjectType>A list of all game object types you want to include.
includeAllies?booleanInclude friendly units or not. False by default.
rangeFilter?number - floatAdd "fake walls" only to units within this range from start position. 500 by default.
extraCollisionRadius?number - floatExtra pathfinding collision radius. 0 by default.
excludeObjectHandles?table - std::unordered_set<unsigned>Handle list of all objects you want to exclude.
smoothPath?booleanReturn smooth path. True by default.

Returns special calculated path from given start position to given end position, but it adds "fake walls" under selected objects and custom obstacles.

Example: Get special path from player position to cursor. Useful for movement checks inside groups of minions and close to heroes.
Callback.Bind(CallbackType.OnDraw, function()
local path = Game.CreateSpecialPathEx(
Game.localPlayer.position2D,
Game.GetCursorWorldPosition():To2D(),
{
Game.SpecialPathObstacle(Game.localPlayer.position2D + Math.Vector2(500, 0), 100),
Game.SpecialPathObstacle(TurretTracker.GetClosestAllyTurretPosition(), 500),
},
{ ObjectType.AIHeroClient, ObjectType.AIMinionClient },
true,
1000,
400,
{ Game.GetSelectedTarget() and Game.GetSelectedTarget().handle or 0 }
)

if path and #path > 0 then
Renderer.DrawVectorPoly(path, 1, 0xFFFFFFFF) -- Draw full path (overload with std::vector<Vector2> argument)
end
end)

IssueOrder

Game.IssueOrder(orderType: IssueOrderType) boolean

ArgumentTypeDescription
orderTypeIssueOrderType

Issue order in safe way.


IssueOrder

Game.IssueOrder(orderType: IssueOrderType, position: Vector2) boolean

ArgumentTypeDescription
orderTypeIssueOrderType
positionVector2

Issue order in safe way to a position.


IssueOrder

Game.IssueOrder(orderType: IssueOrderType, position: Vector3) boolean

ArgumentTypeDescription
orderTypeIssueOrderType
positionVector3

Issue order in safe way to a position.


IssueOrder

Game.IssueOrder(orderType: IssueOrderType, target: AttackableUnit) boolean

ArgumentTypeDescription
orderTypeIssueOrderType
targetAttackableUnit

Issue order in safe way to a target.


DoEmote

Game.DoEmote(emoteType: Emote) void

ArgumentTypeDescription
emoteTypeEmote

Perform emote.


SendChat

Game.SendChat(msg: string) void

ArgumentTypeDescription
msgstringMessage to be sent. Use /all prefix if you want to send to All Chat.

Send chat message.


SendPing

Game.SendPing(
targetNetworkID: number,
position: Vector2,
pingType: PingType
) void

ArgumentTypeDescription
targetNetworkIDnumber - integerNetwork ID of the target to ping
positionVector2Positiong to ping
pingTypePingTypeUsed ping type

Send ping.


ShowPing

Game.ShowPing(
sourceHandle: number,
targetHandle: number,
position: Vector2,
pingType: PingType,
isPlaySound: boolean,
isTriggerEvent: boolean
) void

ArgumentTypeDescription
sourceHandlenumber - integerPing source handle
targetHandlenumber - integerPinged target handle
positionVector2Pinged position
pingTypePingTypeUsed ping type
isPlaySoundbooleanPlay sound or not
isTriggerEventbooleanTrigger event or not

Show ping locally.


IsCameraLocked

Game.IsCameraLocked() boolean

Returns if camera is locked


CameraLockToggle

Game.CameraLockToggle(state: boolean) void

ArgumentTypeDescription
statebooleanLock state

Returns if camera is locked