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 


Help me creating a simple bot

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
thalesgomes93
How do I cheat?
Reputation: 0

Joined: 25 Feb 2016
Posts: 5
Location: Brazil

PostPosted: Thu Feb 25, 2016 7:05 pm    Post subject: Help me creating a simple bot Reply with quote

I'm a programmer, and everything begins when i liked the idea of understanding / hacking games.

I used CE a long ago to cheat a online game, but never did the codes/ memory edit by myself, always by someone that posted in some website...

So, now, long time after that "dream of hacking" and understanding how things works, i've been planning creating a simple bot to a private server.

Actually, i dont want to "cheat", just want to be able to "play" when i'm AFK, cuz game is one of my fav hobbies.

By now, i have an idea how things works, i can get the addresses of some offline games and things like this, but i couldnt get an base address of the game i want to bot...

And, once i got this base address idk whats next, i want at least move my caracter with some virtual keyboard presses or something like this.

Maybe Anyone can help me ?

Thanks in advance!
Back to top
View user's profile Send private message
realrbn
Expert Cheater
Reputation: 3

Joined: 22 Jan 2016
Posts: 112

PostPosted: Fri Feb 26, 2016 6:10 am    Post subject: Re: Help me creating a simple bot Reply with quote

thalesgomes93 wrote:
I'm a programmer [...]
never did the codes/ memory edit by myself, always by someone that posted in some website...

How are you a Progammer then?
Back to top
View user's profile Send private message
thalesgomes93
How do I cheat?
Reputation: 0

Joined: 25 Feb 2016
Posts: 5
Location: Brazil

PostPosted: Fri Feb 26, 2016 6:18 am    Post subject: Reply with quote

Really?
I was talking about the trainers/ cheating.

I work as programmer with java/ javascript/ delphi/ .net/ c# etc (i WORK with this, but never used this to cheat).
Back to top
View user's profile Send private message
thalesgomes93
How do I cheat?
Reputation: 0

Joined: 25 Feb 2016
Posts: 5
Location: Brazil

PostPosted: Mon Feb 29, 2016 10:17 am    Post subject: Reply with quote

up ?
Back to top
View user's profile Send private message
elusiveness
Newbie cheater
Reputation: 1

Joined: 16 Feb 2016
Posts: 22

PostPosted: Mon Feb 29, 2016 12:41 pm    Post subject: Reply with quote

Well i guess the title is not that bad, it probably will help future googlers, and i'm in a good mood today, so i won't ignore you, ok i'm being a little cocky right now Mr. Green but from a scrub to another scrub making a bot is a long ass pain! but a good start will be to get solid informations about your character like current/maximum HP, current/maximum MP, character coordinates XYZ axis, and last but not least what direction your character face.

ps: never tested it before, but you may avoid the following struggle by making a CE trainer.

Once you have found those informations as static values ofc (green address), you pretty much did 1% of the work, congratulation. Now since you are a programmer you may or not use the windows API (windows.h) if you plan to write this in C# you will have to do a lot of interop marshaling, and import unmanaged code such ReadProcessMemory to be able to read from the target process memory (as CE does if i'm not wrong) in order to read the current/max HP, etc. I suggest you to search for fleephacks on YT, you will find assets to understand how does all this work, also the MSDN is a good source of information.

Now lets say you are able to access these above informations from whitin your code, you already did 5% of the work, yay! Since you wanna do a simple bot, instead of writing an ass system of path finding, you'll pick the easy way which is... "the profiles", yep, long story short, you will have to write a little program who records your coordinates at regular interval, while you are moving your character. These profiles will be later in use on your bot to define the character path to follow, once the file path read (The best suitable files for these are by far XML), you will have to store these coordinates into a list of struct/class.

If you succeed the above then, you may see the end of it, you did 10% of the work. Assuming you are not doing dll injection, you will have to write a solid function like lookAt(Coordinates placeToLookAt) to make your character face in the right direction, at this time you will feel the pain of the geometry... but you are pretty much done with the profile logic, you will have to loop your list of coordinates to make your character move through these blindly.

The 90% left are the combat logic, making your bot using a potion when his HP or MP are under a certain level, using spells/attacks in an effective order, etc... only at this point you may say that you "made" a real bot when it is able to fight as good as a player would.
Back to top
View user's profile Send private message
thalesgomes93
How do I cheat?
Reputation: 0

Joined: 25 Feb 2016
Posts: 5
Location: Brazil

PostPosted: Mon Feb 29, 2016 6:50 pm    Post subject: Reply with quote

Great! Lots of informations!

First of all, Thank you very much for taking your time to try to help me!
So, this is kinda of a challenge to myself, since I started my life as a "IT guy" for gaming reasons lol.
About this "personal project", my first idea was to at least "move" my character left/right or up/down since I already found the static addresses of posX and posY. (but have no idea how to send commands to "move" my character)
"posZ" is missing, but I don't think I'll need it by now, the game that I'm trying to create a bot, is almost a "2D" game and also it's a private server.
I must be honest here, I didn't take that much time trying to "doing stuff" other then reading, cause most of the time I'm at work or I'm with my girlfriend, so this makes me have not that much time.

About the bot now, while I was researching at internet, I've found out that people use waypoints to "mark" the hunt, so the character would be "heading to WP1>heading to WP2>heading to WPn".
And I've also noticed that all in the game have some sort of "int/double" code, so I'm able to "scan" (no ideas how to do this yet) the area for this code, in this case, the "monsters" that i'm hunting, and when they're dead, their body has another code, and I can loot the items.
Do you think that maybe there's another way other than dealing with memory addresses to send my "movements" to the game, and "scanning" the game?
If there's no other way to deal with this, Its better to me start right the way, because I have a lot to learn lol.

So, anyone may have any ideas how can I scan/move by my bot?

Thank you in advance!
Back to top
View user's profile Send private message
elusiveness
Newbie cheater
Reputation: 1

Joined: 16 Feb 2016
Posts: 22

PostPosted: Tue Mar 01, 2016 10:53 am    Post subject: This post has 1 review(s) Reply with quote

thalesgomes93 wrote:
"posZ" is missing, but I don't think I'll need it by now


Yes, you won't need Z axis that much, because if you move on X or Y axis on stairs, or by falling from a cliff, your character will also move on Z axis in consequences, so it does not matter much.

thalesgomes93 wrote:
my first idea was to at least "move" my character left/right or up/down since I already found the static addresses of posX and posY. (but have no idea how to send commands to "move" my character)


Again, your bible will be the MSDN, it will take time for you to be used to it, but don't be scared, become familiar with IT, its very intuitive... now to answer you, there is many way to move your character, the most basic one will be the use of SendInput(), if you do Dll injection, you also may use the own game moving function, but its way more tricky to do, and not always a good idea.

thalesgomes93 wrote:
And I've also noticed that all in the game have some sort of "int/double" code, so I'm able to "scan" the area for this code, in this case, the "monsters" that i'm hunting, and when they're dead, their body has another code, and I can loot the items.


I don't really get what you are trying to say, but you may are referring to the monster UID (unique identifier), on small game it may be a 4 bytes value, but on bigger games the process may run for a longer period like weeks (such a server who generate these monsters), its possible that more than 4 294 967 295 (size of 4 bytes -1) monster are killed/generated before the game process is shut down, so instead they use a 8 bytes value to avoid this inconvenience.

This monster UID is used for the monster lifespan when a monster is "born" the game gives it an UID, and many boolean status like isAlive, isLooted, etc.. (all of these inside a struct/class ofc) once the monster is dead "isAlive" become false, then after some time the monster despawn, and its struct/class are no longer needed so its freed from the memory.. Again the game "born" a new monster, gives it an UID so you will be able to hit and kill it.. and only this monster instead of all the monster who share the same name. See the things that way: two guys can have same first name and last name, but probably not the same DNA.

thalesgomes93 wrote:
I must be honest here, I didn't take that much time trying to "doing stuff" other then reading


Here is a good advice from a wise man: DO IT! Just do It! Don't let your dreams just be dreams, Yesterday you said tomorrow, SO JUST DO IT! Make Your Dreams Come True! Some people dream of success while you're gonna wake up and work HARD at it! Laughing No seriously, do already the first 10%, and i can tell you that it will take you time and sharp enough your skills for you to continue by yourself, more you'll do it, better you will be at it. Also if you wanna be a monk of game hacking, you will have to dedicate your life to it, praise your god Dark Byte every morning facing north east from brazil will be just fine, you also shall leave your pagan woman, and cease being exploited by your boss, j/k...

You don't need to face north east.

Practice, practice, practice... do already the first part, don't scatter too much, start by building a small application who record waypoints while you are moving through the map like i told you on the above answer and create few xml profiles.
Back to top
View user's profile Send private message
thalesgomes93
How do I cheat?
Reputation: 0

Joined: 25 Feb 2016
Posts: 5
Location: Brazil

PostPosted: Tue Mar 01, 2016 6:32 pm    Post subject: Reply with quote

elusiveness wrote:
... now to answer you, there is many way to move your character, the most basic one will be the use of SendInput(), if you do Dll injection, you also may use the own game moving function, but its way more tricky to do, and not always a good idea.


Why would it not be a good idea?
About dll injection, I never read about doing it maybe you have some good source about this subject?


elusiveness wrote:
I don't really get what you are trying to say, but you may are referring to the monster UID (unique identifier), on small game it may be a 4 bytes value, but on bigger games the process may run for a longer period like weeks (such a server who generate these monsters), its possible that more than 4 294 967 295 (size of 4 bytes -1) monster are killed/generated before the game process is shut down, so instead they use a 8 bytes value to avoid this inconvenience.

This monster UID is used for the monster lifespan when a monster is "born" the game gives it an UID, and many boolean status like isAlive, isLooted, etc.. (all of these inside a struct/class ofc) once the monster is dead "isAlive" become false, then after some time the monster despawn, and its struct/class are no longer needed so its freed from the memory.. Again the game "born" a new monster, gives it an UID so you will be able to hit and kill it.. and only this monster instead of all the monster who share the same name. See the things that way: two guys can have same first name and last name, but probably not the same DNA.


Actually, I was thinking about something like a class concept...
Example:
I have an instance of a "Wolf" class.
The id of the Wolf instances would be 1
The name of the instance would be "Wolf"
The hp of the instance would be 100
etc...

With this idea, i can say that every Wolf would have the same id 1, and if i'm hunting only wolves I need to scan for id 1.
And if i'm not wrong, this game works this way, the id of all monsters are the same, like a "static" value but every instance of the monster will have its diffrent "current" status like current hp, or boolean for live/dead etc...
I hope I could make it clearly then I did before, its kinda hard to think in one language and write in another one lol.

elusiveness wrote:

Here is a good advice from a wise man: DO IT! Just do It! Don't let your dreams just be dreams, Yesterday you said tomorrow, SO JUST DO IT! Make Your Dreams Come True! Some people dream of success while you're gonna wake up and work HARD at it! Laughing


THATS what i'm talking about!! DO IT!
Even if it take long time, I intend to keep trying until I can reach some personal goals.

elusiveness wrote:
Practice, practice, practice... do already the first part, don't scatter too much, start by building a small application who record waypoints while you are moving through the map like i told you on the above answer and create few xml profiles.


The real thing that is kinda annoying me is that i have no idea where to start.
Lets suppose that I've hardcoded the waypoints for posX and posY, lets say about 10 of them.
And I can already find the real location of my own position.
I have no idea YET how can i "send a command" to make my character move...
Maybe i have to "find what access" my addresses and create a routine to make my character move?
Any suggestion?

Again, Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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