예제 #1
0
        private static void ExecuteClicks()
        {
            SessionSevenTestEngine.Execute((runner) =>
            {
                Console.WriteLine("Press ESC to quit.");
                var PlayerScripts = Game.Ego.Get <Scripts>();

                while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
                {
                    while (PlayerScripts.ScriptCollection.Count > 0 || !runner.Game.World.Interactive)
                    {
                        runner.Tick();
                        runner.MouseClick(runner.Game.World.Get <Randomizer>().CreateInt(1110), runner.Game.World.Get <Randomizer>().CreateInt(400));
                    }

                    runner.MouseClick(runner.Game.World.Get <Randomizer>().CreateInt(1110), runner.Game.World.Get <Randomizer>().CreateInt(400));
                }
                runner.SaveState("click state");
            });
        }
예제 #2
0
        private static void ExecuteInteractions()
        {
            SessionSevenTestEngine.Execute((runner) =>
            {
                Console.WriteLine("Press ESC to quit.");
                var PlayerScripts = Game.Ego.Get <Scripts>();
                var Randomizer    = runner.Game.World.Get <Randomizer>();

                while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
                {
                    while (PlayerScripts.ScriptCollection.Count > 0 || !runner.Game.World.Interactive)
                    {
                        runner.Tick();
                        if (runner.Game.World.Interactive)
                        {
                            runner.MouseClick(Randomizer.CreateInt(1110), Randomizer.CreateInt(400));
                        }
                    }

                    try
                    {
                        if (Randomizer.CreateInt(2) == 1)
                        {
                            var RandomEntity = ChooseRandomEntity(Randomizer);
                            var RandomVerb   = ChooseRandomVerb(Randomizer);

                            runner.Interact(RandomEntity, RandomVerb, false);
                        }
                        else
                        {
                            runner.Interact(ChooseRandomEntity(Randomizer), ChooseRandomEntity(Randomizer), ChooseRandomDitransitiveVerb(Randomizer), false);
                        }
                    }
                    catch (KeyNotFoundException)
                    {
                    }
                }
                runner.SaveState("interaction state");
            });
        }