interface

Interface Helper Library, loaded by requiring "gamesense/interface"

Functions

interface

interface(module_name: string, interface_name: string): cdata (interface object pointer)

Argument

Type

Description

module_name

string

Filename of the module that contains the interface

interface_name

string

Name of the interface

Creates an interface and returns an interface object pointer pointing to it

interface

interface(ptr: cdata / userdata): cdata (interface object pointer)

Argument

Type

Description

ptr

cdata / userdata

Pointer to an interface

Converts the given pointer to an interface object pointer and returns it

Usage

In order to bind functions to an interface object, you have to index it with any desirable name and set it to a table that contains 2 or more elements. The first being either an index or a pattern of the needed function, and the other ones being the type definition.

local surface = interface("vguimatsurface.dll", "VGUI_Surface031")

surface.draw_colored_text = {
	"\x55\x8B\xEC\x81\xEC\xCC\xCC\xCC\xCC\x56\x57\xFF\x75\x10",
	"void(__thiscall*)(void*, unsigned int, int, int, int, int, int, int, const char*, va_list)"
}

client.set_event_callback("paint_ui", function()
	surface.draw_colored_text(0x0000003f, 8, 5, 255, 255, 255, 255, "halflifefan said hi", nil)
end)

Last updated