Valhalla Legends Forums Archive | Battle.net Bot Development | Newb Question

AuthorMessageTime
dodge
I'm reading all of this information about packets, I was wondeirng if anyone knew of a good site that was like a tutorial for packets... as you can tell I'm new to this, but I would like to learn.
April 19, 2004, 7:28 PM
Tuberload
[quote author=dodge link=board=17;threadid=6378;start=0#msg55836 date=1082402907]
I'm reading all of this information about packets, I was wondeirng if anyone knew of a good site that was like a tutorial for packets... as you can tell I'm new to this, but I would like to learn.
[/quote]

All it is binary data. Bytes, Words, Dwords, Strings, etc... Words and Dwords are stored in little-endian format. Bytes are 8-bit integers, Words are 16-bit integers, Dwords are 32 bit-integers. Be careful when using languages that use signed integers, i.e. Java. Lookup that information and you should have what you need.
April 19, 2004, 7:31 PM
dodge
Thanks for the help :P if anyone can give me a site, I'd still appreicate that heh I'll start looking up information, and I'm programming in VB just fyi.
April 19, 2004, 7:32 PM
FuzZ
http://www.google.com < best site on the net for everything you can think of :P
April 19, 2004, 7:47 PM
RedPhoenix

Here ---> http://grc.com/oo/packetsniff.htm

;D ;D ;D
April 19, 2004, 8:13 PM
dodge
LOL! Google is awesome, and I found a site, but I'm also looking at RedPhoenix's site he gave me. Looks fun lol. I think once I get money I'm going to buy a book. I was working on this fun program.. but I need to find out how to enter a line in a Rich Text Box... I'm writng somethign to the screen and I need like a return or something... Currently searching google :P ;D ;)

EDIT:

I have this thing where you have a textbox, and you press send and you add text to the RTB, I have it so you can continuiously add text to it but its on the same line... this is my code

[code]
rtbChat.Text = rtbChat.Text + "Client: " & txtSend.Text
[/code]

No, it's not for my bot but hey maybe someones like "hey this is easy!" when reading my bot problem lol
April 19, 2004, 8:43 PM
Dyndrilliac
To add text to an RTB without a fancy addchat function, do:

[code]rtbName.Text = rtbName.Text & "Text Here!" & vbCrLf & "You're on a new line!" & vbCrLf[/code]

This will add "Text Here!", then on a seperate line, add "You're on a new line!", then create a new blank line for more additions.

Most of us here use an addchat function written br Grok. Here is the variation I use:

[code]Public Sub AddC(RTB As RichTextBox, ParamArray saElements() As Variant)
On Error Resume Next
Dim RTBName As String
With RTB
RTBName = .Name
End With
Dim i As Integer
With RTB
.SelStart = 99999999
.SelLength = 0
.SelColor = vbWhite
.SelText = "[" & Format(Now, "HH:MM:SS AMPM") & "] "
.SelStart = 99999999
End With
For i = LBound(saElements) To UBound(saElements) Step 2
With RTB
.SelStart = 99999999
.SelLength = 0
.SelColor = saElements(i)
.SelText = saElements(i + 1) & Left$(vbCrLf, -2 * CLng((i + 1) = UBound(saElements)))
.SelStart = 99999999
End With
Next i
With RTB
If Len(.Text) >= 10000 Then
.SelStart = 0
.SelLength = 10000
.SelText = ""
.SelLength = 10000
.SelStart = Len(.Text)
End If
If Len(.Text) >= 5000 Then
.SelStart = 0
.SelLength = 2500
.SelText = ""
.SelLength = 5000
.SelStart = Len(.Text)
End If
.Refresh
End With
End Sub
[/code]

And you use it by doing:

[code]AddC FormName.rtbName, Color, Text[/code]
or
[code]AddC Me.Chat, vbGreen, "Text! Wheeee!"[/code]

Edit: Hah! Beat you to it FuzZ :)
April 19, 2004, 9:04 PM
FuzZ
There's a couple public functions for RTB's

AddChat being the most popular
http://botdev.valhallalegends.com/documents/vbrtbpro.html

I use a modified version of that
[code]
Public Sub AddChat(rtb As RichTextBox, ParamArray saElements() As Variant)
Dim I As Integer
With rtb
If Len(.text) >= 10000 And AppData.AutoClear = True Then
.text = ""
.SelStart = 0
.SelLength = 0
.SelColor = vbGreen
.SelText = "Auto cleared window." & vbCrLf
.SelStart = Len(.text)
ElseIf Len(.text) >= 10000 Then
.SelStart = 0
.SelLength = InStr(1, .text, vbCrLf) + 1
.SelText = ""
.SelStart = Len(.text)
End If
If BNet.TimeStamp = True Then
.SelStart = Len(.text)
.SelLength = 0
.SelColor = vbWhite
.SelText = TimeStamp & " "
.SelStart = Len(.text)
End If
For I = LBound(saElements) To UBound(saElements) Step 2
.SelStart = Len(.text)
.SelLength = 0
.SelColor = saElements(I)
.SelText = saElements(I + 1) & Left$(vbCrLf, -2 * CLng((I + 1) = UBound(saElements)))
.SelStart = Len(.text)
Next I
.SelStart = Len(.text)
End With
End Sub
[/code]
April 19, 2004, 9:05 PM
Fire
Using a statement that ignores errors is a novice approach to programming. I recommend handling the error, if it ever manifests. Run-time errors could, and usually do lead to malformed data and/or execution. I reliase that this method simply adds formatted text to visual basic components, nevertheless handling errors is the best approach to good programming practices.
April 24, 2004, 8:45 PM
iago
[quote author=Fire link=board=17;threadid=6378;start=0#msg56651 date=1082839557]
Using a statement that ignores errors is a novice approach to programming. I recommend handling the error, if it ever manifests. Run-time errors could, and usually do lead to malformed data and/or execution. I reliase that this method simply adds formatted text to visual basic components, nevertheless handling errors is the best approach to good programming practices.
[/quote]

Hmm, post #1 for this guy and it's something sensible. Does he get a prize?

<edit> no, that wasn't sarcasm, but I also couldn't afford the prize.
April 24, 2004, 8:50 PM
Dyndrilliac
The on error resume next in mine is a left over statement i was using to isolate and fix an error, you can handle the error if you like but i already fixed the one that caused that statement to be put into that procedure to begin with(in my bot anyway).
April 24, 2004, 9:09 PM
Stealth
[quote author=dodge link=board=17;threadid=6378;start=0#msg55855 date=1082407387]
[code]
rtbChat.Text = rtbChat.Text + "Client: " & txtSend.Text
[/code]
[/quote]

Also, you might want to note that + is a numeric operator. While it works in VB with strings (I think this is a throwback to older versions of VB, or a helper for programmers in other languages) it's better form to use the & string concatenation operator.
April 25, 2004, 1:39 AM
BinaryzL
[quote author=Stealth link=board=17;threadid=6378;start=0#msg56708 date=1082857166]
[quote author=dodge link=board=17;threadid=6378;start=0#msg55855 date=1082407387]
[code]
rtbChat.Text = rtbChat.Text + "Client: " & txtSend.Text
[/code]
[/quote]

Also, you might want to note that + is a numeric operator. While it works in VB with strings (I think this is a throwback to older versions of VB, or a helper for programmers in other languages) it's better form to use the & string concatenation operator.
[/quote]

Yes, Stealth I think is correct and plus why are you using both + and & like right after one another lol.
April 25, 2004, 4:28 AM
dodge
Ehh good question, not sure. But this wasnt for my bot although i appreicate the addc code when i get back to my bot. I was making a IP chat thing.. not sure why i used a "+" then "&" but hey... not sure I think I might go back to the bot it was mroe fun.
April 28, 2004, 4:48 PM
Myndfyr
[quote author=iago link=board=17;threadid=6378;start=0#msg56653 date=1082839812]
[quote author=Fire link=board=17;threadid=6378;start=0#msg56651 date=1082839557]
Using a statement that ignores errors is a novice approach to programming. I recommend handling the error, if it ever manifests. Run-time errors could, and usually do lead to malformed data and/or execution. I reliase that this method simply adds formatted text to visual basic components, nevertheless handling errors is the best approach to good programming practices.
[/quote]

Hmm, post #1 for this guy and it's something sensible. Does he get a prize?

<edit> no, that wasn't sarcasm, but I also couldn't afford the prize.
[/quote]

Seriously! I about urinated my shorts when I saw that.

+1 to karma -- oh yeah, it's gone. :(
April 28, 2004, 4:53 PM
iago
[quote author=Myndfyre link=board=17;threadid=6378;start=0#msg57266 date=1083171229]
[quote author=iago link=board=17;threadid=6378;start=0#msg56653 date=1082839812]
[quote author=Fire link=board=17;threadid=6378;start=0#msg56651 date=1082839557]
Using a statement that ignores errors is a novice approach to programming. I recommend handling the error, if it ever manifests. Run-time errors could, and usually do lead to malformed data and/or execution. I reliase that this method simply adds formatted text to visual basic components, nevertheless handling errors is the best approach to good programming practices.
[/quote]

Hmm, post #1 for this guy and it's something sensible. Does he get a prize?

<edit> no, that wasn't sarcasm, but I also couldn't afford the prize.
[/quote]

Seriously! I about urinated
my shorts when I saw that.

+1 to karma -- oh yeah, it's gone. :(
[/quote]

Damnit, I was going for complete soakage. ohwell :/
April 28, 2004, 5:42 PM

Search