public void TestLoadCompiledFile(string FileName)
        {
            Monkeyspeak.MonkeyspeakEngine engine = new Monkeyspeak.MonkeyspeakEngine();
            engine.Options.TriggerLimit = int.MaxValue;

            Monkeyspeak.Page page = engine.LoadCompiledFile(FileName);

            page.LoadSysLibrary();
            page.LoadIOLibrary();
            page.LoadMathLibrary();
            page.LoadTimerLibrary();

            page.Execute(0);
            Console.WriteLine("Page Trigger Count: " + page.Size);
        }
        public void GetTriggerDescriptionsTest()
        {
            Monkeyspeak.MonkeyspeakEngine engine = GetMonkeySpeakEngine();
            Monkeyspeak.Page page = engine.LoadFromString("");

            page.Error += DebugAllErrors;

            page.LoadSysLibrary();
            page.LoadIOLibrary();
            page.LoadMathLibrary();
            page.LoadTimerLibrary();

            foreach (string desc in page.GetTriggerDescriptions())
            {
                Console.WriteLine(desc);
            }
        }
        public void TimerLibraryTest()
        {
            var timerLibTestScript = @"
(0:0) when the script starts,
    (5:101) set variable %timer to 1.
    (5:300) create timer %timer to go off every 2 second(s).

(0:300) when timer %timer goes off,
    (5:102) print {Timer %timer went off.} to the console.
";

            Monkeyspeak.MonkeyspeakEngine engine = GetMonkeySpeakEngine();
            Monkeyspeak.Page page = engine.LoadFromString(timerLibTestScript);

            page.Error += DebugAllErrors;

            page.LoadSysLibrary();
            page.LoadTimerLibrary();

            page.SetTriggerHandler(Monkeyspeak.TriggerCategory.Cause, 0, HandleAllCauses);

            page.Execute(0);
            System.Threading.Thread.Sleep(4000);
        }
        public async Task TextCondkitionBlockageAsync()
        {
            var timerLibTestScript = @"
(0:0) when the script starts,
    (5:102) print {Before False} to the console.
(1:6666) return false,
    (5:102) print {After False} to the console.

(0:300) when timer %timer goes off,
    (5:102) print {Timer %timer went off.} to the console.
";

            Monkeyspeak.MonkeyspeakEngine engine = GetMonkeySpeakEngine(true);
            Monkeyspeak.Page page = engine.LoadFromString(timerLibTestScript);

            page.Error += DebugAllErrors;

            page.LoadSysLibrary();
            page.LoadTimerLibrary();
            page.SetTriggerHandler(Monkeyspeak.TriggerCategory.Condition, 6666, AlwayFalse);
            page.SetTriggerHandler(Monkeyspeak.TriggerCategory.Cause, 0, HandleAllCauses);
            int[] ids = { 0 };
            await Task.Run(() => page.ExecuteAsync(ids));
        }