Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. //Auto Pot
  2.  
  3. int UserSetHP;
  4. int UserSetMP;
  5. bool HPMPExit;
  6.  
  7. void AutoPot()
  8. {
  9.     HWND hwnd = FindWindow("MapleStoryClass", 0);
  10.     LPARAM lParam = (MapVirtualKey(0x21, 0) << 16);
  11.     LPARAM lParam2 = (MapVirtualKey(0x22, 0) << 16); // Test it now. okies
  12.  
  13.     while(!HPMPExit)
  14.     {//This loop should stop if both HP & MP are higher then what you put in your checkboxes
  15.         if(CurrentHp < UserSetHP)
  16.         {
  17.             PostMessage(hwnd, WM_KEYDOWN, 0x21, lParam); // Page Up
  18.         }
  19.  
  20.         if(CurrentMP < UserSetMP)
  21.         {
  22.             PostMessage(hwnd, WM_KEYDOWN, 0x22, lParam2); // Page Down
  23.         }
  24.         Sleep(100);
  25.     }
  26. }
  27.  
  28. void Form1::textBox7_TextChanged(System::Object^  sender, System::EventArgs^  e)
  29. {
  30.     UserSetHP = Convert::ToInt32(this->textBox7->Text);
  31. }
  32.  
  33. void Form1::textBox8_TextChanged(System::Object^  sender, System::EventArgs^  e)
  34. {
  35.     UserSetMP = Convert::ToInt32(this->textBox8->Text);
  36. }
  37.  
  38. void Form1::checkBox31_CheckedChanged(System::Object^  sender, System::EventArgs^  e)
  39. {
  40.     if(this->checkBox31->Checked)
  41.     {
  42.         HPMPExit = false;
  43.         CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&AutoPot, NULL, NULL, NULL);
  44.     }
  45.     else
  46.     {
  47.         HPMPExit = true;
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement