-
Notifications
You must be signed in to change notification settings - Fork 0
1. Exposed stuff
SomeRandomNoobKekeke edited this page Apr 25, 2026
·
5 revisions
By default ClearScript provides just basic language support
All real functionality is located in adapted c# objects explicitly exposed to js
-
host,xHost- magic, utils objects for interacting with C# types and objects, they are key, xHost is just better version of host, read about them here -
JS- Exposes Methods for interacting with the engine -
Console- Exposes Log, Warning, Error methods that writes in both consoles at once -
ModInfo.Package- A variable that is temporarily set to the current package when js loads its scripts -
ModInfo.FullPath- Full patch to the mod folder, also temporary -
API- Contains various easy to use APIs like JSHook for patching the game with harmony, Console for adding console commands or Web for creating web servers
-
setTimeout(jsfunc, delay)- There's no built-in setTimeout, this one is c# imposter that uses tasks under the hood - Every object now has
_Field(string name),_Property(string name),_MethodInfo(string name, params Type[] paramTypes)- helpers for getting private stuff with reflection