Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: MoNksBaNe_Agahnim on October 10, 2003, 08:13 PM

Title: C++ bot requirments
Post by: MoNksBaNe_Agahnim on October 10, 2003, 08:13 PM
I know some C++, can do some stuff lol, what are some C++ knowledge requirements to make the simplest of the simple bot, like a public chatroom, chat only bot? lol...such as you need to know apstrings, arrays, pointers, ect... ect...
Title: Re:C++ bot requirments
Post by: Grok on October 10, 2003, 08:58 PM
The simplest of simple bots would be notepad or some other text editor.  It wouldn't be required to connect to anything, or even have multiple windows.  You could just talk to yourself.
Title: Re:C++ bot requirments
Post by: Adron on October 10, 2003, 09:07 PM
Quote from: MoNksBaNe_Agahnim on October 10, 2003, 08:13 PM
I know some C++, can do some stuff lol, what are some C++ knowledge requirements to make the simplest of the simple bot, like a public chatroom, chat only bot? lol...such as you need to know apstrings, arrays, pointers, ect... ect...

Writing a "main", doing a tcp connection, processing strings (either C-style char arrays or some C++ string class, but something that can be read from/written to a tcp socket).

Not c++, but:

char login[] = "\x3username\npassword\n";

main()
{  int s = socket(AF_INET, SOCK_STREAM, 0);
   struct sockaddr_in sin;
   sin.sin_family = AF_INET;
   sin.sin_port = htons(6112);
   sin.sin_addr.s_addr = inet_addr("some.bnet.ip.address");
   connect(s, &sin, sizeof sin);
   send(s, login, sizeof login - 1, 0);
   while(1) {
       char c;
       recv(s, &c, 1, 0);
       putchar(c);
   }
}
Title: Re:C++ bot requirments
Post by: iago on October 10, 2003, 09:59 PM
I would read Yoni's post about a couple simple programs to write to learn winsock.  If I knew where it was I'd reference it, but it's somewhere on this forum :)