| View previous topic :: View next topic |
| Author |
Message |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Fri Nov 23, 2007 12:09 pm Post subject: [C++] Initialization Help. |
|
|
Im currently working on a MapleStory bot. And i need help,
lets say i wantt o use GetAsyncKeyState,
F1 for on, and F2 for off.
I got it all working, F1 signals the bot to send the Z key.
But when i push F2, it doesnt stop, ive tried numerous methods, and they all failed, here is my current method.
| Code: | if (GetAsyncKeyState(VK_F1)){
i = 1;
Sleep(10);
}
if (GetAsyncKeyState(VK_F2)){
i = 0;
Sleep(10);
}
Sleep(100);
while(i == 1){
Sleep(100);
PMX(Wnd, WM_KEYDOWN, 0, ((MapVirtualKey('Z',0) << 16) & 0x00FF0000));
}
Sleep(10);
}
|
Right now, this isnt working, can someone help me ?
|
|
| Back to top |
|
 |
goldengold Grandmaster Cheater Supreme
Reputation: -1
Joined: 11 Nov 2006 Posts: 1841 Location: -.-
|
Posted: Fri Nov 23, 2007 12:17 pm Post subject: |
|
|
Is your bot gonne have auto pot?
_________________
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Fri Nov 23, 2007 12:17 pm Post subject: |
|
|
| After i figure out how to get it working, yes it will.
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Fri Nov 23, 2007 12:22 pm Post subject: Re: [C++] Initialization Help. |
|
|
Right now when you start it it gets stuck in an infinite loop at the while, as the GAKS() is outside the loop.
| Code: | void func(void)
{
for(;;) {
if(GetAsyncKeyState(VK_F1)) {
for(;;) {
if(GetAsyncKeyState(VK_F2))
break;
Sleep(10);
PMX(Wnd, WM_KEYDOWN, 0, ((MapVirtualKey('Z',0) << 16) & 0x00FF0000));
}
}
Sleep(10);
}
} |
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Fri Nov 23, 2007 12:29 pm Post subject: |
|
|
omfg. THANK YOU FLYTE, ive been trying to figure this for a few hours, as im just a beginner at C++. TY +rep
|
|
| Back to top |
|
 |
|