 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Jun 05, 2008 8:06 am Post subject: |
|
|
1. For the lParam of the PostMessage use the value of the virtual key shifted by 16 bits
here's a definition i created for easy LPARAM's
| Code: | | #define MAKELKEY(vk) (MapVirtualKey( (UINT)(vk), 0 ) << 16) |
and for your PostMessage do:
| Code: | | myPostMessage(hMS,WM_CHAR,0x5A,MAKELKEY(0x5A)); |
2. Don't use timer's. There extremely inefficient. Use Threading API instead. (CreateThread, ExitThread, etc.) And then just loop within it.
_________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Jun 05, 2008 8:49 am Post subject: |
|
|
| You also need to send WM_KEYDOWN, not WM_CHAR.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jun 05, 2008 9:00 am Post subject: |
|
|
oh right cuz i want it to press the key. . thx:D
edit: the bot keeps crushing :\
look at the code now:
| Code: |
LPARAM lParam = ((int)MapVirtualKey(0x5A,0) << 16) + 1;
myPostMessage(hMS,WM_KEYDOWN,0,lParam);
|
_________________
Stylo |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jun 05, 2008 10:16 am Post subject: |
|
|
| 1qaz wrote: | oh right cuz i want it to press the key. . thx:D
edit: the bot keeps crushing :\
look at the code now:
| Code: |
LPARAM lParam = ((int)MapVirtualKey(0x5A,0) << 16) + 1;
myPostMessage(hMS,WM_KEYDOWN,0,lParam);
|
|
Lurc just told you to do
| Code: |
myPostMessage(hMS, WM_KEYDOWN, 0x5A, MAKELKEY(0x5A));
|
Even if you don't want to use his define, aren't you missing something in your code?
_________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Jun 05, 2008 10:37 am Post subject: |
|
|
| I think he was talking about wParam...
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jun 05, 2008 11:02 pm Post subject: |
|
|
the bot still curshing
| Code: |
void AutoLoot()
{
BOOL bLoot = TRUE;
while (bLoot)
{
LPARAM lParam = ((int)MapVirtualKey(0x5A,0) << 16) + 1;
if (hMS != NULL)
PostMessageX(hMS,WM_KEYDOWN,0,lParam);
}
ExitThread(0);
}
//
//
//
case WM_HOTKEY:
if (0x71)
{
DestroyWindow(hLoot);
lootFLAG = !lootFLAG;
if (lootFLAG)
{
hLoot = CreateWindowEx(NULL,L"STATIC",L"Auto Loot - Enabled",WS_CHILD | WS_VISIBLE,20,10,130,18,hWnd,(HMENU)IDC_STATIC_LOOT,GetModuleHandle(NULL),NULL);
SetFont();
hMS = FindWindow(L"MapleStoryClass",NULL);
CreateThread(0,0,(LPTHREAD_START_ROUTINE)AutoLoot,0,0,0);
}
else
{
hLoot = CreateWindowEx(NULL,L"STATIC",L"Auto Loot - Disabled",WS_CHILD | WS_VISIBLE,20,10,130,18,hWnd,(HMENU)IDC_STATIC_LOOT,GetModuleHandle(NULL),NULL);
SetFont();
}
}
break;
|
_________________
Stylo |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Thu Jun 05, 2008 11:28 pm Post subject: |
|
|
| samuri25404 wrote: |
| Code: |
myPostMessage(hMS, WM_KEYDOWN, 0x5A, MAKELKEY(0x5A));
|
|
| 1qaz wrote: |
| Code: |
PostMessageX(hMS,WM_KEYDOWN,0,lParam);
|
|
You don't see ANYTHING different about the parameters?
myPostMessage(hMS, WM_KEYDOWN, 0x5A, MAKELKEY(0x5A));
PostMessageX(hMS, WM_KEYDOWN, 0, lParam);
NOTHING?
_________________
|
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Thu Jun 05, 2008 11:34 pm Post subject: |
|
|
THat shouldn't make it crash, samuri.
_________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Jun 06, 2008 12:09 am Post subject: |
|
|
No, and why are you creating the static control all the time, again and again?
Just call SetDlgItemText.
Try debugging the bot to find out why it crashes, maybe the problem is PostMessageX and not the parameters.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Fri Jun 06, 2008 5:03 am Post subject: |
|
|
samurai, the parameters i use aren't suppose to crush the bot
i use it the same way with my previous bot and it did just fine :\
about the static control symbol, thx didnt know that i'll fix it :>
btw what does the 2nd parameter at SetDlgItemText contains i didnt understand that
_________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Fri Jun 06, 2008 7:45 am Post subject: |
|
|
| Code: |
SetDlgItemText(hWnd, IDC_STATIC_LOOT, &lpString);
//or
SetDlgItemText(hWnd, IDC_STATIC_LOOT, "yourtexthere");
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|