Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

34 Commits

Repository files navigation

Loader

loadstring(game:HttpGetAsync('https://raw.githubusercontent.com/strsplspace/utils/main/cenv.lua'))();

Usage

getprotoclosures

<table>getprotoclosures(<LocalScript>);

Returns the protos of LocalScript

searchclosureconst

<function>searchclosureconst(<any>Constants);

Returns the function that contains Constants

Example of usage

LocalScript contains this code:

spawn(function()
spawn(function() --We need to get this functionprint('a');
warn('b');
end);
end);

Our code:

localFn=searchclosureconst('print','a','warn','b');
print(Fn);

This function now generates code after use, then the code gets copied into clipboard

--Code generated by cenvlocalFunction;
localConsts= {
["1"] ="print",
["2"] ="a",
["3"] ="warn",
["4"] ="b"
};
fori,vinnext,getgc(true) doif (type(v) =='function' andislclosure(v) andnotis_synapse_function(v)) thenfori2,v2innext,Constsdoiftable.find(debug.getconstants(v),v2) thenFunction=v;
end;
end;
end;
end;

searchclosureups

<function>searchclosureups(<any>Upvalues);

Works same as searchclosureconst but with Upvalues

gcsenv

<table>gcsenv(<LocalScript>);

Works same as regular getsenv but uses gc instead, it can be useful if function in a table, regular getsenv doesn't going to return that function

getscriptlocals

<table>getscriptlocals(<LocalScript>,<Optional>Iterations);

Returns the NON Upvalue variables of script, by default Iterations = 400

Cenv

cenv.Test

<boolean>cenv.Test(<void>);

The compatability function

cenv.GetFunctions

cenv.GetFunctions(<void>);

Prints all functions in Synapse console, that are supported

cenv.Find

<string>cenv.Find(<string>Functionname);

Returns the name of function if finds it

cenv.Copy

cenv.Copy=<boolean>

Responsible for copying in SG.Generate,by default its true

Note

This project can contain bugs, if you found one make a pull request.

About

Helping utility to make scripts.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages