HowTo: Run&Debug ByteCode TJS - Project-AZUSA/KirikiriSharp GitHub Wiki

  1. Open C# Interactive.

  2. Enter #r ".\bin\Debug\tjs2.dll" (the path of tjs2.dll)

  3. 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);
    
  4. Now you get the global object in dsp. Get member or call function from it.