#pragma once #include #pragma comment(lib, "user32.lib") namespace PowerTank { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// Form1 の概要 /// public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: ここにコンストラクター コードを追加します // } protected: /// /// 使用中のリソースをすべてクリーンアップします。 /// ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::GroupBox^ groupBox1; protected: private: System::Windows::Forms::NumericUpDown^ numericUpDown3; private: System::Windows::Forms::NumericUpDown^ numericUpDown2; private: System::Windows::Forms::NumericUpDown^ numericUpDown1; private: System::Windows::Forms::CheckBox^ checkBox3; private: System::Windows::Forms::CheckBox^ checkBox2; private: System::Windows::Forms::CheckBox^ checkBox1; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::GroupBox^ groupBox2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::NumericUpDown^ numericUpDown6; private: System::Windows::Forms::NumericUpDown^ numericUpDown5; private: System::Windows::Forms::NumericUpDown^ numericUpDown4; private: System::Windows::Forms::CheckBox^ checkBox6; private: System::Windows::Forms::CheckBox^ checkBox5; private: System::Windows::Forms::CheckBox^ checkBox4; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::GroupBox^ groupBox3; private: System::Windows::Forms::RadioButton^ radioButton1; private: System::Windows::Forms::RadioButton^ radioButton2; private: System::Windows::Forms::DomainUpDown^ domainUpDown1; private: System::Windows::Forms::DomainUpDown^ domainUpDown2; private: /// /// 必要なデザイナー変数です。 /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// デザイナー サポートに必要なメソッドです。このメソッドの内容を /// コード エディターで変更しないでください。 /// void InitializeComponent(void) { this->groupBox1 = (gcnew System::Windows::Forms::GroupBox()); this->domainUpDown1 = (gcnew System::Windows::Forms::DomainUpDown()); this->label2 = (gcnew System::Windows::Forms::Label()); this->label1 = (gcnew System::Windows::Forms::Label()); this->numericUpDown3 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericUpDown2 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericUpDown1 = (gcnew System::Windows::Forms::NumericUpDown()); this->checkBox3 = (gcnew System::Windows::Forms::CheckBox()); this->checkBox2 = (gcnew System::Windows::Forms::CheckBox()); this->checkBox1 = (gcnew System::Windows::Forms::CheckBox()); this->groupBox2 = (gcnew System::Windows::Forms::GroupBox()); this->domainUpDown2 = (gcnew System::Windows::Forms::DomainUpDown()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->numericUpDown6 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericUpDown5 = (gcnew System::Windows::Forms::NumericUpDown()); this->numericUpDown4 = (gcnew System::Windows::Forms::NumericUpDown()); this->checkBox6 = (gcnew System::Windows::Forms::CheckBox()); this->checkBox5 = (gcnew System::Windows::Forms::CheckBox()); this->checkBox4 = (gcnew System::Windows::Forms::CheckBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->groupBox3 = (gcnew System::Windows::Forms::GroupBox()); this->radioButton1 = (gcnew System::Windows::Forms::RadioButton()); this->radioButton2 = (gcnew System::Windows::Forms::RadioButton()); this->groupBox1->SuspendLayout(); (cli::safe_cast(this->numericUpDown3))->BeginInit(); (cli::safe_cast(this->numericUpDown2))->BeginInit(); (cli::safe_cast(this->numericUpDown1))->BeginInit(); this->groupBox2->SuspendLayout(); (cli::safe_cast(this->numericUpDown6))->BeginInit(); (cli::safe_cast(this->numericUpDown5))->BeginInit(); (cli::safe_cast(this->numericUpDown4))->BeginInit(); this->SuspendLayout(); // // groupBox1 // this->groupBox1->Controls->Add(this->domainUpDown1); this->groupBox1->Controls->Add(this->label2); this->groupBox1->Controls->Add(this->label1); this->groupBox1->Controls->Add(this->numericUpDown3); this->groupBox1->Controls->Add(this->numericUpDown2); this->groupBox1->Controls->Add(this->numericUpDown1); this->groupBox1->Controls->Add(this->checkBox3); this->groupBox1->Controls->Add(this->checkBox2); this->groupBox1->Controls->Add(this->checkBox1); this->groupBox1->Font = (gcnew System::Drawing::Font(L"メイリオ", 9, static_cast((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)), System::Drawing::GraphicsUnit::Point, static_cast(128))); this->groupBox1->Location = System::Drawing::Point(12, 12); this->groupBox1->Name = L"groupBox1"; this->groupBox1->Size = System::Drawing::Size(247, 100); this->groupBox1->TabIndex = 0; this->groupBox1->TabStop = false; this->groupBox1->Text = L"Player1 Power"; // // domainUpDown1 // this->domainUpDown1->AutoSize = true; this->domainUpDown1->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->domainUpDown1->Items->Add(L"固定"); this->domainUpDown1->Items->Add(L"以上"); this->domainUpDown1->Location = System::Drawing::Point(96, 46); this->domainUpDown1->Name = L"domainUpDown1"; this->domainUpDown1->Size = System::Drawing::Size(57, 19); this->domainUpDown1->TabIndex = 8; this->domainUpDown1->Text = L"以上"; this->domainUpDown1->Wrap = true; this->domainUpDown1->SelectedItemChanged += gcnew System::EventHandler(this, &Form1::domainUpDown1_SelectedItemChanged); // // label2 // this->label2->AutoSize = true; this->label2->Font = (gcnew System::Drawing::Font(L"メイリオ", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->label2->Location = System::Drawing::Point(200, 73); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(30, 17); this->label2->TabIndex = 7; this->label2->Text = L"上昇"; // // label1 // this->label1->AutoSize = true; this->label1->Font = (gcnew System::Drawing::Font(L"メイリオ", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->label1->Location = System::Drawing::Point(93, 73); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(41, 17); this->label1->TabIndex = 6; this->label1->Text = L"F毎に"; // // numericUpDown3 // this->numericUpDown3->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown3->Location = System::Drawing::Point(139, 73); this->numericUpDown3->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2147483647, 0, 0, 0}); this->numericUpDown3->Name = L"numericUpDown3"; this->numericUpDown3->Size = System::Drawing::Size(59, 19); this->numericUpDown3->TabIndex = 4; // // numericUpDown2 // this->numericUpDown2->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown2->Location = System::Drawing::Point(30, 73); this->numericUpDown2->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {9999, 0, 0, 0}); this->numericUpDown2->Name = L"numericUpDown2"; this->numericUpDown2->Size = System::Drawing::Size(59, 19); this->numericUpDown2->TabIndex = 3; // // numericUpDown1 // this->numericUpDown1->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown1->Location = System::Drawing::Point(30, 46); this->numericUpDown1->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2147483647, 0, 0, 0}); this->numericUpDown1->Name = L"numericUpDown1"; this->numericUpDown1->Size = System::Drawing::Size(59, 19); this->numericUpDown1->TabIndex = 2; // // checkBox3 // this->checkBox3->AutoSize = true; this->checkBox3->Location = System::Drawing::Point(6, 74); this->checkBox3->Name = L"checkBox3"; this->checkBox3->Size = System::Drawing::Size(15, 14); this->checkBox3->TabIndex = 0; this->checkBox3->UseVisualStyleBackColor = true; // // checkBox2 // this->checkBox2->AutoSize = true; this->checkBox2->Location = System::Drawing::Point(6, 48); this->checkBox2->Name = L"checkBox2"; this->checkBox2->Size = System::Drawing::Size(15, 14); this->checkBox2->TabIndex = 1; this->checkBox2->UseVisualStyleBackColor = true; // // checkBox1 // this->checkBox1->AutoSize = true; this->checkBox1->Font = (gcnew System::Drawing::Font(L"メイリオ", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->checkBox1->Location = System::Drawing::Point(6, 18); this->checkBox1->Name = L"checkBox1"; this->checkBox1->Size = System::Drawing::Size(91, 24); this->checkBox1->TabIndex = 0; this->checkBox1->Text = L" MAX 固定"; this->checkBox1->UseVisualStyleBackColor = true; this->checkBox1->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox1_CheckedChanged); // // groupBox2 // this->groupBox2->Controls->Add(this->domainUpDown2); this->groupBox2->Controls->Add(this->label3); this->groupBox2->Controls->Add(this->label4); this->groupBox2->Controls->Add(this->numericUpDown6); this->groupBox2->Controls->Add(this->numericUpDown5); this->groupBox2->Controls->Add(this->numericUpDown4); this->groupBox2->Controls->Add(this->checkBox6); this->groupBox2->Controls->Add(this->checkBox5); this->groupBox2->Controls->Add(this->checkBox4); this->groupBox2->Font = (gcnew System::Drawing::Font(L"メイリオ", 9, static_cast((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)), System::Drawing::GraphicsUnit::Point, static_cast(128))); this->groupBox2->Location = System::Drawing::Point(12, 118); this->groupBox2->Name = L"groupBox2"; this->groupBox2->Size = System::Drawing::Size(247, 100); this->groupBox2->TabIndex = 1; this->groupBox2->TabStop = false; this->groupBox2->Text = L"Player2 Power"; // // domainUpDown2 // this->domainUpDown2->AutoSize = true; this->domainUpDown2->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->domainUpDown2->Items->Add(L"固定"); this->domainUpDown2->Items->Add(L"以上"); this->domainUpDown2->Location = System::Drawing::Point(96, 46); this->domainUpDown2->Name = L"domainUpDown2"; this->domainUpDown2->Size = System::Drawing::Size(57, 19); this->domainUpDown2->TabIndex = 9; this->domainUpDown2->Text = L"以上"; this->domainUpDown2->Wrap = true; this->domainUpDown2->SelectedItemChanged += gcnew System::EventHandler(this, &Form1::domainUpDown2_SelectedItemChanged); // // label3 // this->label3->AutoSize = true; this->label3->Font = (gcnew System::Drawing::Font(L"メイリオ", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->label3->Location = System::Drawing::Point(200, 73); this->label3->Name = L"label3"; this->label3->Size = System::Drawing::Size(30, 17); this->label3->TabIndex = 7; this->label3->Text = L"上昇"; // // label4 // this->label4->AutoSize = true; this->label4->Font = (gcnew System::Drawing::Font(L"メイリオ", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->label4->Location = System::Drawing::Point(93, 73); this->label4->Name = L"label4"; this->label4->Size = System::Drawing::Size(41, 17); this->label4->TabIndex = 6; this->label4->Text = L"F毎に"; // // numericUpDown6 // this->numericUpDown6->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown6->Location = System::Drawing::Point(139, 73); this->numericUpDown6->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2147483647, 0, 0, 0}); this->numericUpDown6->Name = L"numericUpDown6"; this->numericUpDown6->Size = System::Drawing::Size(59, 19); this->numericUpDown6->TabIndex = 4; // // numericUpDown5 // this->numericUpDown5->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown5->Location = System::Drawing::Point(30, 73); this->numericUpDown5->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {9999, 0, 0, 0}); this->numericUpDown5->Name = L"numericUpDown5"; this->numericUpDown5->Size = System::Drawing::Size(59, 19); this->numericUpDown5->TabIndex = 3; // // numericUpDown4 // this->numericUpDown4->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->numericUpDown4->Location = System::Drawing::Point(30, 46); this->numericUpDown4->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {2147483647, 0, 0, 0}); this->numericUpDown4->Name = L"numericUpDown4"; this->numericUpDown4->Size = System::Drawing::Size(59, 19); this->numericUpDown4->TabIndex = 2; // // checkBox6 // this->checkBox6->AutoSize = true; this->checkBox6->Location = System::Drawing::Point(6, 74); this->checkBox6->Name = L"checkBox6"; this->checkBox6->Size = System::Drawing::Size(15, 14); this->checkBox6->TabIndex = 0; this->checkBox6->UseVisualStyleBackColor = true; // // checkBox5 // this->checkBox5->AutoSize = true; this->checkBox5->Location = System::Drawing::Point(6, 48); this->checkBox5->Name = L"checkBox5"; this->checkBox5->Size = System::Drawing::Size(15, 14); this->checkBox5->TabIndex = 1; this->checkBox5->UseVisualStyleBackColor = true; // // checkBox4 // this->checkBox4->AutoSize = true; this->checkBox4->Font = (gcnew System::Drawing::Font(L"メイリオ", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->checkBox4->Location = System::Drawing::Point(6, 19); this->checkBox4->Name = L"checkBox4"; this->checkBox4->Size = System::Drawing::Size(91, 24); this->checkBox4->TabIndex = 0; this->checkBox4->Text = L" MAX 固定"; this->checkBox4->UseVisualStyleBackColor = true; this->checkBox4->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox4_CheckedChanged); // // button1 // this->button1->Font = (gcnew System::Drawing::Font(L"MS UI Gothic", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast(128))); this->button1->Location = System::Drawing::Point(151, 224); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(107, 38); this->button1->TabIndex = 2; this->button1->Text = L"実行"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // groupBox3 // this->groupBox3->Location = System::Drawing::Point(12, 224); this->groupBox3->Name = L"groupBox3"; this->groupBox3->Size = System::Drawing::Size(0, 0); this->groupBox3->TabIndex = 3; this->groupBox3->TabStop = false; this->groupBox3->Text = L"groupBox3"; // // radioButton1 // this->radioButton1->AutoSize = true; this->radioButton1->Checked = true; this->radioButton1->Location = System::Drawing::Point(18, 224); this->radioButton1->Name = L"radioButton1"; this->radioButton1->Size = System::Drawing::Size(90, 16); this->radioButton1->TabIndex = 8; this->radioButton1->TabStop = true; this->radioButton1->Text = L"試合終了まで"; this->radioButton1->UseVisualStyleBackColor = true; // // radioButton2 // this->radioButton2->AutoSize = true; this->radioButton2->Location = System::Drawing::Point(18, 246); this->radioButton2->Name = L"radioButton2"; this->radioButton2->Size = System::Drawing::Size(101, 16); this->radioButton2->TabIndex = 9; this->radioButton2->Text = L"ラウンド終了まで"; this->radioButton2->UseVisualStyleBackColor = true; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 12); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(270, 279); this->Controls->Add(this->radioButton2); this->Controls->Add(this->groupBox3); this->Controls->Add(this->radioButton1); this->Controls->Add(this->button1); this->Controls->Add(this->groupBox2); this->Controls->Add(this->groupBox1); this->Name = L"Form1"; this->Text = L"PowerTank"; this->groupBox1->ResumeLayout(false); this->groupBox1->PerformLayout(); (cli::safe_cast(this->numericUpDown3))->EndInit(); (cli::safe_cast(this->numericUpDown2))->EndInit(); (cli::safe_cast(this->numericUpDown1))->EndInit(); this->groupBox2->ResumeLayout(false); this->groupBox2->PerformLayout(); (cli::safe_cast(this->numericUpDown6))->EndInit(); (cli::safe_cast(this->numericUpDown5))->EndInit(); (cli::safe_cast(this->numericUpDown4))->EndInit(); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { if(checkBox1->Checked){ numericUpDown1->Enabled = false; numericUpDown2->Enabled = false; numericUpDown3->Enabled = false; domainUpDown1->Enabled = false; } if(!checkBox1->Checked){ numericUpDown1->Enabled = true; numericUpDown2->Enabled = true; numericUpDown3->Enabled = true; domainUpDown1->Enabled = true; } } private: System::Void checkBox4_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { if(checkBox4->Checked){ numericUpDown4->Enabled = false; numericUpDown5->Enabled = false; numericUpDown6->Enabled = false; domainUpDown2->Enabled = false; } if(!checkBox4->Checked){ numericUpDown4->Enabled = true; numericUpDown5->Enabled = true; numericUpDown6->Enabled = true; domainUpDown2->Enabled = true; } } private: System::Void domainUpDown1_SelectedItemChanged(System::Object^ sender, System::EventArgs^ e) { if(domainUpDown1->Text!=L"固定" && domainUpDown1->Text!=L"以上"){ domainUpDown1->Text=L"固定"; } if(domainUpDown1->Text==L"以上"){ numericUpDown2->Enabled = true; numericUpDown3->Enabled = true; } if(domainUpDown1->Text==L"固定"){ numericUpDown2->Enabled = false; numericUpDown3->Enabled = false; } } private: System::Void domainUpDown2_SelectedItemChanged(System::Object^ sender, System::EventArgs^ e) { if(domainUpDown2->Text!=L"固定" && domainUpDown2->Text!=L"以上"){ domainUpDown2->Text=L"固定"; } if(domainUpDown2->Text==L"以上"){ numericUpDown5->Enabled = true; numericUpDown6->Enabled = true; } if(domainUpDown2->Text==L"固定"){ numericUpDown5->Enabled = false; numericUpDown6->Enabled = false; } } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { // ボタン等の変更 button1->Text = L"実行中"; button1->Enabled = false; radioButton1->Enabled = false; radioButton2->Enabled = false; checkBox1->Enabled = false; checkBox2->Enabled = false; checkBox3->Enabled = false; checkBox4->Enabled = false; checkBox5->Enabled = false; checkBox6->Enabled = false; numericUpDown1->Enabled = false; numericUpDown2->Enabled = false; numericUpDown3->Enabled = false; numericUpDown4->Enabled = false; numericUpDown5->Enabled = false; numericUpDown6->Enabled = false; domainUpDown1->Enabled = false; domainUpDown2->Enabled = false; numericUpDown1->Update(); numericUpDown2->Update(); numericUpDown3->Update(); numericUpDown4->Update(); numericUpDown5->Update(); numericUpDown6->Update(); domainUpDown1->Update(); domainUpDown2->Update(); // 変数等の設定 int UpDown1; int UpDown2; int UpDown3; int UpDown4; int UpDown5; int UpDown6; UpDown1 = (int)numericUpDown1->Value; UpDown2 = (int)numericUpDown2->Value; UpDown3 = (int)numericUpDown3->Value; UpDown4 = (int)numericUpDown4->Value; UpDown5 = (int)numericUpDown5->Value; UpDown6 = (int)numericUpDown6->Value; int Error = 0; int Prevtime1 = 0; int Prevtime2 = 0; int Endflag = 0; char *lpData0; char *lpDataPP; char *lpDataGametime; char *lpDataRo; char *lpDataRoS; char *lpDatacheck1; char *lpDatacheck2; char *lpDataP1power; char *lpDataP2power; LPVOID EAX[1] = {0}; LPVOID EBX[2] = {0}; LPVOID Gametime[1] = {0}; LPVOID RoundState[1] = {0}; LPVOID check1[1] = {0}; LPVOID check2[1] = {0}; LPVOID P1Power[2] = {0}; LPVOID P2Power[2] = {0}; LPVOID setPower[1] = {0}; DWORD dwAccessByte = 0; // MUGENのハンドルを取得する処理 HWND hWnd; DWORD dwPID; HANDLE ph; hWnd = FindWindow(NULL, L"M.U.G.E.N"); //ウィンドウハンドルを名称より取得、多重起動は放置。 GetWindowThreadProcessId(hWnd,&dwPID); //プロセスID取得 ph = OpenProcess(PROCESS_ALL_ACCESS,TRUE,dwPID); //プロセスハンドル取得、及び権限取得? if(!hWnd){ MessageBox::Show("M.U.G.E.Nのウィンドウが見つかりませんでした。\n","エラーメッセージ"); Error=1; } // MUGENが見つかったら情報位置確認 if(!Error){ // 基本のアドレス EAX取得 // 004B5B4C:ポインタ → EAX[0] lpData0=(char *)0x004B5B4C; ReadProcessMemory(ph,lpData0,EAX,4,&dwAccessByte); // プレイヤー情報ポインタ取得 // EAX+B754h:1Pのポインタ → EBX[0] // EAX+B758h:2Pのポインタ → EBX[1] lpDataPP=(char *)EAX[0]; lpDataPP+=0xB754; ReadProcessMemory(ph,lpDataPP,EBX,8,&dwAccessByte); if(dwAccessByte == 0 || EBX[0]==0 || EBX[1]==0){ MessageBox::Show("試合情報が取得できませんでした\n","エラーメッセージ"); Error=1; } } // EAX+BC30h:ラウンドステート → RoundState[0] // EBX+0158h:存在フラグ → check1[0],check2[0] ※Shift+F4でも消える // EBX+0178h:power → P1Power[0],P2Power[0] // EBX+017Ch:powermax → P1Power[1],P21Power[1] // EAX+B3FCh:gametime → Gametime[0] ※MUGEN起動後の総試合の合計 1秒=60 lpDataRo=(char *)EAX[0]; lpDataRo+=0xBC04; lpDataRoS=(char *)EAX[0]; lpDataRoS+=0xBC30; lpDataGametime=(char *)EAX[0]; lpDataGametime+=0xB3FC; lpDataP1power=(char *)EBX[0]; lpDataP1power+=0x0178; lpDatacheck1=(char *)EBX[0]; lpDatacheck1+=0x0158; lpDataP2power=(char *)EBX[1]; lpDataP2power+=0x0178; lpDatacheck2=(char *)EBX[1]; lpDatacheck2+=0x0158; // MUGEN監視開始 while(!Error && dwAccessByte){ // 存在確認とラウンドステート取得 ReadProcessMemory(ph,lpDatacheck1,check1,4,&dwAccessByte); ReadProcessMemory(ph,lpDatacheck2,check2,4,&dwAccessByte); ReadProcessMemory(ph,lpDataRoS,RoundState,4,&dwAccessByte); if(!dwAccessByte || !check1[0] || !check2[0] || radioButton2->Checked && (int)RoundState[0] > 2){ break; //情報取得失敗か、監視中のキャラが消えたか、ラウンド終了時に抜ける。 } // 試合中なら if((int)RoundState[0] == 2){ // 1P用 // Power確認 ReadProcessMemory(ph,lpDataP1power,P1Power,8,&dwAccessByte); if(checkBox1->Checked){ //1PMAX setPower[0] = P1Power[1]; WriteProcessMemory(ph,lpDataP1power,setPower,4,&dwAccessByte); }else{ if(checkBox2->Checked){ //1P指定値 if(UpDown1 >= (int)P1Power[1]){ setPower[0] = P1Power[1]; }else{ setPower[0] = (LPVOID)UpDown1; } if(domainUpDown1->Text==L"以上" && P1Power[0]Text==L"固定"){ WriteProcessMemory(ph,lpDataP1power,setPower,4,&dwAccessByte); } } if(checkBox3->Checked && domainUpDown1->Text==L"以上"){ //1P上昇 ReadProcessMemory(ph,lpDataGametime,Gametime,4,&dwAccessByte); if((int)Gametime[0] >= Prevtime1 + UpDown2){ if((int)P1Power[1] - (int)P1Power[0] < UpDown3){ setPower[0] = P1Power[1]; }else{ setPower[0] = (LPVOID)((int)P1Power[0]+UpDown3); } WriteProcessMemory(ph,lpDataP1power,setPower,4,&dwAccessByte); Prevtime1 = (int)Gametime[0]; } } } // 2P用 // Power確認 ReadProcessMemory(ph,lpDataP2power,P2Power,8,&dwAccessByte); if(checkBox4->Checked){ //2PMAX setPower[0] = P2Power[1]; WriteProcessMemory(ph,lpDataP2power,setPower,4,&dwAccessByte); }else{ if(checkBox5->Checked){ //2P指定値 if(UpDown4 >= (int)P2Power[1]){ setPower[0] = P2Power[1]; }else{ setPower[0] = (LPVOID)UpDown4; } if(domainUpDown2->Text==L"以上" && P2Power[0]Text==L"固定"){ WriteProcessMemory(ph,lpDataP2power,setPower,4,&dwAccessByte); } } if(checkBox6->Checked && domainUpDown2->Text==L"以上"){ //2P上昇 ReadProcessMemory(ph,lpDataGametime,Gametime,4,&dwAccessByte); if((int)Gametime[0] >= Prevtime2 + UpDown5){ if((int)P2Power[1] - (int)P2Power[0] < UpDown6){ setPower[0] = P2Power[1]; }else{ setPower[0] = (LPVOID)((int)P2Power[0]+UpDown6); } WriteProcessMemory(ph,lpDataP2power,setPower,4,&dwAccessByte); Prevtime2 = (int)Gametime[0]; } } } }//試合中処理の終わり } //ボタン等を戻す button1->Text = L"実行"; button1->Enabled = true; radioButton1->Enabled = true; radioButton2->Enabled = true; checkBox1->Enabled = true; checkBox2->Enabled = true; checkBox3->Enabled = true; checkBox4->Enabled = true; checkBox5->Enabled = true; checkBox6->Enabled = true; numericUpDown1->Enabled = true; numericUpDown2->Enabled = true; numericUpDown3->Enabled = true; numericUpDown4->Enabled = true; numericUpDown5->Enabled = true; numericUpDown6->Enabled = true; domainUpDown1->Enabled = true; domainUpDown2->Enabled = true; }//メインの終わり }; }