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

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 84

  • @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 года назад +3

    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 года назад +4

    Very factual and compact video!

  • @thecomputer1424
    @thecomputer1424 8 месяцев назад +1

    Windows API is hard to learn.

  • @nyatsuri
    @nyatsuri 3 года назад +2

    thank you boy! i learn alot

  • @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?

  • @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?

  • @swoodc
    @swoodc 3 года назад

    what about AHK and the findtext() function that gets pixel colors

  • @moviesynopsis001
    @moviesynopsis001 4 года назад +1

    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?

  • @dinhnguyen464
    @dinhnguyen464 2 года назад

    Where I can find part 2 ?

  • @benji9107
    @benji9107 4 года назад +2

    0:14 no worries just trying to make a way for my ai to play Minecraft

  • @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

  • @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

  • @ZaryarWasTaken
    @ZaryarWasTaken 4 года назад

    Hey, how can I find the LPCWSTR(window title) of google chrome?

    • @ZaryarWasTaken
      @ZaryarWasTaken 4 года назад +4

      For everyone that is still wondering LPCWSTR wt = L" - Google Chrome";

  • @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 года назад +1

      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

    • @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..

  • @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

  • @Xfran1998X
    @Xfran1998X 5 лет назад +1

    error: cannot convert 'LPCWSTR' {aka 'const wchar_t*'} to 'LPCSTR' {aka 'const char*'}
    hmm...

    • @casualgamer1791
      @casualgamer1791  5 лет назад +3

      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 лет назад +1

      @@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 лет назад +2

      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: ruclips.net/video/fWmis4uVCHg/видео.html

  • @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

  • @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?

  • @vadosg1238
    @vadosg1238 4 года назад +1

    Hi, thanks for content, but where do I get the "pch.h" file?

    • @casualgamer1791
      @casualgamer1791  4 года назад +1

      You do not need any such file. Just set precompiled headers to false in your project settings

  • @m4y0r14
    @m4y0r14 3 года назад

    Why not if(GetAsyncKeyState(VK_NUMPAD1) & 1)?

  • @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 лет назад +1

      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

  • @matt-fk7zx
    @matt-fk7zx 5 лет назад +1

    says no such file for pch.h do i have to download that

    • @casualgamer1791
      @casualgamer1791  5 лет назад +1

      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 лет назад +2

      @@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.

  • @fikcjamarzen7495
    @fikcjamarzen7495 5 лет назад

    How to write a bot code that will only do in one window (minimized window) :)?

    • @casualgamer1791
      @casualgamer1791  5 лет назад +1

      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 !

  • @ta3113ta
    @ta3113ta 5 лет назад +3

    Thank you

  • @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 года назад +2

      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 года назад +1

      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 года назад +2

      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

  • @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 года назад +1

      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

  • @Watermelon_cat815
    @Watermelon_cat815 5 месяцев назад

    can you make this for fnf

  • @Saaahmed0
    @Saaahmed0 4 года назад

    How did u learn C++

    • @casualgamer1791
      @casualgamer1791  4 года назад +3

      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.

  • @Shemetaka
    @Shemetaka 4 года назад

    Great!

  • @mithicash1444
    @mithicash1444 3 года назад +1

    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 года назад +2

      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