コード例 #1
0
ファイル: Program.cs プロジェクト: Hatnice/UltraBotFramework
                //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();
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Hatnice/UltraBotFramework
 private static void UpdateOverlay(TextLabel label, FighterState f)
 {
     f.UpdatePlayerState();
     label.Text = String.Format("X={0,-7} Y={1,-7} XVel={12,-7} YVel={13,-7}\n{2,-15} F:{3,-3}\nACT:{4,-3} ENDACT:{5,-3} IASA:{6,-3} TOT:{7,-3}\n{8,-10} {9,-10} {10,-10} {11:X}\n{14}",
         f.X, f.Y, f.ScriptName, f.ScriptFrame, f.ScriptFrameHitboxStart, f.ScriptFrameHitboxEnd, f.ScriptFrameIASA, f.ScriptFrameTotal, f.State, f.AState, f.StateTimer, f.RawState, f.XVelocity, f.YVelocity, String.Join(", ", f.ActiveCancelLists));
 }
コード例 #3
0
 private void OverlayEnabled_Checked(object sender, RoutedEventArgs e)
 {
     if (OverlayEnabled.IsChecked.Value)
     {
         StatusLabel.Content = "Enabling Overlay...";
         DX9Overlay.SetParam("process", "SSFIV.exe");
         DX9Overlay.DestroyAllVisual();
         roundTimer = new TextLabel("Consolas", 10, TypeFace.NONE, new System.Drawing.Point(4, 700), Color.White, "", true, true);
         player1 = new TextLabel("Consolas", 10, TypeFace.NONE, new System.Drawing.Point(5, 0), Color.White, "", true, true);
         player2 = new TextLabel("Consolas", 10, TypeFace.NONE, new System.Drawing.Point(460, 0), Color.White, "", true, true);
         restartWorker();
     }
     else
     {
         StatusLabel.Content = "Disabling Overlay...";
         DX9Overlay.DestroyAllVisual();
         restartWorker();
     }
 }