1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C++: Making Bots

Discussion in 'C, C++, C#' started by Sprouts, Jan 25, 2012.

  1. Sprouts

    Sprouts Regular Member

    Joined:
    Mar 20, 2010
    Messages:
    461
    Likes Received:
    324
    Can anyone recommend some books on learning how to make bots with C++. I've looked around and haven't found any good ones. I looked at tutorials on youtube but they mainly focus on console applications as oppose to using Visual Studio to create bots. The Visual Studio tutorials which do exist have very limited information on making bots and how to go about it.

    Also, is C++ a fairly good language for creating bots - I want to automate web processes like making a bot which creates a squidoo lens for example. I'm quite familiar with PHP and someone I know suggested I look at C++ because the syntax is very similar.
     
  2. DutchTrafficService

    DutchTrafficService Regular Member

    Joined:
    Aug 12, 2010
    Messages:
    473
    Likes Received:
    234
    Why on earth is everybody coming up with c++ for web related bots??
    Always someone heared someone say this and that is best.
    C++ is definately the wrong choice for MANY reasons.

    Go for C#, get chilkat for socket based stuff and watin for browser based stuff, easypeasy.
     
    • Thanks Thanks x 9
  3. 0wned

    0wned Newbie

    Joined:
    Jul 14, 2009
    Messages:
    26
    Likes Received:
    21
    Occupation:
    Web Developer
    Location:
    London
    I cant give any input on the first question but for:

    You can create bots in practically any language, from my experience I was able to get up and running small bots pretty fast with both c# and Java (both have a similar syntax to php) so unless there is a particular reason you want to use c++ I would have a look into them.

    For my java bot I was using something called htmlunit which reduced the amount of development work I needed to do to considerably and I managed to get a basic register + post bot in a couple of hours.

    Link for the htmlunit lib:
    Code:
    htmlunit.sourceforge (DOT) net/
     
    • Thanks Thanks x 2
  4. Sprouts

    Sprouts Regular Member

    Joined:
    Mar 20, 2010
    Messages:
    461
    Likes Received:
    324
    How would you recommend starting out, is there a particular book you would recommend?
     
  5. n3xus

    n3xus Junior Member

    Joined:
    Apr 19, 2009
    Messages:
    121
    Likes Received:
    31
    you can learn a programming language without spending money on a book. use google, and don't expect to find all the answers in once source/website. if your gonna spend money on a book, i would suggest a book that focuses more on programming methodologies instead of a specific language, because once you know how to use one language you can basically use them all.

    learn how to program well, and your bots will be marketable and profitable as well as useful
     
    • Thanks Thanks x 1
  6. hiderightnow

    hiderightnow Junior Member

    Joined:
    Jul 19, 2010
    Messages:
    104
    Likes Received:
    22
    I recommend one book that helped me greatly in my quest to learn about HTTP requests and responses from the programmer's point of view:
    HTTP programming recipes for C# (Java) bots. However, it's available only for the C# and Java programming languages, but that's not necesarily a bad thing: C# and Java beat C/C++ any day of the week when it comes to designing web bots. All the examples in the book are clear and easy to understand, and you will find yourself progressing in the art of making web bots in no time.
     
    • Thanks Thanks x 3
  7. soxio123

    soxio123 Newbie

    Joined:
    Mar 14, 2012
    Messages:
    42
    Likes Received:
    0
    Learn C++ from thenewboston
     
  8. cool0403

    cool0403 BANNED BANNED

    Joined:
    Dec 29, 2008
    Messages:
    565
    Likes Received:
    718
    IF you want to use c++ for creating bots, look on how to use winhttp library for the post and get. Trust me all those people that say, why use c++ dont know better. Sure development is faster, but once you can code in c++ you dont have all those annoying fucking dependencies issues. If you dont care about size and you want something that would run on any windows, then use code:blocks they compile everything you need inside and dont need any linked libraries like visual studio.
     
  9. lancis

    lancis Elite Member

    Joined:
    Jul 31, 2010
    Messages:
    1,632
    Likes Received:
    2,384
    Occupation:
    Entrepreneur
    Location:
    Milky Way
    Home Page:
    Do you intend to sell the bots? Or make them for your personal use?

    In the second case PHP/Python are probably the best languages when it comes to learning curve.

    If you want to sell them, however... Then coding in Java/C# will be faster, but reduce the price and the popularity of the software - people are picky when it comes to their CPU time, stability and security issues. Slower (code-wise) but better option is MFC - the learning curve will be slow, as in addition to C++ you'll need to learn the nuances of Microsoft Foundation Classes.
     
  10. SwagBotPlus

    SwagBotPlus Newbie

    Joined:
    Mar 8, 2012
    Messages:
    16
    Likes Received:
    5
    I created my bot using c++, it's not the best starting language but if you do learn it you should be able to understand other languages as well.
     
    • Thanks Thanks x 1
  11. shatcore

    shatcore Registered Member

    Joined:
    Jan 10, 2012
    Messages:
    56
    Likes Received:
    15
    Actually if you intend to sell your bots DO NOT use java, it can easily be decompiled back into almost the original source code rendering any piracy countermeasures useless.
     
  12. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
    same goes for c# bots. if you are afraid of decompiling consider using native compiled language
     
  13. SnowWar

    SnowWar Power Member

    Joined:
    Mar 3, 2012
    Messages:
    595
    Likes Received:
    48
    Occupation:
    Pure student :p
    I think to make a bot you should captalize on c# rather than c++. It's interface will be much more easier and also very user friendly too.
     
  14. Blackberry_11

    Blackberry_11 Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    266
    Likes Received:
    19
    It is really good choice to use c# rather than c++ to do things like this. You will get some good environment and tools to use this.
     
  15. CodingAndStuff

    CodingAndStuff Regular Member

    Joined:
    May 6, 2012
    Messages:
    236
    Likes Received:
    84
    Occupation:
    Swagstronaut
    Location:
    You can't have my bots. Sorry :'(
    Firstly I apologize for bumping this thread, but for the misinformation that is running rampant in this thread I feel it is justified.

    Since it's much easier to get rid of the shortest list first, we will start with why C# is superior to C++ for this particular task: It takes less time to program a functional bot in C# than C++ (debugging in C++ is a pain in the ass). That is the only pro to choosing .NET over actual code.

    Now for the part that will make you all mad:

    C++ is faster (MUCH faster)
    C++ isn't sandboxed
    C++ can be used on any operating system (with different OS-specific API's, of course - and the problem with globalized code can be fixed easily with cross-platform frameworks such as QT by Nokia if you're concerned with a fancy GUI)
    If you're doing any sort of memory reading or writing, C++ is superior since it has these fancy things called pointers. It also has support for inline assembly if you need to do any sort of low level stuff or are reversing a function and want to test pushing params to the stack to debug.
    It is much easier to reverse any compiled application in .NET (C++ included), and C# is nothing BUT .NET. You can literally download a program and decompile someone else's application and view the raw source code.

    The downside to C++ is that it takes a little bit of time to learn and can be exhausting to debug (I've spent HOURS debugging my code when all I was missing was a semi-colon!). However if you're committed to learning how to program in a low-level language, C++ is definitely the way to go. It's powerful, can be used in everything from console apps, server software, video games (and game hacks - which are fun as hell to make, by the way), and even native plugins for browsers (think Unity Player, Flash, DivX, etc).

    I hope I've cleared some things up for you.

    (Note to everyone reading this: If you feel I've provided false information in any way, shape, or form, please let me know. I try to be as unbiased as possible when giving advice to new programmers, however I personally favor C++ over ANYTHING .NET-related for the reasons stated above).
     
    • Thanks Thanks x 1
  16. cgimaster

    cgimaster Power Member

    Joined:
    Jun 30, 2012
    Messages:
    525
    Likes Received:
    311
    Gender:
    Male
    I also agree with you to some extent, c++ is indeed faster but it really depends on what you are doing as well, some things will have same performance, some awesome better performance and some will vary on a really small margin that won't even be a problem in most if not all cases.

    C++ being cross plat ready is a plus but having it running on other plats is not as simple as it sounds either depends on modules youre using and other factors but in general compared to other languages its fairly easier to get a cross plat app done.

    Reversing, I don't think harder or easier to decompile an application from asm to c# or w/e language, they can always be decompiled, read, cracked and what so ever.

    In either cases, xor'ing, obfuscating, and several other ways will help you protect your IP however people with TIME, and I mean it PEOPLE with TIME on their hands can always crack, decompiile and whatever else with your application.

    If your application is a hit, it may become target for the above mentioned and caution is never enough.
     
  17. gokomk

    gokomk Newbie

    Joined:
    Sep 14, 2012
    Messages:
    29
    Likes Received:
    14
    Good programming language for bots is autoit.
     
  18. cgimaster

    cgimaster Power Member

    Joined:
    Jun 30, 2012
    Messages:
    525
    Likes Received:
    311
    Gender:
    Male
    autoit is not a programming language its a scripting language ;)
     
  19. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    It's lot easier in C# /VB.net or in any higher level language than in C++. C++ is used for system side programming because of it's performance and lightning fast code execution. But for bots, all you need is a high level programs like C# because you'll get lot of libraries built-in and comes in handy for bots that works based on http request & response model. Though you can achieve the same using c++, it'll be lot harder to write everything from the scratch.
     
  20. cgimaster

    cgimaster Power Member

    Joined:
    Jun 30, 2012
    Messages:
    525
    Likes Received:
    311
    Gender:
    Male
    I am mainly a C# user however :p, C++ have plenty of libraries too do not underestimate it. For example you have libcURL with a c++ wrapper curlpp, cpp-netlib, you can make your own, POCO and more.