| View previous topic :: View next topic |
| Author |
Message |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Sun Jul 27, 2008 5:34 pm Post subject: [C++]How to make a configurable key to spam? |
|
|
How can I make it so that users can change the key that will be spammed in the bot/trainer I am making this is what I have I already have the part for the window and I am using this postmessage:
| Code: | if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, 0x5A, NULL);
} |
I need to know how they can type in a key after pressing F9 and then it will spam that key instead of a set key.
BTW it is a console DLL
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Jul 27, 2008 5:52 pm Post subject: |
|
|
Somehow via Window controls (like Edit,ComboBox,ListBox,etc.) Allow the user input to the selected key.
For the hotkey's/send keys other then single characters you'll have to actually switch through.
If its a single character such as a, b, c, d, ', ;, etc. You can just use VkKeyScan
| Code: | // Get the text from the box's/whatever control you used.
// Utilize VkKeyScan like this:
// or switch through texts and assign the dwHotkey/dwSendKey certain values.
DWORD dwHotkey = LOWORD( VkKeyScan( tszHotkey[0] ) );
DWORD dwSendKey = LOWORD( VkKeyScan( tszSendKey[0] ) );
if ( GetAsyncKeyState( dwHotkey ) )
{
PostMessage( hGhostOnline, WM_KEYDOWN, dwSendKey, NULL );
} |
_________________
|
|
| Back to top |
|
 |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Sun Jul 27, 2008 5:56 pm Post subject: |
|
|
How about something like this:
| Code: |
DWORD dwSendKey = VkKeyScan( tszSendKey[0] );
if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, VK_CONTROL && dwSendKey, NULL);
} |
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Jul 27, 2008 6:00 pm Post subject: |
|
|
| mrkrishan wrote: | How about something like this:
| Code: |
DWORD dwSendKey = VkKeyScan( tszSendKey[0] );
if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, VK_CONTROL && dwSendKey, NULL);
} |
|
No.
VK_CONTROL && dwSendKey is a conditional and. It will only work in a conditional expression, not as a parameter.
I'm pretty sure if you want to send keys with the Ctrl button down you can set the high order word of dwSendKey to 2
_________________
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Jul 27, 2008 7:36 pm Post subject: |
|
|
|| Would be the solution I'm pretty sure.
| Code: |
DWORD dwSendKey = VkKeyScan( tszSendKey[0] );
if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, VK_CONTROL || dwSendKey, NULL);
}
| [/code]
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Jul 27, 2008 7:43 pm Post subject: |
|
|
| Aviram wrote: | || Would be the solution I'm pretty sure.
| Code: |
DWORD dwSendKey = VkKeyScan( tszSendKey[0] );
if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, VK_CONTROL || dwSendKey, NULL);
}
| [/code] |
No..
|| is the conditional or
It cannot be used as a parameter either..
_________________
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Sun Jul 27, 2008 7:49 pm Post subject: |
|
|
Im not so sure about this. Try this:
| Code: | PostMessage(hGhostOnline, WM_KEYDOWN, VK_CONTROL, NULL);
PostMessage(hGhostOnline, WM_KEYDOWN, dwSendKey, NULL);
PostMessage(hGhostOnline, WM_KEYUP, dwSendKey, NULL);
PostMessage(hGhostOnline, WM_KEYUP, VK_CONTROL, NULL);
|
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Sun Jul 27, 2008 10:30 pm Post subject: |
|
|
My friend told me that you can use that way:
| Code: |
PostMessage(hGhostOnline, WM_KEYDOWN, (VK_CONTROL | dwSendKey, NULL);
|
|
|
| Back to top |
|
 |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Sun Jul 27, 2008 11:54 pm Post subject: |
|
|
I need to make it so that they can input text, and I believe lurc over almost anybody :\
_________________
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Mon Jul 28, 2008 12:25 am Post subject: Re: [C++]How to make a configurable key to spam? |
|
|
| mrkrishan wrote: | How can I make it so that users can change the key that will be spammed in the bot/trainer I am making this is what I have I already have the part for the window and I am using this postmessage:
| Code: | if(GetAsyncKeyState(VK_F9))
{
PostMessage(hGhostOnline, WM_KEYDOWN, 0x5A, NULL);
} |
I need to know how they can type in a key after pressing F9 and then it will spam that key instead of a set key.
BTW it is a console DLL |
hmm. im not completely sure and im coding this off the top of my head, so just go ahead and try it :
| Code: | for( int i = 30; i < 50 + 1; i++ )
if( GetAsyncKeyState( i ) )
{
String plus = "0x" + i.ToStr();
int vkcode = plus.ToInt();
PostMessage(hGhostOnline, WM_KEYDOWN, MapVirtualkey(vkcode, 0), NULL);
} |
fyi, supports 0 - 9, A - Z (some letters, maybe 2 - 4 are not supported)
|
|
| Back to top |
|
 |
Cx Master Cheater
Reputation: 0
Joined: 27 Jul 2007 Posts: 367
|
|
| Back to top |
|
 |
Aviram Grandmaster Cheater
Reputation: 0
Joined: 30 Jun 2006 Posts: 633
|
Posted: Mon Jul 28, 2008 4:01 am Post subject: |
|
|
Hmm you can get string length then do a loop to send every character the string have..
Uh I forgot the function to get string's amount of characters..
Hehe I wrote what ^^ wrote.. just in different words I didnt notice
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Mon Jul 28, 2008 4:03 am Post subject: |
|
|
Create commands to set the hotkeys.
Ex: setkey HP A
You can use something to translate it to a virtual key. Then push where you stored the value for GetAsyncKeyState.
_________________
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Jul 28, 2008 4:17 am Post subject: |
|
|
| Bit offtopic, but I always thought Ghost Online used DInput?
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Mon Jul 28, 2008 4:18 am Post subject: |
|
|
| noz3001 wrote: | | Bit offtopic, but I always thought Ghost Online used DInput? | It does. =/ If you check the WNDPROC, you will see no cmps with WM_KEYDOWN, WM_CHAR or WM_UNICHAR.
_________________
|
|
| Back to top |
|
 |
|