Valhalla Legends Forums Archive | Battle.net Bot Development | What does this mean?

AuthorMessageTime
ColT
What does Chr(3), Chr(4), and vbCrLf mean

It was posted somewhere by Grok[vL], and I don't know what it means, the full code is:

Private Sub ws_Connect ()
AddChat vbYellow, "Connected."
SendData Chr(3) & Chr(4) & vbCrLf
End Sub
July 20, 2004, 7:00 PM
Myndfyr
[quote author=ColT link=board=17;threadid=7782;start=0#msg71527 date=1090350012]
What does Chr(3), Chr(4), and vbCrLf mean

It was posted somewhere by Grok[vL], and I don't know what it means, the full code is:

[code]
Private Sub ws_Connect ()
AddChat vbYellow, "Connected."
SendData Chr(3) & Chr(4) & vbCrLf
End Sub
[/code]
[/quote]

It means that upon the Connect event of a WinSock control named ws, you want to add the text "Connected" in yellow to the rich text box, then send a byte value of 3, a byte value of 4, and the constant carraige-return-line-feed value over the WinSock control.

Well, that's what the code means. Chr(3), Chr(4), and vbCrLf mean a byte value of 3, a byte value of 4, and the constant carraige-return-line-feed.

If you don't know what Chr() and vbCrLf are, I suggest you learn Visual Basic. This isn't the place.
July 20, 2004, 7:40 PM
ColT
Well thanks I understand it a bit more, and yes I am reading a 1031 page VB book I am on page 700 somthing...
July 20, 2004, 7:53 PM
Myndfyr
[quote author=ColT link=board=17;threadid=7782;start=0#msg71536 date=1090353180]
Well thanks I understand it a bit more, and yes I am reading a 1031 page VB book I am on page 700 somthing...
[/quote]

By page 700, if you don't know what Chr() or vbCrLf do, I'd go back to the beginning.
July 20, 2004, 8:00 PM
Zakath
Even I know what they mean, and I've never read such a book nor coded even "Hello World" in VB.
July 21, 2004, 3:56 AM
OnlyMeat
[quote author=Zakath link=board=17;threadid=7782;start=0#msg71618 date=1090382203]
Even I know what they mean, and I've never read such a book nor coded even "Hello World" in VB.
[/quote]

Ye but i bet you do c++ or alike which uses similar terms when formating strings i.e
printf(szBuf,"Hello world from %s\r\n",szSomeone);

where the \r\n are equivilent to control line feed.

There are alot of consts etc in vb and c++ for that matter that people who are new to programming would not automatically know so give the guy a break.
July 22, 2004, 1:38 AM
shadypalm88
[quote author=OnlyMeat link=board=17;threadid=7782;start=0#msg71763 date=1090460330]There are alot of consts etc in vb and c++ for that matter that people who are new to programming would not automatically know so give the guy a break.[/quote]I think the point is he should have a handle on the basics of VB before attempting to write a bot using it, or he should've at least known where to find the answer on his own, like in his 1031-page VB book, or even VB's object browser or VB/MSDN docs.
July 22, 2004, 3:41 AM
OnlyMeat
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)
July 22, 2004, 7:48 AM
Tuberload
[quote author=OnlyMeat link=board=17;threadid=7782;start=0#msg71829 date=1090482499]
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)
[/quote]

I personally prefer textbooks to ebooks. Easier on my eyes, I get fewer headaches, plus I can wonder around, and sit in any position I want while reading it. It is also easier to flip through pages. :)
July 22, 2004, 7:51 AM
hismajesty
[quote author=Tuberload link=board=17;threadid=7782;start=0#msg71830 date=1090482718]
[quote author=OnlyMeat link=board=17;threadid=7782;start=0#msg71829 date=1090482499]
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)
[/quote]

I personally prefer textbooks to ebooks. Easier on my eyes, I get fewer headaches, plus I can wonder around, and sit in any position I want while reading it. It is also easier to flip through pages. :)
[/quote]

I agree, I have a lot of ebooks on programming but I've only used them for quick reference. They hurt my eyes to read and are harder to follow imo. I'd rather spend the money to get a real book.
July 22, 2004, 3:17 PM
tA-Kane
The best thing with ebooks is the find feature. If you try it on the right book, it's just like google.
July 22, 2004, 5:46 PM

Search