misc

The misc namespace contains functions that don’t fit into their own namespace (either due to what they are for, or not having enough functions of the same type) that help with various things.

Functions exposed by this namespace are accessed via the prefix: hook.misc.

Functions

get_clipboard

Returns the current string in the clipboard.

1string|nil hook.misc.get_clipboard();
Parameter NameTypeDescription
None.
Returns
(string | nil) The clipboard string on success, nil otherwise.

set_clipboard

Sets the clipboard to the given string.

1boolean hook.misc.set_clipboard(str);
Parameter NameTypeDescription
strstringThe string to set the clipboard to.
Returns
(boolean) True on success, false otherwise.

hide_console

Hides the debug console window.

1hook.misc.hide_console();
Parameter NameTypeDescription
None.
Returns
None.

show_console

Shows the debug console window.

1hook.misc.show_console();
Parameter NameTypeDescription
None.
Returns
None.

execute

Executes a program on the local machine.

1hook.misc.execute(path, args, mode);
Parameter NameTypeDescription
pathstringThe path to the progam to execute.
argsstringThe arguments to pass to the program.
modenumber[Optional] The show command mode to execute the program with.
Returns
None.

open_url

Opens a url within the local machines default browser.

1hook.misc.open_url(url);
Parameter NameTypeDescription
urlstringThe website url to open.
Returns
None.

play_sound

Plays a sound file. (Plays async via PlaySoundA)

1hook.misc.play_sound(path);
Parameter NameTypeDescription
pathstringThe path to the sound file to play.
Returns
None.

If path is an empty string, then any previous playing sound will be stopped.