Valhalla Legends Forums Archive | Battle.net Bot Development | Makeservers

AuthorMessageTime
WTFMATE
Hi, i'm adding Realm to my bot (torn`bot) and I need the makeserver function for it... does anyone have this?
CLaN vA
April 25, 2004, 4:25 AM
PaiD
What would this function do?
April 25, 2004, 4:27 AM
BinaryzL
Converts the raw data from battle.net to the Realm server IP address.
April 25, 2004, 4:29 AM
BaDDBLooD
You conver it to Long

than you turn it into hex

that's basically the function ;O
April 25, 2004, 4:30 AM
PaiD
I wanted him to answer that 1 b/c he comes here and asking us for the "makeserver" function. I know what it does BinaryzL but thx.
April 25, 2004, 4:30 AM
BaDDBLooD
yeah..

i have only seen the "makeserver" function in one bot... ::) ... SOUP BOT!!!!!!!
April 25, 2004, 4:32 AM
BinaryzL
I believe you convert the string to hex values first then convert it to a long in the "makeserver" function.
April 25, 2004, 4:33 AM
Networks
[code]
Public Function MakeServer(data As String) As String
MakeServer = CLng("&H" & ToHex(Mid(data, 1, 1))) & "." & CLng("&H" & ToHex(Mid(data, 2, 1))) & "." & CLng("&H" & ToHex(Mid(data, 3, 1))) & "." & CLng("&H" & ToHex(Mid(data, 4, 1)))
End Function
[/code]
April 25, 2004, 4:36 AM
WTFMATE
I would also need...

[code]
Public Function ToHex(Data As String) As String
Dim i As Integer
For i = 1 To Len(Data)
ToHex = ToHex & Right("00" & Hex(Asc(Mid(Data, i, 1))), 2)
Next i
End Function
[/code]

I was looking at soup bot LOD and i put it all in and it says argument type mismatch for
[code]
.InsertNTString BNCSName
[/code]

Would'nt I?
April 25, 2004, 4:43 AM
PaiD
WTFMATE: You tell us. Does the "Makeservers" function call for the "ToHex" function or not?

Edit: Spelling
April 25, 2004, 4:44 AM
BaDDBLooD
networks.. why did you give him that >_<
April 25, 2004, 4:45 AM
WTFMATE
Yes, It would.... Read my edit! :o

all that is.. is ur username correct?
April 25, 2004, 4:45 AM
BinaryzL
Longer version of the original "makeserver" that I just made for fun ;p

[code]Public Function MakeServer2(strData As String) As String
Dim i As Integer, strBuffer As String

If strData = vbNullString Then Exit Function

For i = 1 To Len(strData) ' Should always be four but what the heck '
strBuffer = strBuffer & CLng("&H" & ToHex(Mid$(strData, i, 1)))
If i <> Len(strData) Then strBuffer = strBuffer & "."
Next i

MakeServer2 = strBuffer
End Function[/code]
April 25, 2004, 4:47 AM
WTFMATE
that is what the string is sending... is the username or vuser if you will... (the name used to connect to battle.net)

[code]

.InsertNonNTString p1 & p2
.InsertNTString vUser
.SendMCPPacket &H1

[/code]
April 25, 2004, 4:49 AM
BinaryzL
[quote author=WTFMATE link=board=17;threadid=6461;start=0#msg56731 date=1082868191]
I would also need...

[code]
Public Function ToHex(Data As String) As String
Dim i As Integer
For i = 1 To Len(Data)
ToHex = ToHex & Right("00" & Hex(Asc(Mid(Data, i, 1))), 2)
Next i
End Function
[/code]

I was looking at soup bot LOD and i put it all in and it says argument type mismatch for
[code]
.InsertNTString BNCSName
[/code]

Would'nt I?
[/quote]

BNCSName has nothing to do with the makeserver function; your probably getting a type mismatch because BNCSName isn't a string?
April 25, 2004, 4:51 AM
WTFMATE
then what is that string?
April 25, 2004, 4:52 AM
WTFMATE
the

[code]
Private Sub sckMCP_Connect()
AddC AtomicGreen, "(MCP) ", AtomicYellow, "Connected."
sckMCP.SendData Chr(1)
With PBuffer
.InsertNonNTString p1 & p2
.InsertNTString vUser
.SendMCPPacket &H1
End With

End Sub
[/code]

what is the .insertNTString vuser thing? what is supposed to go there
April 25, 2004, 4:52 AM
BinaryzL
Your battle.net username I believe, you also recieve that from battle.net on packet 0x3e.
[code]
(DWORD)       Cookie
(DWORD)       Status
(DWORD[2])    MCP Chunk 1
(DWORD)       IP
(DWORD)       Port
(DWORD[12])    MCP Chunk 2
(STRING)       BNCS unique name
(WORD)       Unknown
[/code]
April 25, 2004, 4:54 AM
WTFMATE
well in soup bot it says
urname = Mid(Data, 77, Len(Data) - 79)
April 25, 2004, 4:55 AM
Fr0z3N
[me=Fr0z3N]notes that WTFMATE is GoSuGaMiNg[/me]
April 25, 2004, 4:56 AM
WTFMATE
uh...

*notes* im not?
April 25, 2004, 4:57 AM
BinaryzL
I think what everyone posted should of helped you lol....
April 25, 2004, 5:02 AM
PaiD
[color=red] * MoNeY notes that also * [/color]
April 25, 2004, 5:02 AM
BaDDBLooD
As does baddblood

Bye Mike :)
April 25, 2004, 5:05 AM
Trickle
As do I (Money Told me)
April 25, 2004, 5:06 AM
GoSuGaMING
lo3? if i was WTFMATE then why wouldnt i use this name? GG? get posts on this? Makes sense eh?

wtfmate = eg_g which = friend that was trying to help me
April 25, 2004, 5:06 AM
BinaryzL
[quote author=Fr0z3N link=board=17;threadid=6461;start=15#msg56746 date=1082869002]
[me=Fr0z3N]notes that WTFMATE is GoSuGaMiNg[/me]
[/quote]

Ditto, we also need an admin in here to compare the IP addresses unless he used a proxy.
April 25, 2004, 5:07 AM
BaDDBLooD
you lost mike..

now you have a nice little dillemma here

you can either ask for help on GoSuGaMiNg and we MAY or MAY NOT help you

or you can continue to make yourself look stupid
April 25, 2004, 5:08 AM
PaiD
Yea if you start to use GoSuGaMiNg and ask for help I would help.
April 25, 2004, 5:09 AM
GoSuGaMING
now that im all caught up... is the name thing just the username?
April 25, 2004, 5:12 AM
BaDDBLooD
Mike.. i'll help you

if you take back what you said on aim about me!
April 25, 2004, 5:13 AM
GoSuGaMING
*notes wtfmate was me*
April 25, 2004, 5:17 AM
BinaryzL
GoSuGaMING, take a look at my 3rd to last post excluding this one 11:54:23pm EST.
April 25, 2004, 5:17 AM
BaDDBLooD
quote from aim:

[quote]

gosugaming: watch this ims ick of this dispute ima say wtfmate was me so i can get some help lol

[/quote]

Down with gosugaming!
April 25, 2004, 5:18 AM
GoSuGaMING
where did u get that quote from? putting words in my mouth? not cool ;/

down with badd!
April 25, 2004, 5:18 AM
BinaryzL
Yes also GoSuGaMING has his AIM screen name formatted like "GoSuGaMING".
April 25, 2004, 5:20 AM
Trickle
Kinda odd that WTFMATE and GOsuGaming Need the same Help at the same time.... Huremm must be fate
April 25, 2004, 5:21 AM
PaiD
Must be
April 25, 2004, 5:22 AM
GoSuGaMING
so it has to be the username i know it does ^^ but after i get connected it goes straight to sckMCP_error
April 25, 2004, 5:24 AM
BinaryzL
[quote author=Trickle link=board=17;threadid=6461;start=30#msg56769 date=1082870483]
Kinda odd that WTFMATE and GOsuGaming Need the same Help at the same time.... Huremm must be fate
[/quote]

Actually you're incorrect there, GoSuGaMING said his friend was trying to help him by asking us questions.

[quote author=GoSuGaMING link=board=17;threadid=6461;start=15#msg56758 date=1082869570]
lo3? if i was WTFMATE then why wouldnt i use this name? GG? get posts on this? Makes sense eh?

wtfmate = eg_g which = friend that was trying to help me
[/quote]
April 25, 2004, 5:24 AM
BinaryzL
[quote author=GoSuGaMING link=board=17;threadid=6461;start=30#msg56771 date=1082870647]
so it has to be the username i know it does ^^ but after i get connected it goes straight to sckMCP_error
[/quote]

You're probably sending bad "MCP Chunks".
April 25, 2004, 5:26 AM
GoSuGaMING
can we get a little more immature over the matter?

i got a good idea its called lets figure this out together doesnt that game sound like fun?
April 25, 2004, 5:26 AM
Trickle
Heh, must of had the reply box open to long. :-\
April 25, 2004, 5:26 AM
GoSuGaMING
wtf is a bad MCP chunk ;/
April 25, 2004, 5:26 AM
PaiD
ok lets play...... I win b/c I have done these before.....GG?
April 25, 2004, 5:27 AM
GoSuGaMING
do u mean on the data_arrival?
April 25, 2004, 5:29 AM
BinaryzL
Well you're supposed to parse 2 "MCP Chunks" when you recieve packet 0x3e from battle.net.
[code]
(DWORD)       Cookie
(DWORD)       Status
(DWORD[2])    MCP Chunk 1
(DWORD)       IP
(DWORD)       Port
(DWORD[12])    MCP Chunk 2
(STRING)       BNCS unique name
(WORD)       Unknown
[/code]

Then you send those on MCP packet 0x01.
[code]
(STRING)    MCP Startup Data
(STRING)       Battle.net Unique Name
[/code]
April 25, 2004, 5:30 AM
PaiD
you wouldnt get a _error event b/c if the chucks are bad you would get disconnected or be sent 0x01 saying you failed.
April 25, 2004, 5:30 AM
GoSuGaMING
i think it has to be my dataarrival...
April 25, 2004, 5:33 AM
BinaryzL
Well what is the code?
April 25, 2004, 5:34 AM
GoSuGaMING
it isnt much its just

[code]
Dim strTemp As String, strBuffer As String
sckMCP.GetData strTemp, vbString
strBuffer = strBuffer & strTemp
ParseMCP strBuffer
[/code]

friend sent me this... i dont think it is going to work
April 25, 2004, 5:36 AM
Trickle
10 bucks its his packet header for mcp
April 25, 2004, 5:37 AM
BinaryzL
Well that doesn't help what is the beginning of "ParseMCP" look like?
April 25, 2004, 5:38 AM
GoSuGaMING
Public Sub ParseMCP(Data As String)

Dim PacketID As String
PacketID = Asc(Mid(Data, 3, 1))

Select Case PacketID

Case &H1 'MCP_STARTUP

Select Case (GetDWORD(Mid(Data, 4, 4)))

Case &H0 '0x00 SUCCESS
April 25, 2004, 5:38 AM
BinaryzL
Yeah that looks good.
April 25, 2004, 5:39 AM
GoSuGaMING
thats all i have on it so far ^^

lets help meh write the rest? <3
April 25, 2004, 5:40 AM
BaDDBLooD
[quote author=GoSuGaMING link=board=17;threadid=6461;start=45#msg56788 date=1082871539]
Public Sub ParseMCP(Data As String)

Dim PacketID As String
PacketID = Asc(Mid(Data, 3, 1))

Select Case PacketID

Case &H1 'MCP_STARTUP

Select Case (GetDWORD(Mid(Data, 4, 4)))

Case &H0 '0x00 SUCCESS
[/quote]

code supplied by me
April 25, 2004, 5:41 AM
GoSuGaMING
indeed ^^

now send me the rest of it

*bows down*
April 25, 2004, 5:41 AM
LoRd
[quote author=BaDDBLooD link=board=17;threadid=6461;start=45#msg56792 date=1082871681]
[quote author=GoSuGaMING link=board=17;threadid=6461;start=45#msg56788 date=1082871539]
Public Sub ParseMCP(Data As String)

Dim PacketID As String
PacketID = Asc(Mid(Data, 3, 1))

Select Case PacketID

Case &H1 'MCP_STARTUP

Select Case (GetDWORD(Mid(Data, 4, 4)))

Case &H0 '0x00 SUCCESS
[/quote]

code supplied by me
[/quote]

Ew. Why is your PacketID a string?
April 25, 2004, 5:44 AM
BaDDBLooD
cause i felt like it?
April 25, 2004, 5:46 AM
LoRd
[quote author=BaDDBLooD link=board=17;threadid=6461;start=45#msg56795 date=1082871984]
cause i felt like it?
[/quote]
Inaccurate, but what ever floats your boat.
April 25, 2004, 5:48 AM
BinaryzL
Ahh yes I over looked that when looking at it I guess, but I just do this which isn't that great either.
[code]
Select Case Asc(Mid$(strTemp, 3, 1))

Case &H1 ' Start Packet '

Select Case PBuffer.GetDWORD(Mid$(strTemp, 4, 4))
[/code]
April 25, 2004, 5:49 AM
GoSuGaMING
damn lord u just got hoed?
April 25, 2004, 5:54 AM
Fr0z3N
[quote author=GoSuGaMING link=board=17;threadid=6461;start=60#msg56798 date=1082872457]
damn lord u just got hoed?
[/quote]

Acually, you got 'hoed' by using inefficient coding giving to you by someone.
April 25, 2004, 5:56 AM
LoRd
You might also want to use Ws2_32.dll's inet_ntoa() function which would get rid of that large and sloppy MakeServer() function that Networks mentioned.

[quote author=GoSuGaMING link=board=17;threadid=6461;start=60#msg56798 date=1082872457]
damn lord u just got hoed?
[/quote]
I was correcting an error in your code, and if you were referring to Binary's post, he merely changed it so that the Asc() would convert the data to an interger which works but isn't that great of an idea if you wish to have easy reference to it later on.
April 25, 2004, 5:57 AM
GoSuGaMING
hmm... i see
April 25, 2004, 6:01 AM
BinaryzL
[quote author=LoRd[nK] link=board=17;threadid=6461;start=60#msg56801 date=1082872654]
You might also want to use Ws2_32.dll's inet_ntoa() function which would get rid of that large and sloppy MakeServer() function that Networks mentioned.

[quote author=GoSuGaMING link=board=17;threadid=6461;start=60#msg56798 date=1082872457]
damn lord u just got hoed?
[/quote]
I was correcting an error in your code, and if you were referring to Binary's post, he merely changed it so that the Asc() would convert the data to an interger which works but isn't that great of an idea if you wish to have easy reference to it later on.
[/quote]

Uhh yes you're right, but in my case I only need it once.
April 25, 2004, 6:15 AM
GoSuGaMING
lord why do u seem to piss everyone off on these fourms? ;/
April 25, 2004, 2:12 PM
BaDDBLooD
[quote author=GoSuGaMING link=board=17;threadid=6461;start=60#msg56819 date=1082902364]
lord why do u seem to piss everyone off on these fourms? ;/
[/quote]

he's not purposely tying to piss everyone off

he just flames everyone who doesn't live up to his expectations
April 25, 2004, 2:15 PM
Dyndrilliac
[quote author=BaDDBLooD link=board=17;threadid=6461;start=60#msg56820 date=1082902543]
[quote author=GoSuGaMING link=board=17;threadid=6461;start=60#msg56819 date=1082902364]
lord why do u seem to piss everyone off on these fourms? ;/
[/quote]

he's not purposely tying to piss everyone off

he just flames everyone who doesn't live up to his expectations
[/quote]

You people are inconsiderate. He just took time out of his life to help you with your work, and in essence, it really isn't even yours - from what I've seen throughout this entire thread you got everything from someone else.

He isn't flaming anyone, hes supplying your worthless selves with accurate information...
April 25, 2004, 2:59 PM
Skywing
This is not an instant messaging environment.
April 25, 2004, 5:42 PM

Search