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 


Someone please give me a jumpstart(general help)

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

Joined: 03 Jun 2016
Posts: 1

PostPosted: Fri Jun 03, 2016 2:33 pm    Post subject: Someone please give me a jumpstart(general help) Reply with quote

So, Hello everyone, this is gonna be a long post.

So, i gonna have some free time in the summer, and i decided to go self education mode and learn some programming languages and stuff. I have programming experience, i programmed in lua a lot, i actually made AI vehicles for a race mode in MTA.
But... there i had lots of information that i was able to simply grab with stuff like getElementPosition and so on. I want to learn more general stuff but the problem is.. I dont know where to start.
There are lots of programming languages, but i like lua also i prefer it.

So what i basically want to do is automate EVERYTHING. Very Happy Because i love it and i dont mind if i need to learn billions of things for it, i just dont know what i dont know.. you know.

For example, what do i need to move my character in game? Like how can i mimic my keyboard inputs. How can i save positions, even just get positions? I can surely get my position in game with a bit of search but for EX how can i get a freshly spawned NPC's position? How can i check if there is no objstacle between us? And stuff like that. I dont want to write hacks actually, rather AI stuff.

So.. what programs should i use? Can i just use cheat engine and lua? Help please. Thanks. Smile
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Fri Jun 03, 2016 5:46 pm    Post subject: Reply with quote

Honestly those are fairly simple questions which little googling will get you the answers for.
I did self education as you call it, having 0 programming background, I started a c++ bot from scratch (when I look back at it the coding was horrible but it gave me necessary ground).
Anyway, idk lua but i reckon if you want to automate you want to bot, if you want to bot you'll need the usual core APIs -> readprocessmem, writeprocessmem, openprocess etc.
C++ is a good choice, if you don't mind coding a win32 console at first.
Delphi is another alright choice (CE is coded in delphi so you can even go ahead and build UCE) which will let you use GUI fairly easily, one downside is that Delphi is somewhat of a niche.
Well actually all of this is said better there :
http://wiki.cheatengine.org/index.php?title=Programming

At this point you might also consider on which computer is your program going to be used, will you distribute it ? some programming language are easier to port than others.

How are you going to mimic game input :
Games use generic input and/or raw input (basically overrides the OS's mouse settings such as acceleration etc... -> raw input is recommended in games if you have specific OS mouse settings which you do not want during your gaming sessions but that is a digression).

When i made my first bot I went with the API sendmessage /postmessage (you get a handle of the processus which you wanna bot and you send messages to it containing WM keys etc).
for input and so on :
https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms645543(v=vs.85).aspx

https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms644950(v=vs.85).aspx


How do you get NPC positions ? you scan memories with cheat engine, you get pointers, you read memories with your bot program (readprocessmemory).
You'll need to understand pointers perfectly if you want to write a bot btw.
At some point you'll also need to hook functions to retrieve addresses in which case there are the best tutorials about this on this forum (think author is ryllai)
About obstacle I don't know, I suspect it's fairly more complicated, might even be graphic engine specific ? I always hacked through obstacles.
There are games like WoW which use lua making easy the RE phase (finding which function to call in order to use skills, move etc) and there are other games for which this is a pain.
What I did was scan my position in the game 20 times a sec and overwrite the character direction with the right value to direct the character into space while sending the WM key corresponding to auto run on/off to the game window.
As for using skills back then I found the pointer to the skill bar emplacement (example F1 = skill on your skill bar) and i just wrote to it a value corresponding to the skill to this variable and then sent WM key for F1 in order to get the character to use the skill). Bottom line is if you lack some knowledge at first the are workarounds that you can find even if it does look ugly at the time being Embarassed

Sadly I don't know lua (shame right) so I've no idea if that'll be enough but if you are serious about this, MSDN should be your new friend, learn windows and the API (programming windows by Charles Petzold can be good although probably an overkill for now)

And just for the sake of it, the tools which you'll need to master sooner or later :
Cheat Engine // Ollydbg // IDA
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Sun Jun 05, 2016 2:10 pm    Post subject: Reply with quote

If you want to get into controlling a game from Lua, you are going to have to do one of two things:

1. Remote Process Reading/Writing (Like a trainer.)

Like a traditional trainer, you can read and write to the games memory externally and use Lua scripts to invoke things to happen. The downside here is there is a lot of read/write overhead to deal with when writing more intensive scripts. For example if you wanted to write a bot that will move a character to and from a location while doing various actions during that path, you are going to have to constantly read and write to the game to move the character, as well as check for conditions, invoke actions, etc.

While this does work, you do have overhead, slowdowns and sometimes inconsistencies depending on how well the bot is coded and how well you handle reading and writing to the games memory.

2. Injection

This is by far the better of the two options. You can inject a DLL into the game and take over control of various things, have direct access to objects like entities and so on, direct call game functions to tell things to move etc.

With that you can also embed Lua into your DLL to allow scripting to interact with the various things you want to expose to Lua.

For example, if you find a function in the game to tell the player to move to a given location, say something like:

Code:
MovePlayer(playerObject, x, y, z);


In Lua, you could expose that call doing something like this:
Code:
static int lua_MovePlayer(lua_State* L)
{
    // Obtain the arguments from the Lua call..
    auto player = lua_touserdata(L, -3);
    auto x = lua_tonumber(L, -2);
    auto y = lua_tonumber(L, -1);
   
    // Call pointer to the MovePlayer function..
    MovePlayer(player, x, y);
   
    return 0;
}


And in Lua to register this as a global function you can do:
Code:

lua_register(L, "MovePlayer", lua_MovePlayer);


You can also look into wrappers like Luabind to nice and cleanly wrap up various objects and such that make it easier to work with C++ based objects inside of Lua. Things like entities and such can be wrapped up into nice and clean classes and accessed similar to how they are in C++.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
5maestro
How do I cheat?
Reputation: 0

Joined: 06 Jun 2016
Posts: 0
Location: ibiza

PostPosted: Wed Jun 08, 2016 11:57 am    Post subject: if i can i reply too.. Reply with quote

have your time and take a look to the tutorial in ce itīs amazing i improved since sgnificantly but itīs your choice you are free to do as you wish like recent post said .{atom0s knows the stuff, lua seems a good option .....
but take your time and enjoy !!

_________________
5maestro
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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