Click Bots - C++ Game Hacking Tutorial Part 1 | Introduction and some Basics

  Рет қаралды 35,524

CasualGamer

CasualGamer

Күн бұрын

Пікірлер
@ai_coding
@ai_coding Жыл бұрын
Glad I stumbled upon this video series. You did a great job explaining & used a great example! I'm switching from Python to C++ so this is what I just needed. Can't wait to work on more!
@Robindahoodz
@Robindahoodz 4 жыл бұрын
This called human controlled automation adaptation in which we tell the computer where to look and how to do it and it'll do the rest itself but it's very impractical to ask the not to look through the entire screen every single time a new map loads. It's better to point the bot to the specific area to look for the frog and it will do everything else from there. Instead of getpixel scanning the entire screen it only has to scan a small square for those colors which improves performance.
@RoshanPradhan2
@RoshanPradhan2 4 жыл бұрын
Very factual and compact video!
@thecomputer1424
@thecomputer1424 8 ай бұрын
Windows API is hard to learn.
@edenrosales8214
@edenrosales8214 4 жыл бұрын
I think I am having trouble with retrieving the DC. I am trying to return the color of a pixel on my screen and when I use the GetPixel function on the game window it does not work, however it works with windows such as file explorer. Getting the coordinates of pixels on the screen works, why does the GetPixel function not work for me?
@littricks3631
@littricks3631 Жыл бұрын
where should I look for Zuma deluxe game?
@nyatsuri
@nyatsuri 3 жыл бұрын
thank you boy! i learn alot
@dinhnguyen464
@dinhnguyen464 2 жыл бұрын
Where I can find part 2 ?
@tudoroltean6799
@tudoroltean6799 4 жыл бұрын
Hey man! I tried making a bot for a game named 4Story , the only problem is that it only accepts raw input, what should I do / try?
@amrofn4361
@amrofn4361 4 жыл бұрын
so we got color pixels and coordinates ... now what we can do with them? is there a tutorial to automate mousemovement and mouseclicks and keyboard inputs to specific location or pixel? + did u make a fully automatic bot for this game yet? id love to see how it was done... the mousemovements and all the automation.... i see no automation done in this video
@casualgamer1791
@casualgamer1791 4 жыл бұрын
I did a second part its on clicks and keybard input: kzbin.info/www/bejne/oGW5d6JqlsiiqLM Sadly I did not continue the series after that (yet). With this game i would probably have to use OpenCV
@amrofn4361
@amrofn4361 4 жыл бұрын
@@casualgamer1791 Can you please continue it, and make a fully automated bot for the game in only one map? id love to see how it works so that i can create a bot for my game aswell... but at the moment i'm not sure what can i do... i can only get the pixel colors and x,y pos and that's it..
@swoodc
@swoodc 3 жыл бұрын
what about AHK and the findtext() function that gets pixel colors
@moviesynopsis001
@moviesynopsis001 4 жыл бұрын
Hey mate, on the game window I am trying it for it only returns a 0 or 255 for any of the Colors. I can get this to work with autoit, but just cant seem to get it working on c++, do you have any ideas for why this is returning 255?
@casualgamer1791
@casualgamer1791 4 жыл бұрын
provide code sniped pls
@testingtesting1602
@testingtesting1602 3 жыл бұрын
any solution?
@smartphonecodes1
@smartphonecodes1 4 жыл бұрын
hello there , i want to ask that how you search for them find new things and many more , i am also intrested in there and want to learn everything that we can do using c , c++ , also i want to ask some doubts about my learnings I want to learn from you how can i contact you
@casualgamer1791
@casualgamer1791 4 жыл бұрын
Answered on discord
@alanrichter8594
@alanrichter8594 4 жыл бұрын
hi, im trying to do the same thing but for other game "all the code is the same im changing only once the bot find the pixel and the pos", but something is wrong with GetPixel(), it says me "undefined reference to '__imp_GetPixel' im using the windows.h library so is not that, could you help me?
@casualgamer1791
@casualgamer1791 4 жыл бұрын
stackoverflow.com/questions/7493961/why-does-using-getpixel-result-in-an-undefined-reference
@alanrichter8594
@alanrichter8594 4 жыл бұрын
@@casualgamer1791 thanks, but i erased the code and now that getpixel is solved... imgur.com/a/4falZIr just check the error i dont understand what is happening xd
@casualgamer1791
@casualgamer1791 4 жыл бұрын
​@@alanrichter8594 Line7 Change LPCWSTR to LPCSTR. And read into what these mean. It will help you in the long run
@alanrichter8594
@alanrichter8594 4 жыл бұрын
@@casualgamer1791 i finally did it, i changed w for a t, and i dont know what i happen but its ok, but I have a doubt (if you dont want to help me is ok :v) how i could check if for example i have piano tiles, and the first row have 200, 200 for x and y, and if i move the mouse there and the color are 0, 0, 0, do something
@benji9107
@benji9107 4 жыл бұрын
0:14 no worries just trying to make a way for my ai to play Minecraft
@casualgamer1791
@casualgamer1791 4 жыл бұрын
Ambitious :D
@zelazko1566
@zelazko1566 4 жыл бұрын
I have some questions becouse it doesn't work for me 1. If you include "pch.h" i think we should download it or something becouse i get "pch.h no such file or directory" 2. I thing this header defines hWND and windows_tile Pls help
@zelazko1566
@zelazko1566 4 жыл бұрын
EDIT: sorry, windows_tiTle was my mistake
@casualgamer1791
@casualgamer1791 4 жыл бұрын
Just set project to not use precompiled headers and remove any #include pch.h
@vadosg1238
@vadosg1238 4 жыл бұрын
Hi, thanks for content, but where do I get the "pch.h" file?
@casualgamer1791
@casualgamer1791 4 жыл бұрын
You do not need any such file. Just set precompiled headers to false in your project settings
@toddhalpert9398
@toddhalpert9398 4 жыл бұрын
Hello, it is me again and this I really can't find the solution. I can't seem to run my code that has a GetPixel function because there was an undefined reference. I am using Dev-C++ to code and based on my small amount of time researching, the said function was not in the default libraries and compiler. Can you please provide a header or a download link to the header. I've been stuck in here for days now.
@casualgamer1791
@casualgamer1791 4 жыл бұрын
The getpixel function is the undefined reference? Just include Windows.h
@toddhalpert9398
@toddhalpert9398 4 жыл бұрын
@@casualgamer1791 I did. I think it is because of dev-c. It is the only undefined reference. The other functions such as the setcursorpos are just fine.
@casualgamer1791
@casualgamer1791 4 жыл бұрын
Possible. I have no experience with dev-c
@toddhalpert9398
@toddhalpert9398 4 жыл бұрын
@@casualgamer1791 My Visual Studio is acting weird because I can't run any code there, it only says that it cannot fin the file specified.
@toddhalpert9398
@toddhalpert9398 4 жыл бұрын
@@casualgamer1791 I got it working now. What function should I use to make my program click a certain with with a certain colorref or rgb value?
@ZaryarWasTaken
@ZaryarWasTaken 4 жыл бұрын
Hey, how can I find the LPCWSTR(window title) of google chrome?
@ZaryarWasTaken
@ZaryarWasTaken 4 жыл бұрын
For everyone that is still wondering LPCWSTR wt = L" - Google Chrome";
@8ack2Lobby
@8ack2Lobby 4 жыл бұрын
Bro! I am getting same color: 4294967295 and Red: 255, Green: 255 and Blue 255. My code is same copy of yours... Any idea?
@karkarplays3798
@karkarplays3798 2 жыл бұрын
@mralberto40 but the numpad1 works properly for displaying coords
@matt-fk7zx
@matt-fk7zx 5 жыл бұрын
says no such file for pch.h do i have to download that
@casualgamer1791
@casualgamer1791 5 жыл бұрын
This is a specific visual studio issue. Basicaly you gotta set the project to not use precompiled headers. The following helped me fix that: developercommunity.visualstudio.com/content/problem/350067/c-include-pchh-is-required-when-precompiled-header.html
@paulomeirel3s
@paulomeirel3s 5 жыл бұрын
What language is this? U are use visual studio code?
@invictus2233
@invictus2233 5 жыл бұрын
@@paulomeirel3s it's C++ Visual Studio Code is an IDE not a programming language
@shukishan
@shukishan 5 жыл бұрын
@@paulomeirel3s if you don't know the difference between visual studio (an IDE) and a programming languages, I suggest you look into the basics of C++ first rather than to hop on board on the windows library. lol.
@m4y0r14
@m4y0r14 3 жыл бұрын
Why not if(GetAsyncKeyState(VK_NUMPAD1) & 1)?
@casualgamer1791
@casualgamer1791 3 жыл бұрын
Both options are possible
@prabhatprabhat1519
@prabhatprabhat1519 5 жыл бұрын
Hey plzz tell me how to make c++ bot for t - rex run ( google chrome's game) using pixel color method.
@casualgamer1791
@casualgamer1791 5 жыл бұрын
Sounds like a fun project. Nothing i can answer in a vew lines but might make a video on it
@prabhatprabhat1519
@prabhatprabhat1519 5 жыл бұрын
@@casualgamer1791 thnx buddy I kinda have this deadline for this project that's 12 days away. I have no clue about using windows.h library. plz save me
@Xfran1998X
@Xfran1998X 5 жыл бұрын
error: cannot convert 'LPCWSTR' {aka 'const wchar_t*'} to 'LPCSTR' {aka 'const char*'} hmm...
@casualgamer1791
@casualgamer1791 5 жыл бұрын
Since this is out of context i can only guess but id say you should try and change your project settings: "If, in your project settings, in the "General" tab, your character set is "Use Multi-byte character set" then TCHAR is an alias forchar. However, if it's set to "Use Unicode character set" then TCHAR is an alias forwchar_t instead."
@Xfran1998X
@Xfran1998X 5 жыл бұрын
@@casualgamer1791 i had not linked gdi32.dll, i just linked it on codeblocks and borked fine ^^. Pd: If values are stored on server and is a server-sided game its imposible to hack isnt it? Pd2: would be nice if u continue the zuma bot course.
@casualgamer1791
@casualgamer1791 5 жыл бұрын
Glad you solved it :). It only means that you have no acces to the values which are stored server side but usualy a lot of stuff is stored client side (like position for instance). Haha continue the zuma bot, sure, sounds fun :)
@Anony03
@Anony03 4 жыл бұрын
@@Xfran1998X I don't know how to "link" gbi32.dll... Can you tell it to me? Please, i've the same problem
@Xfran1998X
@Xfran1998X 4 жыл бұрын
@@Anony03 i dont remember, i think the problem is from graphics.h library that is not linked to the proyect or not installed. Try this: kzbin.info/www/bejne/nIjQmqZqqrt2fsk
@Watermelon_cat815
@Watermelon_cat815 6 ай бұрын
can you make this for fnf
@ServalCamouflage
@ServalCamouflage 4 жыл бұрын
Okay i’m a completely noob when it comes to programming .. What’s my road plan to be able to make bots on my own?
@casualgamer1791
@casualgamer1791 4 жыл бұрын
From my personal experience: 1. Analyse the situation: Can whatever you want to do be done automaticaly Cosider these things: To get information: Get pixel color at coordinates, potentialy external information (lets say you want to write a trading bot for an mmo auction house: Current item prices from some website with api) Automatied imput: Mouse and keyboard. 2. Collect the parts: Make input work data collection (for instance color C at position x,y means you know you can take action A) 3. Put the parts together: Step by step everything that needs to be done: Example: 1. press key G to open some window 2. wait untill window is open (check color at some position untill it indicates the window is open) 3. klick at some location inside that window to do some action 4. etc. Personaly my first project (no details :P) was a pixel bot and it took me over a month to get it running. Extremly messy code but whatever just get it working and learn from your mistakes ^^
@ServalCamouflage
@ServalCamouflage 4 жыл бұрын
CasualGamer don’t know how to thank you for this informative comment .. But i think i’ll have to learn programming first :D
@casualgamer1791
@casualgamer1791 4 жыл бұрын
No problem. It is a good idea to learn some basics first. Starting with "hello world" then loops (for, while,...) and if statements. Understanding classes would be good too. Personally i always try to combine learning and doing as much as possible just reading/watching theory alone is not enough for me to stay motivated/actually internalise things
@fikcjamarzen7495
@fikcjamarzen7495 5 жыл бұрын
How to write a bot code that will only do in one window (minimized window) :)?
@casualgamer1791
@casualgamer1791 5 жыл бұрын
I am not aware of any option clicking in minimized widows. The way i solved it in the past for my needs is with a virtual machine
@fikcjamarzen7495
@fikcjamarzen7495 5 жыл бұрын
@@casualgamer1791 Thanks !
@Saaahmed0
@Saaahmed0 4 жыл бұрын
How did u learn C++
@casualgamer1791
@casualgamer1791 4 жыл бұрын
I wanted to get something done and c++ was the best option. Many different sources and very ugly code ^^ Did the whole thing without even knowing what "object oriented" means. That's just how I like doing things: Set some goal, learn how to get it running, no matter how ugly it may be. I probably would not recommend doing it that way tho. Best way would probably be a combination of reading/watching theory and doing practical stuff. Endless amount of sources and there is no single one i would recommend over all others. Just make sure that whatever you write in your code you understand what is happening and why it works.
@ta3113ta
@ta3113ta 5 жыл бұрын
Thank you
@joostbosman7243
@joostbosman7243 4 жыл бұрын
how do you program when a certain color moves past a x coordinate it does an action (like press spacebar)?
@casualgamer1791
@casualgamer1791 4 жыл бұрын
I believe my next video in the series should help with that question ("simulating mouse and keyboard events")
@joostbosman7243
@joostbosman7243 4 жыл бұрын
@@casualgamer1791 thanks, yeah what im trying to make is: when within a certain box on my screen color x appears actions start to follow (like 1.32 sec after color is detected program presses spacebar for me) thanks btw for insanely fast respone (actually shocked for a response at all xD)
@casualgamer1791
@casualgamer1791 4 жыл бұрын
You could loop through the area with for(x...) for(y...) and inside if(getpixelcolor=...) this does work in theory. In Practice the question is how long does the color remain on screen because this method is not very fast
@Shemetaka
@Shemetaka 4 жыл бұрын
Great!
@mithicash1444
@mithicash1444 3 жыл бұрын
Quick advice, when making "basic introduction" tutorials you always need to assume that you are speaking to people who have never tried doing what you are doing. First off, you say nothing about header files, how they work, and where they come from. Sure, you posted links in the description but piecing this all together from half a dozen links which often point to another half a dozen links each is insane. Making this mistake you basically ensure that most people new to this topic would never be able to actually follow your method, but only watch and pretend like they do.
@casualgamer1791
@casualgamer1791 3 жыл бұрын
Thank you for the input. However, I do not agree. What you describe are cpp basics (which are a prerequisite). My videos on the other hand, cover game hacking basics. Maybe I should have mentioned that at the beginning of the video.
@fikcjamarzen7495
@fikcjamarzen7495 5 жыл бұрын
Please auto cast diablo 2 script :) in window.
@tristanmacc
@tristanmacc 2 жыл бұрын
man this is so confusing i hate it
It's not hard to make games in C++
6:23
Low Level Game Dev
Рет қаралды 74 М.
How to make advanced image recognition bots using python
15:01
Kian Brose
Рет қаралды 1,4 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
How To Make An ESP Hack - Part 1: Entity List
8:42
CasualGamer
Рет қаралды 212 М.
PirateSoftware is right, this needs to stop
15:14
Theo - t3․gg
Рет қаралды 93 М.
How I make bots using python (educational)
17:12
Kian Brose
Рет қаралды 567 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 156 М.
Arch Linux Experience - Virtualization
38:43
Bog
Рет қаралды 100 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 518 М.
Why Can't We Make Simple Software? - Peter van Hardenberg
41:34
Handmade Cities
Рет қаралды 162 М.
Game Hacking Library [C++]
6:24
CasualGamer
Рет қаралды 10 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН