Skip to content

utils

Methods

new_timer(interval, cbk): timer

Type Name Description Default
number interval Callback call interval (in milliseconds) none
function() cbk Callback function none

Creates a timer with given interval and callback function

1
2
3
4
local timer = utils.new_timer(1, function()
    print('Hey!')
end)
timer:start()

run_delayed(delay, fn)

Type Name Description Default
number interval Callback call delay none
function() fn Callback function none

Calls fn after delay milliseconds (only once!)

1
2
3
utils.run_delayed(1, function()
    print('Hey!')
end)

get_weapon_info(id): weapon_data

Type Name Description Default
number id Weapon ID none

Returns weapon data by weapon ID

1
local data = utils.get_weapon_info(1)

get_active_weapon_group()

Returns weapon group of active weapon for use in gui.set_weapon_group or nil if failed (dead/no gun/etc)

1
gui.set_weapon_group('rage', utils.get_active_weapon_group())

unsafe find_interface(module, interface_name): number

Type Name Description Default
string module Module to find interface in none
string interface_name Name of the interface with version none

Finds interface and returns pointer to it or nil on failure

1
local client = utils.find_interface('client_panorama.dll', 'VClient018')

unsafe find_pattern(module, pattern): number

Type Name Description Default
string module Module to scan none
string pattern IDA-style pattern none

Scans module for pattern and returns it's address or nil on failure

1
local something = utils.find_pattern('csgo.exe', 'DE AD BE EF ? ? ? ? C0 CC')

hsv_to_rgb(h, s, v): color

Type Name Description Default
number h Hue none
number s Saturation none
number v Brightness none

Translates HSV values into RGB color

1
local rgb = utils.hsv_to_rgb(180, 100, 50)

random_int(min, max): number

Type Name Description Default
number min Minimal value none
number max Maximal value none

Returns random int from min to max

1
local rnd = utils.random_int(0, 100)

random_float(min, max): number

Type Name Description Default
number min Minimal value none
number max Maximal value none

Returns random float from min to max

1
local rnd = utils.random_float(12.34, 567.8)