//IntPtr handle = static void Main(string[] args) { BotLoader.AddSearchPath("../../../UltraBot/Bots/"); var KenBot = BotLoader.LoadBotFromFile("KenBot"); KenBot.Init(0); Util.Init(); DX9Overlay.SetParam("process", "SSFIV.exe"); DX9Overlay.DestroyAllVisual(); TextLabel roundTimer = new TextLabel("Consolas", 10, TypeFace.NONE, new Point(390, 0), Color.White, "", true, true); TextLabel player1 = new TextLabel("Consolas", 10, TypeFace.NONE, new Point(90, 0), Color.White, "", true, true); TextLabel player2 = new TextLabel("Consolas", 10, TypeFace.NONE, new Point(480, 0), Color.White, "", true, true); //Stopwatch sw = new Stopwatch(); // Do something you want to time var ms = MatchState.getInstance(); var f1 = FighterState.getFighter(0); var f2 = FighterState.getFighter(1); KenBot.Init(0); while (true) { ms.Update(); roundTimer.Text = String.Format("Frame:{0}", ms.FrameCounter); UpdateOverlay(player1, f1); UpdateOverlay(player2, f2); KenBot.Run(); } }
private void LoadBots() { BotEntries.Clear(); foreach (var searchDir in SEARCH_PATH) { FileSystemWatcher watcher = new FileSystemWatcher(); watcher.Path = searchDir; watcher.NotifyFilter = NotifyFilters.LastWrite; watcher.Filter = "*.*"; watcher.Changed += new FileSystemEventHandler(FolderOnChanged); watcher.EnableRaisingEvents = true; BotLoader.AddSearchPath(searchDir); foreach (var botfile in Directory.EnumerateFiles(searchDir, "*.cs")) { BotEntries.Add(Path.GetFileNameWithoutExtension(botfile)); } } BotSelector.ItemsSource = BotEntries; BotSelector.SelectedIndex = 0; }