Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: WTFMATE on April 24, 2004, 11:25 PM

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

than you turn it into hex

that's basically the function ;O
Title: Re:Makeservers
Post by: PaiD on April 24, 2004, 11:30 PM
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.
Title: Re:Makeservers
Post by: BaDDBLooD on April 24, 2004, 11:32 PM
yeah..

i have only seen the "makeserver" function in one bot...  ::) ... SOUP BOT!!!!!!!
Title: Re:Makeservers
Post by: BinaryzL on April 24, 2004, 11:33 PM
I believe you convert the string to hex values first then convert it to a long in the "makeserver" function.
Title: Re:Makeservers
Post by: Networks on April 24, 2004, 11:36 PM

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
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:43 PM
I would also need...


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


I was looking at soup bot LOD and i put it all in and it says argument type mismatch for

.InsertNTString BNCSName


Would'nt I?
Title: Re:Makeservers
Post by: PaiD on April 24, 2004, 11:44 PM
WTFMATE: You tell us. Does the "Makeservers" function call for the "ToHex" function or not?

Edit: Spelling
Title: Re:Makeservers
Post by: BaDDBLooD on April 24, 2004, 11:45 PM
networks.. why did you give him that >_<
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:45 PM
Yes, It would.... Read my edit! :o

all that is.. is ur username correct?
Title: Re:Makeservers
Post by: BinaryzL on April 24, 2004, 11:47 PM
Longer version of the original "makeserver" that I just made for fun ;p

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
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:49 PM
that is what the string is sending... is the username or vuser if you will... (the name used to connect to battle.net)



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

Title: Re:Makeservers
Post by: BinaryzL on April 24, 2004, 11:51 PM
Quote from: WTFMATE on April 24, 2004, 11:43 PM
I would also need...


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


I was looking at soup bot LOD and i put it all in and it says argument type mismatch for

.InsertNTString BNCSName


Would'nt I?

BNCSName has nothing to do with the makeserver function; your probably getting a type mismatch because BNCSName isn't a string?
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:52 PM
then what is that string?
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:52 PM
the


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


what is the .insertNTString vuser thing? what is supposed to go there
Title: Re:Makeservers
Post by: BinaryzL on April 24, 2004, 11:54 PM
Your battle.net username I believe, you also recieve that from battle.net on packet 0x3e.

(DWORD)       Cookie
(DWORD)       Status
(DWORD[2])    MCP Chunk 1
(DWORD)       IP
(DWORD)       Port
(DWORD[12])    MCP Chunk 2
(STRING)       BNCS unique name
(WORD)       Unknown
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:55 PM
well in soup bot it says
urname = Mid(Data, 77, Len(Data) - 79)
Title: Re:Makeservers
Post by: Fr0z3N on April 24, 2004, 11:56 PM
/me notes that WTFMATE is GoSuGaMiNg
Title: Re:Makeservers
Post by: WTFMATE on April 24, 2004, 11:57 PM
uh...

*notes* im not?
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:02 AM
I think what everyone posted should of helped you lol....
Title: Re:Makeservers
Post by: PaiD on April 25, 2004, 12:02 AM
 * MoNeY notes that also *
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 12:05 AM
As does baddblood

Bye Mike :)
Title: Re:Makeservers
Post by: Trickle on April 25, 2004, 12:06 AM
As do I (Money Told me)
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:06 AM
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
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:07 AM
Quote from: Fr0z3N on April 24, 2004, 11:56 PM
/me notes that WTFMATE is GoSuGaMiNg

Ditto, we also need an admin in here to compare the IP addresses unless he used a proxy.
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 12:08 AM
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
Title: Re:Makeservers
Post by: PaiD on April 25, 2004, 12:09 AM
Yea if you start to use GoSuGaMiNg  and ask for help I would help.
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:12 AM
now that im all caught up... is the name thing just the username?
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 12:13 AM
Mike.. i'll help you

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

Quote

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


Down with gosugaming!
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:18 AM
where did u get that quote from? putting words in my mouth? not cool ;/

down with badd!
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:20 AM
Yes also GoSuGaMING has his AIM screen name formatted like "GoSuGaMING".
Title: Re:Makeservers
Post by: Trickle on April 25, 2004, 12:21 AM
Kinda odd that WTFMATE and GOsuGaming Need the same Help at the same time.... Huremm must be fate
Title: Re:Makeservers
Post by: PaiD on April 25, 2004, 12:22 AM
Must be
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:24 AM
so it has to be the username i know it does ^^ but after i get connected it goes straight to sckMCP_error
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:24 AM
Quote from: Trickle on April 25, 2004, 12:21 AM
Kinda odd that WTFMATE and GOsuGaming Need the same Help at the same time.... Huremm must be fate

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

Quote from: GoSuGaMING on April 25, 2004, 12:06 AM
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
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:26 AM
Quote from: GoSuGaMING on April 25, 2004, 12:24 AM
so it has to be the username i know it does ^^ but after i get connected it goes straight to sckMCP_error

You're probably sending bad "MCP Chunks".
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:26 AM
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?
Title: Re:Makeservers
Post by: Trickle on April 25, 2004, 12:26 AM
Heh, must of had the reply box open to long.   :-\
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:26 AM
wtf is a bad MCP chunk ;/
Title: Re:Makeservers
Post by: PaiD on April 25, 2004, 12:27 AM
ok lets play...... I win b/c I have done these before.....GG?
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:29 AM
do u mean on the data_arrival?
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:30 AM
Well you're supposed to parse 2 "MCP Chunks" when you recieve packet 0x3e from battle.net.

(DWORD)       Cookie
(DWORD)       Status
(DWORD[2])    MCP Chunk 1
(DWORD)       IP
(DWORD)       Port
(DWORD[12])    MCP Chunk 2
(STRING)       BNCS unique name
(WORD)       Unknown


Then you send those on MCP packet 0x01.

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


Dim strTemp As String, strBuffer As String
sckMCP.GetData strTemp, vbString
strBuffer = strBuffer & strTemp
ParseMCP strBuffer


friend sent me this... i dont think it is going to work
Title: Re:Makeservers
Post by: Trickle on April 25, 2004, 12:37 AM
10 bucks its his packet header for mcp
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:38 AM
Well that doesn't help what is the beginning of "ParseMCP" look like?
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:38 AM
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
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:39 AM
Yeah that looks good.
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:40 AM
thats all i have on it so far ^^

lets help meh write the rest? <3
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 12:41 AM
Quote from: GoSuGaMING on April 25, 2004, 12:38 AM
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

code supplied by me
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:41 AM
indeed ^^

now send me the rest of it

*bows down*
Title: Re:Makeservers
Post by: Eric on April 25, 2004, 12:44 AM
Quote from: BaDDBLooD on April 25, 2004, 12:41 AM
Quote from: GoSuGaMING on April 25, 2004, 12:38 AM
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

code supplied by me

Ew. Why is your PacketID a string?
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 12:46 AM
cause i felt like it?
Title: Re:Makeservers
Post by: Eric on April 25, 2004, 12:48 AM
Quote from: BaDDBLooD on April 25, 2004, 12:46 AM
cause i felt like it?
Inaccurate, but what ever floats your boat.
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 12:49 AM
Ahh yes I over looked that when looking at it I guess, but I just do this which isn't that great either.

Select Case Asc(Mid$(strTemp, 3, 1))
   
       Case &H1 ' Start Packet '
       
           Select Case PBuffer.GetDWORD(Mid$(strTemp, 4, 4))
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 12:54 AM
damn lord u just got hoed?
Title: Re:Makeservers
Post by: Fr0z3N on April 25, 2004, 12:56 AM
Quote from: GoSuGaMING on April 25, 2004, 12:54 AM
damn lord u just got hoed?

Acually, you got 'hoed' by using inefficient coding giving to you by someone.
Title: Re:Makeservers
Post by: Eric on April 25, 2004, 12:57 AM
You might also want to use Ws2_32.dll's inet_ntoa() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/inet_ntoa_2.asp) function which would get rid of that large and sloppy MakeServer() function that Networks mentioned.

Quote from: GoSuGaMING on April 25, 2004, 12:54 AM
damn lord u just got hoed?
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.
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 01:01 AM
hmm... i see
Title: Re:Makeservers
Post by: BinaryzL on April 25, 2004, 01:15 AM
Quote from: LoRd[nK] on April 25, 2004, 12:57 AM
You might also want to use Ws2_32.dll's inet_ntoa() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/inet_ntoa_2.asp) function which would get rid of that large and sloppy MakeServer() function that Networks mentioned.

Quote from: GoSuGaMING on April 25, 2004, 12:54 AM
damn lord u just got hoed?
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.

Uhh yes you're right, but in my case I only need it once.
Title: Re:Makeservers
Post by: GoSuGaMING on April 25, 2004, 09:12 AM
lord why do u seem to piss everyone off on these fourms? ;/
Title: Re:Makeservers
Post by: BaDDBLooD on April 25, 2004, 09:15 AM
Quote from: GoSuGaMING on April 25, 2004, 09:12 AM
lord why do u seem to piss everyone off on these fourms? ;/

he's not purposely tying to piss everyone off

he just flames everyone who doesn't live up to his expectations
Title: Re:Makeservers
Post by: Dyndrilliac on April 25, 2004, 09:59 AM
Quote from: BaDDBLooD on April 25, 2004, 09:15 AM
Quote from: GoSuGaMING on April 25, 2004, 09:12 AM
lord why do u seem to piss everyone off on these fourms? ;/

he's not purposely tying to piss everyone off

he just flames everyone who doesn't live up to his expectations

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...
Title: Re:Makeservers
Post by: Skywing on April 25, 2004, 12:42 PM
This is not an instant messaging environment.