keystrokes

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

keystrokes

Postby mezzo » Tue Jun 12, 2007 5:06 pm

Hey guys, I was looking at sending keystrokes to an application.
I checked out the minesweep bot, but it's more mouse oriented.

Can someone tell me how I would send "<s>" to a window, please ?
(Especially the < and > symbols....)
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby mezzo » Sun Jul 08, 2007 8:50 pm

Just in case someone wonders....

Code: Select all

void type_command(char * pChar)
{
   int counter;
   short letterke ;
   int iLength = StrLen( pChar );

   //UserName First... ugly hack.
   for ( counter = 0; counter < iLength ; counter++ ) {
      
      letterke = VkKeyScan( pChar[counter] );
      KeyboardEvent( letterke , 0 );
      KeyboardEvent( letterke  ,  KEYEVENTF_KEYUP );
   }
}

void press_enter()
{
   KeyboardEvent( VK_RETURN , 0 );
   KeyboardEvent( VK_RETURN  ,  KEYEVENTF_KEYUP );
}

char * player1_username = "ikke";
char * player1_password = "ikke";

void Login()
{
   type_command( player1_username );
   Sleep(500);
   press_enter();
   type_command( player1_password );
   Sleep(500);
   press_enter();

}

- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Postby L. Spiro » Mon Jul 09, 2007 12:22 am

You can shorten the code to:

Code: Select all
char * player1_username = "ikke";
char * player1_password = "ikke";
void Login() {
   Type( player1_username );
   Sleep( 500 );
   Type( '\r' );
   Type( player1_password );
   Sleep( 500 );
   Type( '\r' );
}



\r = Enter key.
\t = Tab key.
\b = Backspace key.
There are many more and they are all listed in the standard C/C++/any programming language documentation under Control Codes.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby mezzo » Mon Jul 09, 2007 2:41 am

ooh nice ! thnx :-) does indeed look much cleaner.
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Um

Postby abysusslynx » Sat Jan 19, 2008 8:34 am

Could some1 enlighten me on how these "codes" r used?

Cause when i copen the minesweep hack, thiersw just a bunch of odd looking sentences..any help?
Legends of ares i am asad 2 say is dead, but wolfteam and soldierfront r great, so c'mon hack hack hack
User avatar
abysusslynx
Hackleberry Fin
 
Posts: 26
Joined: Fri Jan 18, 2008 6:10 am
Location: USA,Florida

Postby mezzo » Sat Jan 19, 2008 9:15 am

these are not codes... it's LSS (L.Spiro Script).

It's the scripting/programming language that makes MHS do what you want.

In the simplest form, MHS can be used like cheat engine, gwiz32, ...
You use it to find a variable in memory that represents something in a game that you wish to change (amount of money, amount of bullets, your health, etc) and after you have found the memory location, you freeze it to a fixed value. So that you have unlimited money, health, ... For that you DON'T need LSS, simply search and subsearch using MHS.

But, MHS can do MUCH MUCH more.. you can script things that will be executed in the 'memory' and 'executing' space of the game/application that you are hacking... That is done in LSS (see the example in the first post of this thread and loads of other threads on this board.) LSS isn't that dificult, but if you have no prior programming knowledge, you might want to learn a bit more before writing scripts from scratch..

I would advise you to read the ENTIRE help file that comes with the MHS download. Even if you don't understand it all, just read it.. try some searches in games and if you still have questions, post them in one of the game specific sections of the site.. (just loading the minesweeper example into MHS and executing it, won't learn you a lot unless you read the help file to understand what it is doing and know how to do searches).

Oh and please STOP spamming requests for help in every active thread on this forum... it's annoying. if you really need help, just make a NEW thread and ask a specific question, you'll get much more response then when just begging for help in each and every existing thread.. thanks :-)
- No thanks, I already have a penguin -
User avatar
mezzo
El Mariachi
 
Posts: 739
Joined: Mon Apr 30, 2007 10:27 pm
Location: Antwerp

Ok

Postby abysusslynx » Sat Jan 19, 2008 9:35 pm

Fine i did :!:
Legends of ares i am asad 2 say is dead, but wolfteam and soldierfront r great, so c'mon hack hack hack
User avatar
abysusslynx
Hackleberry Fin
 
Posts: 26
Joined: Fri Jan 18, 2008 6:10 am
Location: USA,Florida

Postby gibxam » Tue Oct 07, 2008 1:55 pm

Hehe I wondered ... :D

This is so cool I got a script to find notepad, unfortunately I had to have notepad open to begin with :x . But then it types in whatever I want it to from there. This is important because I'm trying to write a script that will automatically fill out forms, so this is somewhat the first step. I am pretty sure this is probably horrible written and not efficient at all but it was fun spending half an hour tinkering with it. With some suggestions I will make it more efficient :D. Perhaps I can figure out a way to search for certain char* within the notepad document and move the cursor to those positions? Hehe I guess that will be for tomorrow. Thanks for the post mezzo.

-Max

Code: Select all
void Write_Notepad()
{
   //made the program sleep because I was too lazy to change the hotkey :P
   Sleep(1000);
   HWND hWnd = FindWindow("Untitled - Notepad");
   
   if (!hWnd)
   {
      PrintF("Can't find Notepad...");
      return;
   }
   
   PrintF("Found Notepad!");
   SetForegroundWindow(hWnd);
   
   
   char *msg = "Max";
   
   Type(msg);
   }

Code: Select all
VOID On_HK_NOTEPAD_EXE_1( DWORD dw1, DWORD dw2 )
{
   Write_Notepad();
}
User avatar
gibxam
Acker
 
Posts: 51
Joined: Mon Oct 06, 2008 3:19 am

Postby gibxam » Wed Oct 08, 2008 10:50 am

L. Sprio solved my hot key problem in his updated minesweeper script. My script now does not need to sleep before it proceeds to finding the window :). My new goal is for the script to find a string of characters (char *) and then move the cursor to that position. I know how to move the cursor but are there functions that can search through a Notepad document and return the position a word (aka string) that I could then use to move the cursor too? Also if this function does exist would it return the location of the beginning of the word the middle or the end (I would suspect the end but I am not sure)?

Thank you for your time, my updated script is below,

-Max

Code: Select all
void Write_Notepad()
{
   KeyboardEvent( VK_SHIFT, KEYEVENTF_KEYUP );
       KeyboardEvent( VK_CONTROL, KEYEVENTF_KEYUP );
       KeyboardEvent( VK_MENU, KEYEVENTF_KEYUP );

   HWND hWnd = FindWindow("Untitled - Notepad");
   
   if (!hWnd)
   {
      PrintF("Can't find Notepad...");
      return;
   }

   
   PrintF("Found Notepad!");
   SetForegroundWindow(hWnd);
   
   
   char *msg = "Max";
   
   Type(msg);
   }
User avatar
gibxam
Acker
 
Posts: 51
Joined: Mon Oct 06, 2008 3:19 am


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron