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!
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.
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?
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?
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
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 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 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
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
I did a second part its on clicks and keybard input: ruclips.net/video/j4VFo4acorQ/видео.html Sadly I did not continue the series after that (yet). With this game i would probably have to use OpenCV
@@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..
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
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."
@@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.
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 i dont remember, i think the problem is from graphics.h library that is not linked to the proyect or not installed. Try this: ruclips.net/video/fWmis4uVCHg/видео.html
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 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 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
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 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.
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 ^^
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
@@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)
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
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.
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.
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.
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!
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.
Very factual and compact video!
Windows API is hard to learn.
thank you boy! i learn alot
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?
where should I look for Zuma deluxe game?
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?
what about AHK and the findtext() function that gets pixel colors
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?
provide code sniped pls
any solution?
Where I can find part 2 ?
0:14 no worries just trying to make a way for my ai to play Minecraft
Ambitious :D
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
Answered on discord
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?
stackoverflow.com/questions/7493961/why-does-using-getpixel-result-in-an-undefined-reference
@@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
@@alanrichter8594 Line7 Change LPCWSTR to LPCSTR. And read into what these mean. It will help you in the long run
@@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
Hey, how can I find the LPCWSTR(window title) of google chrome?
For everyone that is still wondering LPCWSTR wt = L" - Google Chrome";
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
I did a second part its on clicks and keybard input:
ruclips.net/video/j4VFo4acorQ/видео.html
Sadly I did not continue the series after that (yet). With this game i would probably have to use OpenCV
@@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..
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
EDIT: sorry, windows_tiTle was my mistake
Just set project to not use precompiled headers and remove any #include pch.h
error: cannot convert 'LPCWSTR' {aka 'const wchar_t*'} to 'LPCSTR' {aka 'const char*'}
hmm...
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."
@@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.
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 :)
@@Xfran1998X I don't know how to "link" gbi32.dll... Can you tell it to me? Please, i've the same problem
@@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: ruclips.net/video/fWmis4uVCHg/видео.html
Bro! I am getting same color: 4294967295 and Red: 255, Green: 255 and Blue 255. My code is same copy of yours... Any idea?
@mralberto40 but the numpad1 works properly for displaying coords
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.
The getpixel function is the undefined reference? Just include Windows.h
@@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.
Possible. I have no experience with dev-c
@@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.
@@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?
Hi, thanks for content, but where do I get the "pch.h" file?
You do not need any such file. Just set precompiled headers to false in your project settings
Why not if(GetAsyncKeyState(VK_NUMPAD1) & 1)?
Both options are possible
Hey plzz tell me how to make c++ bot for t - rex run ( google chrome's game) using pixel color method.
Sounds like a fun project. Nothing i can answer in a vew lines but might make a video on it
@@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
says no such file for pch.h do i have to download that
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
What language is this? U are use visual studio code?
@@paulomeirel3s it's C++ Visual Studio Code is an IDE not a programming language
@@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.
How to write a bot code that will only do in one window (minimized window) :)?
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
@@casualgamer1791 Thanks !
Thank you
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?
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 ^^
CasualGamer don’t know how to thank you for this informative comment .. But i think i’ll have to learn programming first :D
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
how do you program when a certain color moves past a x coordinate it does an action (like press spacebar)?
I believe my next video in the series should help with that question ("simulating mouse and keyboard events")
@@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)
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
can you make this for fnf
How did u learn C++
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.
Great!
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.
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.
Please auto cast diablo 2 script :) in window.
man this is so confusing i hate it