hi all,
im kinda new to c++ im only really good in vb. but i was looking at some source codes of bots (c++) and i did find some errors so i fixed them up but 1 i just cant get it to work here it is: at the top of wild.cpp i have #include <Connection.h> it was "Connection.h" but that caused errors so i just changed it to <Connection.h>. But when i click compile it says Connection.h cant be found. I no its a existing file because its in the same folder so what should i do?
and remember im new 2 c++ so kinda make it simple 2 read ;)
I justed edited this to show u wats in wild.cpp
#include <Connection.h>
#include <conio.h>
void main()
{
BinaryBot *Bot = new WiLD BinaryBot;
strcpy(Bot->username, "Usernmae");
strcpy(Bot->password, "Pssword");
strcpy(Bot->cdkey, "CD-key");
strcpy(Bot->statstring, "WiLD ChaT");
strcpy(Bot->homechannel, "Clan VioLaToRz");
if(Bot->Connect("211.233.0.73"))
{
Bot->Output->WriteEx(ConsoleOutput::YELLOW, "Connected To B.net!\n");
Bot->Startup();
}
else
Bot->Output->WriteEx(ConsoleOutput::RED, "Connection Failed!");
delete Bot;
getch();
}
Quote from: WiLD on March 30, 2003, 09:27 PM
hi all,
im kinda new to c++ im only really good in vb. but i was looking at some source codes of bots (c++) and i did find some errors so i fixed them up but 1 i just cant get it to work here it is: at the top of wild.cpp i have #include <Connection.h> it was "Connection.h" but that caused errors so i just changed it to <Connection.h>. But when i click compile it says Connection.h cant be found. I no its a existing file because its in the same folder so what should i do?
and remember im new 2 c++ so kinda make it simple 2 read ;)
I justed edited this to show u wats in wild.cpp
#include <Connection.h>
#include <conio.h>
void main()
{
BinaryBot *Bot = new WiLD BinaryBot;
strcpy(Bot->username, "Usernmae");
strcpy(Bot->password, "Pssword");
strcpy(Bot->cdkey, "CD-key");
strcpy(Bot->statstring, "WiLD ChaT");
strcpy(Bot->homechannel, "Clan VioLaToRz");
if(Bot->Connect("211.233.0.73"))
{
Bot->Output->WriteEx(ConsoleOutput::YELLOW, "Connected To B.net!\n");
Bot->Startup();
}
else
Bot->Output->WriteEx(ConsoleOutput::RED, "Connection Failed!");
delete Bot;
getch();
}
First off, it's int main() not void main(). Second, You need to #include "Connection.h" not <Connection.h> Third you need to lose "WiLD" in BinaryBot *Bot = new WiLD BinaryBot;
ok thank you, but now im getting a extra error.
i still got the same error as before but i also have this one on line 4.
Line | Unit
4 c:\wildbot\packetbuffer.h
| Message
from c:\wildbot\Connection.h:4,
so wats wrong now......
hm maybe i should learn C++
Perhaps you shouldn't rip off DarkMinion's work, also.
The source you're copying from isn't functional...and hasn't been for a long time. Moreover, it's very bad form to just insert your name in places like that.
if u had havd read my first post i said it wasnt my source im learning. i wasnt going to relese it. i just want to learn c++. and i cant find ne GOOF decent tutorials on the net
I'm afraid that looking at DM's source isn't gonna be very helpful for just starting out. He used a number of fairly advanced concepts in creating even that rather primitive vLBBot - classes, dynamic memory allocation, a custom string library...try to find a more conventional source of inspiration if you can - it'll be much easier to understand.
I recommend this to you... and if you say its lame I will strangle you and cut off your nads and feed them raw to the dogs.. kthx
www.google.com -> search query = "Teach Yourself C++ in 21 Days"
Quote from: Eibro on March 30, 2003, 10:25 PMFirst off, it's int main() not void main().
what's wrong with void main() ?
Quote from: Camel on March 31, 2003, 09:22 PM
Quote from: Eibro on March 30, 2003, 10:25 PMFirst off, it's int main() not void main().
what's wrong with void main() ?
void main() doesn't exist in C or C++. It's a nonstandard compiler extension.
well thx about all, and i will have a look at that c++ in 21 days. i also learnt several new things today =)
just 1 quick quetion that no 1 in me chanel would help me with is:
szName = the %s before hand right....
and wat does \n\r mean i no its a varible but of like wat does it do..
Thx alot.
you really need to buy a book and read it.
\n == New Line
\r == Return
there's alot mmore.
This is why people shouldn't start with VB.
dont you mean SHOULD start with vb storm?
well thx raza.
because all the sources iv looked at i always see \n\r so that helps me alot. mmm FINAL LAST THING: do you have to put \n on every line? and \r means return but return to wat is it like return aka enter?
\n = new line
\r = carriage return
\n puts the cursor on the next line
\r returns the cursor to the leftmost position
wow thank you again. every1 here is so helpful thank you all. now that i understand those 2 varibles clearly i will understand most bot sources abit more.
Thank you
WiLD
No typo in my post. VB lets you assume a lot of stuff you can't assume in other languages.
Quote from: St0rm.iD on April 02, 2003, 08:18 PM
No typo in my post. VB lets you assume a lot of stuff you can't assume in other languages.
I don't want to start a language war, but I'm wondering what that "stuff" is. Care to elaborate?
That memory is magically handled for you.
Also that it's ok to, say, assign a string to an int.
It's not OK to assign a string to an int in VB, but the conversion is indeed much simpler than in, say, C.
Converting from VB to C = "wtf? You have to use a function to copy strings?"
"what's a function?"
Naa, VB at least uses the keyword "Function". Maybe "what's a pointer"
I mean, it's not like VB programmers actually make their own functions anyway.
If they didn't write their own functions, they wouldn't get very far (not much farther from Label1.Caption="l33tb4wt")
hey, it's entirely possible to use pointers in vb!
1) manipulating copymemory (not really manipulating -- that is actually the intended use for copymemory, but to a vb programmer it's manipulation ::))
2) VarPtr(), StrPtr(), and ObjPtr()
i mean, why bother doing "str1 = mid(str2, 2)" when you could do "str1 = space(len(str2) - 1) : copymemory str1, strptr(str2) + 1, len(str2) - 1" ?
That won't work.
Strings in VB are ... well I'll let you try it.
Unicode.
of course it would work
it wouldnt *accomplish* anything, but it would work
NO, again im with storm, VB is horrible for you. VB will get u thinking like a retarted monkey, then when u actaully try to code in a real language you will have no idea whats going on.
well of course you wouldn't want to learn about pointers in vb. that would just be recockulous. it can be confusing enough just learning it in a real language, so it would be 50million times harder in vb. my point was that it is _possible_ to manipulate data with pointers in vb. example:
VerQueryValue lpbBuffer(0), "\", ffip, dwSize
CopyMemory ffi, ffip, Len(ffi)
version = 0
CopyMemory x, ByVal ffip + 16, 4: version = version Or ((x And &HFF) * (256 ^ 2)) 'LShift(x And &HFF, 8 * 2)
CopyMemory x, ByVal ffip + 18, 4: version = version Or ((x And &HFF) * (256 ^ 3)) 'LShift(x And &HFF, 8 * 3)
CopyMemory x, ByVal ffip + 20, 4: version = version Or (x And &HFF)
CopyMemory x, ByVal ffip + 22, 4: version = version Or ((x And &HFF) * (256 ^ 1)) 'LShift(x And &HFF, 8)
this doesn't write data to an address, it only reads data..but i think you'll get the point
Pointers are syntax though...