• Welcome to Valhalla Legends Archive.
 

Makeservers

Started by WTFMATE, April 24, 2004, 11:25 PM

Previous topic - Next topic

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

PaiD

What would this function do?

BinaryzL

Converts the raw data from battle.net to the Realm server IP address.

BaDDBLooD

You conver it to Long

than you turn it into hex

that's basically the function ;O
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

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.

BaDDBLooD

yeah..

i have only seen the "makeserver" function in one bot...  ::) ... SOUP BOT!!!!!!!
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

BinaryzL

#6
I believe you convert the string to hex values first then convert it to a long in the "makeserver" function.

Networks


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

WTFMATE

#8
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?

PaiD

#9
WTFMATE: You tell us. Does the "Makeservers" function call for the "ToHex" function or not?

Edit: Spelling

BaDDBLooD

networks.. why did you give him that >_<
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

WTFMATE

#11
Yes, It would.... Read my edit! :o

all that is.. is ur username correct?

BinaryzL

#12
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

WTFMATE

#13
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


BinaryzL

#14
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?