client
functionclient.add_event_listener(event, callback)
add_event_listener
See list of events at Events & callbacks
Parameters
- Name
event- Type
- string
- Description
- Event name
- Name
callback- Type
- function
- Description
- Callback function to be ran when the event is fired
Returns
- Name
ref- Type
- number
- Description
- Returns ref to use in call to remove_event_listener
Example
local ref = client.add_event_listener('paint', function()
renderer.text(50, 50, 255, 255, 255, 255, 'Hello world!')
end)
client.remove_event_listener('paint', ref)
functionclient.remove_event_listener(event, ref)
remove_event_listener
Parameters
- Name
event- Type
- string
- Description
- Event name
- Name
ref- Type
- number
- Description
- Ref returned by call to add_event_listener
Example
local ref = client.add_event_listener('paint', function()
renderer.text(50, 50, 255, 255, 255, 255, 'Hello world!')
end)
client.remove_event_listener('paint', ref)
functionclient.camera_position()
camera_position
Returns
- Name
x- Type
- number
- Description
- Name
y- Type
- number
- Description
- Name
z- Type
- number
- Description
Example
local x, y, z = client.camera_position()
functionclient.screen_size()
screen_size
Returns
- Name
width- Type
- number
- Description
- Name
height- Type
- number
- Description
Example
local w, h = client.screen_size()
functionclient.find_signature()
find_signature
TODO:
Parameters
Returns
Example
local results = client.find_signature()
functionclient.key_state(vk)
key_state
Parameters
- Name
vk- Type
- number
- Description
Returns
- Name
is_down- Type
- boolean
- Description
Example
local is_spacebar_down = client.key_state(0x20)
functionclient.random_float(min, max)
random_float
Generates a pseudo-random float between min and max.
Parameters
- Name
min- Type
- number
- Description
- Name
max- Type
- number
- Description
Returns
- Name
random_float- Type
- number
- Description
Example
logger.info('Random float is %f', client.random_float(0, 1))
functionclient.random_int(min, max)
random_int
Generates a pseudo-random integer between min and max.
Parameters
- Name
min- Type
- number
- Description
- Name
max- Type
- number
- Description
Returns
- Name
random_int- Type
- number
- Description
Example
logger.info('Random int is %i', client.random_int(0, 100))
functionclient.system_time()
system_time
Returns the system time of your computer.
Returns
- Name
hour- Type
- number
- Description
- Name
minutes- Type
- number
- Description
- Name
seconds- Type
- number
- Description
- Name
milliseconds- Type
- number
- Description
Example
local h, m, s, ms = client.system_time()
logger.info('It's currently %02i:%02i:%02i.%i', h, m, s, ms)
functionclient.timestamp()
timestamp
Returns the current unix timestamp (in milliseconds).
Returns
- Name
milliseconds- Type
- number
- Description
Example
logger.info('The current unix timestamp is %i msec', client.timestamp())
functionclient.unix_time()
unix_time
Returns the current unix timestamp (in seconds).
Returns
- Name
seconds- Type
- number
- Description
Example
logger.info('The current unix timestamp is %i sec', client.unix_time())