HowTo: Run&Debug ByteCode TJS - Project-AZUSA/KirikiriSharp GitHub Wiki
-
Open
C# Interactive
. -
Enter
#r ".\bin\Debug\tjs2.dll"
(the path oftjs2.dll
) -
Enter:
using Tjs2; using Tjs2.Sharper; using Tjs2.Engine; using Tjs2.Sharpen; Tjs.mStorage = null; Tjs.Initialize(); Tjs scriptEngine = new Tjs(); Tjs.SetConsoleOutput(new DebugConsoleOutput()); var fs = new FileStream(@"PathOfYourTjs.tjs", FileMode.Open); TjsBinaryStream stream = new TjsBinaryStream(fs); var ret = new Variant(); Dispatch2 dsp = scriptEngine.GetGlobal(); scriptEngine.LoadByteCode(ret, dsp, "NameOfYourTjs", stream);
-
Now you get the global object in
dsp
. Get member or call function from it.