示例#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);
        }