Miscellaneous APIs

Functions

setclipboard

bool setclipboard(data: string | number | Instance | table)

Copies a string or Instance or table of Instances to the clipboard. Returns true on success.

setfflag

bool setfflag(fflag: string, value: string)

Sets FFlag fflag to value. Returns false if the flag doesn't exist or couldn't be set.

identifyexecutor

(string, string) identifyexecutor()

Returns "Synapse X" and version string.

unlockmodulescript

void unlockmodulescript(module: ModuleScript)

"Unlocks" module such that code running at different contexts (e.g. level 2 vs level 7) return the same values when required.

require

any require(module: ModuleScript)

This function replaces the game's require to allow for requiring game modules from higher contexts of script execution, like the one in which Synapse scripts run.

messagebox

int messagebox(text: string, caption?: string, type?: int) [yields]

A wrapper around Microsoft's MessageBoxA.

setwindowtitle

void setwindowtitle(text: string)

Sets the title of the game window. A wrapper around Microsoft's SetWindowTextA.

setwindowicon

void setwindowicon(data: string?)

Sets the icon of the game window.

gethui

Instance gethui()

Returns a protected container where GUIs can be hidden from detection by the game.

createuitab

void createuitab(title: string, contents: string, icon?: string)

Creates a tab in the external UI

newtable

table newtable(narray: number, nhash: number)

Creates a table with the specified array and hash sizes, then fills with random data. Random data for hash part has random vector keys with X, Y, and Z values between 0 and 1 and false as a value. Random data for array part has false as a value. This function is useful for creating tables with memory hidden to scripts. If you would like this feature, make sure narray is >= 33 and nhash is >= 17. NOTE: To prevent table reallocation from exposing this memory, make sure you don't have fewer array/hash values!

cloneref

Instance cloneref(instance: Instance)

Clones a reference to an Instance. The Lua expression clone == instance will be false, but both values will point to the same Instance.

syn.queue_on_teleport

void syn.queue_on_teleport(script: string)

Queues script to be executed after the next teleport.

syn.clear_teleport_queue

void syn.clear_teleport_queue()

Removes all queued scripts from the teleport queue.

syn.get_thread_identity

int syn.get_thread_identity()

Returns the current thread's context level.

syn.set_thread_identity

void syn.set_thread_identity(identity: int)

Sets the current thread's context level.

syn.protect_gui

void syn.protect_gui(target: Instance)

protect_gui is deprecated. For backwards compatability, this function will cause target to be parented the return value of gethui() the next time it is parented.

syn.unprotect_gui

void syn.unprotect_gui(target: Instance)

unprotect_gui is deprecated. For backwards compatability, this function will disable the parent-redirection done by protect_gui.

syn.trampoline_call

(bool, ...any|string) syn.trampoline_call(target: function, call_stack: table, thread_options: table, ...any)

Proxy a call to a Lua function with the given call stack and thread options. call_stack is an array of tables, with each sub-table having fields described below.

The thread parameter allows you to preset the script, identity, and env fields with the values from that thread. This field is optional, and those fields can be overridden after the fact.

Note: These values do not need to correlate with actual information returned by debug.getinfo; they are fully customizable.

Note: The func parameter will override all other data you pass here aside from currentline!

Call Stack EntryDescription
currentlineThe currently executing line of code.
envThe function's environment.
sourceThe 'source' field returned by debug.getinfo.
nameThe function's name.
numparamsThe number of parameters in the function.
is_varargWhether this function takes variadic arguments.
funcA function to copy all information from.
Thread Option EntryDescription
scriptThe script attached to the thread.
identityThe identity of the new state.
envThe global environment of the new thread.
threadA thread used as the parent.

syn.toast_notification

void syn.toast_notification(options: table)

Displays a toast notification in the internal UI. The options table follows the following format:

OptionDescriptionDefault
TypeToastType enumRequired
DurationHow long the notification should last, in seconds5
TitleThe notification's titleRequired
ContentThe notification's contentRequired
IconColorOverrides the icon colorVaries by Type

syn.ipc_send

void syn.ipc_send(data: any)

Sends data to the UI.

Classes

Enums