Пример #1
0
        static void Main(string[] args)
        {
            CozyLuaRunner runner = new CozyLuaRunner();

            runner.AddPlugin(new WinFilePlugin());
            int n = runner.DoString(@"
                num = 0
                if (WinFile_IsExist('c:/asasa.ppp')) then
                    num = num+1
                end
                if (WinFile_IsExist('c:/Windows/regedit.exe')) then
                    num = num+1
                end
                if (WinFile_IsExist('c:/Windows/hh.exe')) then
                    num = num+1
                end
                return num");

            Console.WriteLine(n);
        }
Пример #2
0
        public static void test()
        {
            CozyLuaRunner runner = new CozyLuaRunner();

            runner.AddPlugin(new MousePlugin());
            int n = runner.DoString(@"
                num = 0
                if (Mouse_IsExist('c:/asasa.ppp')) then
                    num = num+1
                end
                if (Mouse_IsExist('c:/Windows/regedit.exe')) then
                    num = num+1
                end
                if (Mouse_IsExist('c:/Windows/hh.exe')) then
                    num = num+1
                end
                return num");

            Console.WriteLine(n);
        }