try using google
GetAsyncKeyState Function (Windows)
bool AutoShoot=false;
bool Toggle = false;Can someone tell me how to make a toggle in C++? I've been learning with a C++ tutorial (idk if I can link to it). This is how the tutorial say do it:if (KeyPressed == VK_F6)
{
if(Toggle)
{
AutoShoot=true;
}
else
{
AutoShoot=false;
}
}
But then another tutorial said do it a different way. Help?bool bValue = true;
if (!bValue)
cout << "The if statement was true" << endl;
else
cout << "The if statement was false" << endl;
try using google
GetAsyncKeyState Function (Windows)
roflwrong.
/
Last edited by Crash; 10-07-2010 at 02:19 PM. Reason: wrong
Dewerong (10-07-2010)
UltimateNoobX1, your a idiot. I was converting it my hotkey function from asm to C++. I know about GetAsyncKeyState.
So please don't act smart cause I can make you look really dumb. Thanks, Crash.HotkeyFunc proc
@GoBack:
invoke GetAsyncKeyState, VK_F5
.if eax !=0
.if maphack == 0
mov maphack, 1
invoke WriteMem, 1827678h, addr liteon, 1
invoke WriteMem, 0A31CBFh, addr NOP6, 6
print "Maphack / Cam lock is on",
.else
mov maphack, 0
invoke WriteMem, 1827678h, addr liteoff, 1
invoke WriteMem, 0A31CBFh, addr camrestore, 6
print "Maphack / Cam lock is off",
.endif
Events:
invoke Sleep, 100
jmp @GoBack
HotkeyFunc endp
@Crash:
I now have this
Would that work?if (keyCode == VK_F6)
{
if(Toggle)
{
Toggle = !Toggle;
AutoShoot=true;
}
else
{
Toggle = !Toggle;
AutoShoot=false;
}
}
Last edited by Dewerong; 10-07-2010 at 02:15 PM.
roflwrong.
Last edited by Crash; 10-07-2010 at 02:19 PM. Reason: wrong.
I wasn't talking to you. I meant the guy that posted above you. I fixed my post though. It was because he posted before you and then I was posting. Then you posted. So it looked like my post was directed to you.
@Crash:
I now have this
Would that work?if (keyCode == VK_F6)
{
if(Toggle)
{
Toggle = !Toggle;
AutoShoot=true;
}
else
{
Toggle = !Toggle;
AutoShoot=false;
}
}
Dewerong (10-07-2010)
The "Quick Reply" button isn't working. Anyways, thanks.
That is equivalent code and would be optimized.
[php]if (keyCode == VK_F6)
{
Autoshoot ^= 1;
if (Autoshoot)
;
else
;
} [/php]
well i still think you should use google