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 


KeyListen [c++]

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

Joined: 26 Feb 2007
Posts: 27

PostPosted: Fri Mar 16, 2007 1:19 pm    Post subject: KeyListen [c++] Reply with quote

What i want to do is make it so ingame the user can type a string in the chat box that says something like:

'goto 119 200 20

when the user types this command i want to run a function that edits values in the game. These valeus correspond with x,y and map location.

So basically theres 2 things that i need help with..
1. How do i make a keylistener that will listen for the string "`goto" and then do a function
2. How do i extract the x, y and map number from the string... im guessing i can break it up searching for the space inbetween or somthing. But im new to c++ so im really not sure how to go about this.

p.s. Im writing this in c++

_________________
-amen
Back to top
View user's profile Send private message AIM Address MSN Messenger
Drkgodz
Flash moderator
Reputation: 2

Joined: 17 Jul 2006
Posts: 2997
Location: Houston

PostPosted: Sat Mar 17, 2007 3:05 pm    Post subject: Reply with quote

There would be a lot of IFs, and you would have to create something a bit like a keylogger.
_________________
Back to top
View user's profile Send private message
sumone4life
Cheater
Reputation: 0

Joined: 26 Feb 2007
Posts: 27

PostPosted: Sat Mar 17, 2007 9:54 pm    Post subject: Reply with quote

well yes i know that, but i just dont know how to go about doing it... any one have any ideas or suggestions?
_________________
-amen
Back to top
View user's profile Send private message AIM Address MSN Messenger
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Sun Mar 18, 2007 12:37 am    Post subject: Reply with quote

Code:
string myString = "";
for(int i=0;i<256;i++)
{
  if(getasynckeystate(i)>0)
    myString=myString+chr(i);
}
if(pos(myString,"goto")>0)
{
  workyoshit;
}


I'm not a C++ guy, but the gist is there. (Some might be written in Delphi, but just grab MSDN and look up some relations.)

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
kkid28
Expert Cheater
Reputation: 0

Joined: 30 Sep 2006
Posts: 110
Location: The only flat part of the planet.

PostPosted: Sun Mar 18, 2007 1:09 am    Post subject: Reply with quote

He heh, I'm learning this in computer science next week, disassembling a string. Are you doing console programming in C++? (well I assume but...)

You know, before I quit C++ (since we learn BASIC in computer science) I was actually looking in responding instantly as a key is pressed. I skiddied one script and found that the keys have certain numbers and it would basically loop until a key is pressed (then continue looping) and it would display the arrow you hit (in letters "UP" "DOWN"etc) through IF statements. Just a thought of something you should look into. I gave up because I couldn't find any other key numbers. ie "A" is 65 Shocked

_________________
Favourites

Click
Back to top
View user's profile Send private message
Uzeil
Moderator
Reputation: 6

Joined: 21 Oct 2006
Posts: 2411

PostPosted: Sun Mar 18, 2007 2:50 am    Post subject: Reply with quote

kkid28 wrote:
since we learn BASIC in computer science
Sounds more like ancient computer history Cool


Har har.

_________________


Mini Engine v3.0
Mipla v1.0

Reposted old threads out of the MS section.
Back to top
View user's profile Send private message
sumone4life
Cheater
Reputation: 0

Joined: 26 Feb 2007
Posts: 27

PostPosted: Sun Mar 18, 2007 6:54 am    Post subject: Reply with quote

kkid28, yeaj all the keys have a numerical values... there are tables online if you are curious. Uzeil i like that alot, ill have to try that. i could search in the string for 'goto and for the numerical values..

Thanks alot ill give that a try.

_________________
-amen
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