예제 #1
0
파일: Program.cs 프로젝트: shangshen/cozy
        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);
        }