Misc

Miscellaneous API features which I couldn't categorise anywhere else.

You can get up to date offsets directly from within Orbit. The usage may be a bit tricky, so make sure to pay attention to not mess up something accidentally.

GetOffset(string table offset_path, string file)

You first need to define a table of string elements, which reflects the path to the offset. To understand the structure of the offsets, just head over to "Resources/Offsets". Here you will see the data structure of the generated JSON files. Currently, Orbit only supports accessing "client.dll" and "offsets".

local localPlayerControllerPath = {"client.dll", "dwLocalPlayerController"} local dwLocalPlayerController = GetOffset(localPlayerControllerPath, "offsets")

Sometimes, getting the value of an offset can result in quite a long line of code. Don't worry though, since these paths rarely change from one cs2 update to the next, so that long line will probably feed you the correct offset for a long time.

local m_pGameSceneNode = GetOffset({"client.dll", "classes", "C_BaseEntity", "fields", "m_pGameSceneNode"}, "client.dll")

"GetScreenSize" returns a Vector2D object containing the width and height of the screen.

local ScreenSize = GetScreenSize() Print(tostring(ScreenSize[1])) --width Print(tostring(ScreenSize[2])) --height

"IsInGame" returns true if we are connected to a game.

if not IsInGame() then Print("We are not in a match, return from the IP Resolver") return end

"GetMapName" returns the current map name without the path and extension.

local function Test() Print(GetMapName()) --for example, this could print de_mirage end RegisterCallback(Test)

"GetAppDataDirectory" helps you store your downloaded files. You can also get the windows username, since the path to the appdata folder contains it.

Since Orbit V11.0.6 this function is deprecated, as the tie to AppData was removed.

Instead, this function returns the path to the Resources folder Orbit is shipped with.

local AppDataDirectory = GetAppDataDirectory() HttpDownload("link", AppDataDirectory .. "\\Orbit\\filename.extension")

"DirectoryExists" in combination with "GetAppDataDirectory" can tell you if a download was successful or not. A failed download can be a result of 2 things: http functions are disabled, download link is invalid.

HttpDownload("link", AppDataDirectory .. "\\Orbit\\filename.extension") if not DirectoryExists(AppDataDirectory .. "\\Orbit\\filename.extension") then Print("Download failed.") end

"PlaySound" lets you play a sound file. You don't need to specify a path if the sound file is where Orbit is located.

PlaySound("path/to/file")

"RayCast" uses the built in VPK Parser in Orbit to perform a visible check based on the arguments, which are 2 Vector3D objects.

The return value is a bool, true if visible, false if not.

local Visible = RayCast(Vector3D(0, 0, 0), Vector3D(25, 25, 25)) Print("The two 3D points see eachother: " .. tostring(Visible))

"GetTime" simply returns the time since epoch with millisecond accuracy.

Can be used to do simple timers in LUA.

local Now = GetTime() if LastTime < Now then Print("500ms has passed") LastTime = Now + 500 end

Play a sound file from the virtual audio device (into the microphone)

Make sure the menu is closed when calling this function

local LastTime = GetTime() local function KayaEverySecond() local CurTime = GetTime() if CurTime - LastTime > 1000 then PlayVirtualAudioFile("Kaya.wav") CurTime = LastTime end end RegisterCallback(KayaEverySecond)

Executes any in‑game command that a player could normally trigger through their own inputs (chat messages, movement keys, action keys, etc.).

Instead of pressing keys or typing manually, Lua scripts can perform those actions automatically.

Orbit does not bypass protected convars, so executing "sv_cheats 1" won't do anything.

ExecuteConsoleCommand("say hi") --sends 'hi' in public chat ExecuteConsoleCommand("+forward") --starts moving forward ExecuteConsoleCommand("+voicerecord") --opens the microphone


On This Page
Misc