Yo can anyone here help me with the script for connecting a bot on C ?
(plz no flaming)
rr... i meant
the script in C language
for connecting a bot :D
greetbot
Side note: The proper term in C is source code, not scripts.
okay so im a total newbie...
can anyone help me ?
int BnBot::Connect() {
struct sockaddr_in name;
struct hostent *hp;
memset(&name, '\0', sizeof(name));
name.sin_family = AF_INET;
name.sin_port = htons(nServerPort);
// if this is a hostname and not an IP address, resolve it
char *p = szServerAddr;
while (*p && (isdigit(*p) || (*p == '.'))) {
p++;
}
// non-digit found - assume hostname
if (*p) {
hp = gethostbyname(szServerAddr);
if (hp == 0)
return 0; // can't resolve hostname
memcpy(&name.sin_addr, hp->h_addr, hp->h_length);
}
else {
name.sin_addr.s_addr = inet_addr(szServerAddr);
}
s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s == INVALID_SOCKET) {
return 0;
}
if (connect(s, (struct sockaddr *)&name, sizeof(name))) {
return 0;
}
return 1;
}
ILurker: I must point out that he asked for C code. Your function is a class member, which only works in C++. *g*
gogogo C! ;D
QuoteILurker: I must point out that he asked for C code. Your function is a class member, which only works in C++. *g*
It's not even his function... that's straight out of DMBot
Silly noodlez, you are wrong. That is from greetbot/bnx!
NOODLEZ GOT OWNED.
Zorm is right, and +, i was bored so i just threw a c++ code at him, that i had in my folder that i was going to delete
i bairly know c++, so i couldnt well explain the source to him
/me cries
then dmbot stole it!
Wonder when the stars will be fixed :-/ ( the forum member rank thingy's )
QuoteWonder when the stars will be fixed
They're broken?
QuoteWonder when the stars will be fixed :-/ ( the forum member rank thingy's )
They work exactly the way they're meant to.