Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] Initialization Help.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Fri Nov 23, 2007 12:09 pm    Post subject: [C++] Initialization Help. Reply with quote

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 ? Embarassed
Back to top
View user's profile Send private message AIM Address MSN Messenger
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Fri Nov 23, 2007 12:17 pm    Post subject: Reply with quote

Is your bot gonne have auto pot?
_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Fri Nov 23, 2007 12:17 pm    Post subject: Reply with quote

After i figure out how to get it working, yes it will.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Nov 23, 2007 12:22 pm    Post subject: Re: [C++] Initialization Help. Reply with quote

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
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Fri Nov 23, 2007 12:29 pm    Post subject: Reply with quote

omfg. THANK YOU FLYTE, ive been trying to figure this for a few hours, as im just a beginner at C++. TY +rep Very Happy
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites