Onetap v3 Re:Run Javascript globals¶
-
__filename
¶ Filename of the running script.
- Type
string
Classes¶
-
class
Reference
(...path)¶ - Arguments
...path (string) – Path to the javascript element
-
Reference.
path
¶ - Type
Array[string]
-
Reference.
GetValue
()¶ Returns the value of this UI element.
Example:
FAKELAG_ENABLED = new Reference("Anti-Aim", "Fake-Lag", "Enabled") FAKELAG_LIMIT = new Reference("Anti-Aim", "Fake-Lag", "Limit") function GetFakelag() { if(!FAKELAG_ENABLED.GetValue()) return 0; // fakelag disabled return FAKELAG_LIMIT.GetValue(); }
- Returns
The value of the element
- Return type
Any
-
Reference.
SetValue
(value)¶ Sets the value of this UI element.
Example:
FAKELAG_ENABLED = new Reference("Anti-Aim", "Fake-Lag", "Enabled") function disableFakelag() { FAKELAG_ENABLED.SetValue(false); }
- Arguments
...path (string) – Path of the element
value (Any) – New value
-
Reference.
SetEnabled
(value)¶ Enables/disables this element.
- Arguments
value (boolean) – Whether to enable or disable
-
Reference.
GetString
()¶ Returns the value of this textbox element.
- Returns
The value of the element
- Return type
string
-
Reference.
GetColor
()¶ Returns the value of this colorpicker element.
- Returns
The value of the element
- Return type
-
Reference.
SetColor
(value)¶ Sets the value of the colorpicker element at the specified path to the color.
- Arguments
...path (string) – Path of the element
color (
RGBA()
) – New color
-
Reference.
IsHotKeyActive
()¶ Returns if the hotkey of this element is being held/pressed.
- Returns
If the hotkey is being held/pressed
- Return type
boolean
-
Reference.
ToggleHotkey
()¶ Simulates pressing the hotkey for this element.
- Returns
New state of the hotkey, 1 is active, 0 means inactive
- Return type
integer
-
class
Entity
(entityindex)¶ - Arguments
entityindex (integer) – Entityindex of the entity
-
Entity.
entityindex
¶ - Type
integer
-
Entity.
IsTeammate
()¶ Returns if this entity is a teammate.
- Returns
Entity is a teammate
- Return type
boolean
-
Entity.
IsEnemy
()¶ Returns if this entity is an enemy.
- Returns
Entity is an enemy
- Return type
boolean
-
Entity.
IsBot
()¶ Returns if this entity is a bot.
- Returns
Entity is a bot
- Return type
boolean
-
Entity.
IsLocalPlayer
()¶ Returns if this entity matches yourself.
- Returns
Entity is yourself
- Return type
boolean
-
Entity.
IsValid
()¶ Returns if this entity is valid.
- Returns
Entity is valid
- Return type
boolean
-
Entity.
IsAlive
()¶ Returns if this entity is alive.
- Returns
Entity is alive
- Return type
boolean
-
Entity.
IsDormant
()¶ Returns if this entity is dormant.
- Returns
Entity is dormant
- Return type
boolean
-
Entity.
GetClassID
()¶ Returns the class id of the class this entity belongs to.
- Returns
Class id of the entity
- Return type
integer
-
Entity.
GetClassName
()¶ Returns the name of the class this entity belongs to.
- Returns
Class name of the entity
- Return type
string
-
Entity.
GetName
()¶ Returns the name of this entity.
- Returns
Name of the entity
- Return type
string
-
Entity.
GetWeapon
()¶ Returns the current held weapon entity.
- Returns
Held weapon
- Return type
-
Entity.
GetWeapons
()¶ Returns all weapons this entity has.
- Returns
All weapons of this entity
- Return type
Array[
Entity()
]
-
Entity.
GetRenderOrigin
()¶ Returns position of this entity.
- Returns
Position of this entity
- Return type
Vector3
-
Entity.
GetRenderBox
()¶ Returns the render box of this entity.
- Returns
An array comprising of: valid/invalid (boolean), min X, min Y, max X, max Y
- Return type
Array
-
Entity.
GetProp
(table, propname)¶ Returns the value of the prop of this entity. table is most of the time the name of the entity’s class, e.g. CCSPlayer for players.
- Arguments
table (string) – Name of entity’s class
propname (string) – Name of the prop
- Returns
The value
- Return type
Any
-
Entity.
SetProp
(table, propname, value)¶ Sets the value of the prop of this entity. table is most of the time the name of the entity’s class, e.g. CCSPlayer for players.
- Arguments
table (string) – Name of entity’s class
propname (string) – Name of the prop
value (Any) – The value
-
Entity.
GetHitboxPositions
(hitboxindex)¶ Returns position of the hitbox.
- Arguments
hitgroup (integer) – Hitboxindex of the hitbox
- Returns
Position of the hitbox
- Return type
-
Entity.
GetEyePosition
()¶ Returns position of the eye hitbox.
- Returns
Position of the eye hitbox
- Return type
-
class
Material
(material)¶ - Arguments
material (string) – Name of the material
-
Material.
name
¶ Name of the material
- Type
string
-
Material.
SetKeyValue
(key, value)¶ Overrides values.
Note
See also:
Note
Can only be used during a
Material()
callback.- Arguments
key (string) – Key
value (string) – value
-
Material.
Refresh
()¶ Refreshes the material with the new values from
Material.SetKeyValue()
.Note
Can only be used during a
Material()
callback.
-
class
Vector2
(x, y)¶ A 2d vector
- Arguments
x (number) – x position
y (number) – y position
-
Vector2.
pack
()¶
-
Vector2.
unpack
(array)¶
-
class
Vector3
(x, y, z)¶ A 3d vector
- Arguments
x (number) – x position
y (number) – y position
z (number) – z position
-
Vector3.
pack
()¶
-
Vector3.
unpack
(array)¶
-
class
Angles
(pitch, yaw, roll)¶ An angle.
- Arguments
pitch (number) – pitch
yaw (number) – yaw
roll (number) – roll
-
Angles.
pack
()¶
-
Angles.
unpack
(array)¶
-
class
RGBA
(r, g, b, a)¶ A RGBA color.
- Arguments
r (integer) – red channel
g (integer) – green channel
b (integer) – blue channel
a (integer) – alpha (transparency)
-
RGBA.
pack
()¶
-
RGBA.
unpack
(array)¶
Globals¶
-
Globals.
Tickcount
()¶ Returns the current tick.
- Returns
Current tick
- Return type
integer
-
Globals.
Tickrate
()¶ Returns the current tickrate, aka how many ticks the server is running per second.
It is 64 in matchmaking and most community servers.
- Returns
Tickrate
- Return type
integer
-
Globals.
TickInterval
()¶ Returns the delay between each tick.
Equivalent to:
function TickInterval() { return 1 / Global.Tickrate(); }
- Returns
Tickinterval in seconds
- Return type
float
-
Globals.
Curtime
()¶ Returns the current time of the server.
- Returns
Current time in seconds
- Return type
float
-
Globals.
Realtime
()¶ Returns the time in seconds since CS:GO was started.
- Returns
Time in seconds
- Return type
float
-
Globals.
Frametime
()¶ Returns the time the last frame took to render.
- Returns
Time in seconds
- Return type
float
Sound¶
-
Sound.
Play
(filename)¶ Plays a sound from a .wav file.
- Arguments
filename (string) – Filename of the sound
-
Sound.
PlayMicrophone
(filename)¶ Plays a sound from a .wav file over your microphone.
- Arguments
filename (string) – Fileanme of the sound
-
Sound.
StopMicrophone
()¶ Interrupt the playing sound from
Sound.PlayMicrophone()
.
Cheat¶
-
Cheat.
GetUsername
()¶ Returns the onetap username, but in OTCv3 this is replaced by the steam name on injection.
- Returns
Onetap username or steam name
- Return type
string
-
Cheat.
RegisterCallback
(callback, function)¶ Registers a callback, valid callbacks can be found here.
Example:
Global.RegisterCallback("CreateMove", function() { // gets called every tick });
- Arguments
callback (string) – Name of the callback.
name (string) – Name of the callback function.
-
Cheat.
ExecuteCommand
(command)¶ Executes a command in the CS:GO console.
- Arguments
command (string) – The command to execute.
-
Cheat.
FrameStage
()¶ Returns the current frame stage.
Stage
Meaning
0
Frame Start
1
Frame NetUpdate Start
2
Frame NetUpdate PostDataUpdate Start
3
Frame NetUpdate PostDataUpdate End
4
Frame NetUpdate End
5
Frame Render Start
6
Frame Render End
- Returns
Current frame stage
- Return type
integer
Note
Can only be used during a
FrameStageNotify()
callback.
-
Cheat.
Print
(text)¶ Prints text into the CS:GO console.
- Arguments
text (string) – The text to print into the console.
-
Cheat.
PrintChat
(text)¶ Prints colored text into the chat.
You can use special bytes to change the color.
Byte
Color
Byte
Color
Byte
Color
Byte
Color
\x01
White
\x05
Lighter green
\x09
Gold
\x0D
Dark purple
\x02
Dark red
\x06
Light green
\x0A
Gray
\x0E
Light purple
\x03
Purple
\x07
Red
\x0B
Aqua
\x0F
Light red
\x04
Green
\x08
Gray
\x0C
Blue
\xA0
N/A
- Arguments
text (string) – The text to print into the chat.
Note
The text is clientside, so only you can see the text.
Local¶
-
Local.
Latency
()¶ Returns your latency to the server.
- Returns
Latency in seconds.
- Return type
float
-
Local.
GetViewAngles
()¶ Returns the current viewangles of yourself.
Example:
Global.RegisterCallback("Draw", function() { const angles = Global.GetViewAngles(); Render.String(5, 5, 0, "Angles: pitch=" + angles.pitch + " yaw=" + angles.yaw + " roll=" + angles.roll, [255, 0, 0, 255]); });
- Returns
Current viewangles
- Return type
-
Local.
SetViewAngles
(angles)¶ Sets the current viewangles of yourself.
- Arguments
angles (
Angles()
) – New viewangles.
-
Local.
SetClanTag
(tag)¶ Sets the current clantag.
- Arguments
tag (string) – Clantag to change to.
-
Local.
GetRealYaw
()¶ Returns the current yaw of your real.
- Returns
Absolute yaw of the real
- Return type
float
-
Local.
GetFakeYaw
()¶ Returns the current yaw of your fake.
- Returns
Absolute yaw of the fake
- Return type
float
-
Local.
GetSpread
()¶ Returns the S P R E A D of the current selected gun.
- Returns
Gun spread
- Return type
float
-
Local.
GetInaccuracy
()¶ Returns the inaccuracy of the current selected gun with moving inaccuracy calculations.
- Returns
Shot inaccuracy
- Return type
float
World¶
-
World.
GetMapName
()¶ Returns the current map name.
Examples:
de_dust2
de_mirage
cs_office
- Returns
Current map name
- Return type
string
-
World.
GetServerString
()¶ Returns the current server (ip, port, offline match, …) as a string. This is used in the watermark.
- Returns
Current server as string
- Return type
string
Input¶
-
Input.
GetCursorPosition
()¶ Returns the current position of the cursor.
- Returns
Cursorposition
- Return type
-
Input.
IsKeyPressed
(key)¶ Returns if the key is currently pressed.
- Arguments
key (integer) – Virtual Key Codes
- Returns
If the key is is pressed
- Return type
boolean
Render¶
Note
Can only be used during a Draw()
callback.
-
Render.
String
(x, y, align, text, color[, size])¶ Renders the string text at x|y. Align 0 is left-aligned and everything else is centered.
- Arguments
text (string) – Text to write
x (integer) – x position
y (integer) – y position
color (
RGBA()
) – Colorsize (integer) – Size of the text
-
Render.
TextSize
(text[, size])¶ Returns the size of the text.
- Arguments
text (string) – Text to measure
size (integer) – Size of the text
- Returns
Size the text would take
- Return type
-
Render.
Line
(x1, y1, x2, y2, color)¶ Renders a line from x1|y1 to x2|y2.
- Arguments
x1 (integer) – x position of the start
y1 (integer) – y position of the start
x2 (integer) – x position of the end
y2 (integer) – y position of the end
color (
RGBA()
) – Color
-
Render.
Rect
(x, y, width, height, color)¶ Renders a rectangle from x|y with the width width and height height.
- Arguments
x (integer) – x position
y (integer) – y position
width (integer) – width
height (integer) – height
color (
RGBA()
) – Color
-
Render.
FilledRect
(x, y, width, height, color)¶ Renders a rectangle from x|y with the width width and height height filled with color.
- Arguments
x (integer) – x position
y (integer) – y position
width (integer) – width
height (integer) – height
color (
RGBA()
) – Color
-
Render.
GradientRect
(x, y, width, height, color1, color2)¶ Renders a rectangle from x|y with the width width.
-
Render.
Circle
(x, y, r, color)¶ Renders a circle at x|y.
- Arguments
x (integer) – x position
y (integer) – y position
r (integer) – radius of the circle
color (
RGBA()
) – Color
-
Render.
Polygon
(points, color)¶ Renders a polygon/triangle, the 3 corners are in points.
Example:
Cheat.RegisterCallback("Draw", function() { Render.Polygon([[50, 0], [25, 50], [75, 50]], [255, 0, 0, 255]); });
-
Render.
WorldToScreen
(position)¶ Returns screen position from world position.
-
Render.
AddFont
(name, size, weight)¶ Returns font object.
- Arguments
name (string) – Name of the font
size (integer) – Font size
weight (integer) – Font weight
- Returns
Font object
- Return type
Any
-
Render.
FindFont
(name, size, weight)¶ Returns font object.
- Arguments
name (string) – Name of the font
size (integer) – Font size
weight (integer) – Font weight
- Returns
Font object
- Return type
Any
-
Render.
StringCustom
(x, y, align, text, color, font)¶ Renders the string text at x|y with a custom font.
- Arguments
x (integer) – x position
y (integer) – y position
align (integer) – How to align the text
text (string) – Text to write
color (
RGBA()
) – Colorfont (Font) – Font
-
Render.
TexturedRect
(x, y, width, height, texture)¶ Renders the texture texture at x|y with the width width and height height.
- Arguments
x (integer) – x position
y (integer) – y position
width (integer) – with
height (integer) – height
texture (Texture) – Texture
-
Render.
AddTexture
(filename)¶ Returns a texture loaded from a file.
- Arguments
filename (string) – Filename of the image
- Returns
Texture from the file
- Return type
Texture
-
Render.
TextSizeCustom
(text, font)¶ Returns the size of the text with a custom font.
- Arguments
text (string) – Text
font (Font) – Font
- Returns
Size of the text
- Return type
UI¶
-
UI.
AddCheckbox
(name)¶ Adds a checkbox element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the checkbox
- Returns
A Reference to the element
- Return type
-
UI.
AddSliderInt
(name[, min[, max])¶ Adds a slider element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the slider
min (integer) – Minimal value
max (integer) – Maximal value
- Returns
A Reference to the element
- Return type
-
UI.
AddSliderFloat
(name[, min[, max])¶ Adds a slider element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the slider
min (float) – Minimal value
max (float) – Maximal value
- Returns
A Reference to the element
- Return type
-
UI.
AddHotkey
(name)¶ Adds a hotkey element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the hotkey
- Returns
A Reference to the element
- Return type
-
UI.
AddLabel
(text)¶ Adds a label element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
text (string) – The text to add
- Returns
A Reference to the element
- Return type
-
UI.
AddDropdown
(name, options)¶ Adds a dropdown element to “Misc”, “JAVASCRIPT”, “Script Items”.
Example:
reference = UI.AddDropdown("sample dropdown", ["option 1", "option 2"]) reference.GetValue() == 0 // selected by default
- Arguments
name (string) – Name of the dropdown
options (Array[options]) – Array of options
- Returns
A Reference to the element
- Return type
-
UI.
AddMultiDropdown
(name, options)¶ Adds a multidropdown element to “Misc”, “JAVASCRIPT”, “Script Items”.
Example:
reference = UI.AddMultiDropdown("sample dropdown", ["option 1", "option 2"]) reference.GetValue() == [] // empty list because nothing is selected
- Arguments
name (string) – Name of the multidropdown
options (Array[options]) – Array of options
-
UI.
AddColorPicker
(name)¶ Adds a colorpicker element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the colorpicker
-
UI.
AddTextbox
(name)¶ Adds a textbox element to “Misc”, “JAVASCRIPT”, “Script Items”.
- Arguments
name (string) – Name of the textbox
-
UI.
IsMenuOpen
()¶ Returns if the menu is opened.
- Returns
If the menu is opened
- Return type
boolean
Convar¶
-
Convar.
GetInt
(name)¶ Returns the current value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
- Returns
Value of the ConVar
- Return type
integer
-
Convar.
SetInt
(name, value)¶ Sets the value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
value (integer) – New value
-
Convar.
GetFloat
(name)¶ Returns the current value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
- Returns
Value of the ConVar
- Return type
float
-
Convar.
SetFloat
(name, value)¶ Sets the value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
value (float) – New value
-
Convar.
GetString
(name)¶ Returns the current value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
- Returns
Value of the ConVar
- Return type
string
-
Convar.
SetString
(name, value)¶ Sets the value of the specified ConVar.
- Arguments
name (string) – Name of the ConVar
value (string) – New value
Event¶
Note
Can only be used during a CS:GO Event and a Special Cheat Event.
-
Event.
GetInt
(name)¶ Returns the integer representation of the specified name.
- Returns
Value of the name
- Return type
integer
-
Event.
GetFloat
(name)¶ Returns the floating point representation of the specified name.
- Returns
Value of the name
- Return type
float
-
Event.
GetString
(name)¶ Returns the string representation of the specified name.
- Returns
Value of the name
- Return type
string
Entities¶
-
Entities.
GetEntitiesByClassID
(classid)¶ Returns all entities with a matching class id.
- Arguments
classid (integer) – classid
- Returns
All matching entities
- Return type
-
Entities.
GetEnemies
()¶ Returns all players in the enemy team.
- Returns
All enemies
- Return type
Array[
Entity()
]
-
Entities.
GetTeammates
()¶ Returns all players your team.
- Returns
All teammates
- Return type
Array[
Entity()
]
-
Entities.
GetGameRulesProxy
()¶ Returns the game rules entity
- Returns
Entity of the game rules
- Return type
Trace¶
-
Trace.
Line
(entityindex, start, end)¶ Traces a line between start and end
-
Trace.
Bullet
(?)¶ Warning
Undocumented function.
UserCMD¶
Note
Can only be used during a CreateMove()
callback.
-
UserCMD.
SetMovement
(movement)¶ Sets the movement for the current move command.
- Arguments
movement (
Vector3()
) – The new movement
-
UserCMD.
GetMovement
()¶ Returns the planned movement for the current move command.
- Returns
The movement
- Return type
-
UserCMD.
SetAngles
(angles)¶ Sets the viewangles for the current move command.
- Arguments
angles (
Angles()
) – The angles
Note
You can use
Local.GetViewAngles()
to get them.
-
UserCMD.
ForceJump
(value)¶ Forces the command to jump/not jump.
- Arguments
value (boolean) – Whether to force jump or not
-
UserCMD.
ForceCrouch
(value)¶ Forces the command to crouch/not crouch.
- Arguments
value (boolean) – Whether to force crouch or not
AntiAim¶
-
AntiAim.
GetOverride
()¶ Returns 1 if the antiaim is being managed by a script, 0 otherwise.
- Returns
If antiaim is mangaged by a script
- Return type
integer
-
AntiAim.
SetOverride
(state)¶ Enable/disable mangagment of the antiaim.
- Arguments
state (boolean) – 1 to enable, 0 to disable
Note
Booleans (true/false) are not supported!
-
AntiAim.
SetRealOffset
(degree)¶ Sets the real offset.
- Arguments
degree (integer) – Real offset from yaw.
Note
AntiAim.GetOverride()
must return 1 before this affects anything.
-
AntiAim.
SetFakeOffset
(degree)¶ Offsets yaw offset by degree.
- Arguments
degree (integer) – Offsets yaw.
Note
AntiAim.GetOverride()
must return 1 before this affects anything.
-
AntiAim.
SetLBYOffset
(degree)¶ Sets the fake offset.
- Arguments
degree (integer) – Fake offset from yaw.
Note
AntiAim.GetOverride()
must return 1 before this affects anything.
Exploit¶
-
Exploit.
GetCharge
()¶ Returns the current doubletap charge percentage and -1 when disabled.
- Returns
Doubletap charge in percent
- Return type
float
-
Exploit.
Recharge
()¶ Forces the ragebot to recharge the doubletap asap.
-
Exploit.
DisableRecharge
()¶ Disables automatic recharge.
-
Exploit.
EnableRecharge
()¶ Re-enables automatic recharge.
Ragebot¶
-
Ragebot.
GetTarget
()¶ Returns the entity targetted by the ragebot.
- Returns
Entityindex of ragebot target
- Return type
integer
-
Ragebot.
IgnoreTarget
(entityindex)¶ Ignores the entity matching entityindex.
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
entityindex (integer) – Entityindex of the entity
-
Ragebot.
ForceTarget
(entityindex)¶ Forces the ragebot to shoot at the entity whenever possible.
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
entityindex (integer) – Entityindex of the entity
-
Ragebot.
ForceTargetSafety
(entityindex)¶ Forces safety on a specific entity. (safepoint)
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
entityindex (integer) – Entityindex of the entity
-
Ragebot.
ForceTargetHitchance
(entityindex, hitchance)¶ Forces a minimum hitchance for entity.
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
entityindex (integer) – Entityindex of the entity
hitchance (integer) – Hitchance to force
-
Ragebot.
ForceTargetMinimumDamage
(entityindex, minimum_damage)¶ Forces the minimum damage for entity.
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
entityindex (integer) – Entityindex of the entity
minimum_damage (integer) – Damage to force
-
Ragebot.
ForceHitboxSafety
(hitboxindex)¶ Forces safety on a specific hitbox. (safepoint)
Note
Only active for one tick and must be called in a
CreateMove()
callback.- Arguments
hitboxindex (integer) – Hitboxindex of the hitbox
Materials¶
-
Materials.
Create
(name)¶ Creates a material.
- Arguments
name (string) – Name of the material
- Returns
If the creation was successful
- Return type
-
Materials.
Get
(name)¶ Returns the material index.
Note
Can only be used during a
Material()
callback.- Arguments
name (string) – Name of the material
- Returns
Materialindex
- Return type