Hi, i'm adding Realm to my bot (torn`bot) and I need the makeserver function for it... does anyone have this?
CLaN vA
What would this function do?
Converts the raw data from battle.net to the Realm server IP address.
You conver it to Long
than you turn it into hex
that's basically the function ;O
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.
yeah..
i have only seen the "makeserver" function in one bot... ::) ... SOUP BOT!!!!!!!
I believe you convert the string to hex values first then convert it to a long in the "makeserver" function.
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
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?
WTFMATE: You tell us. Does the "Makeservers" function call for the "ToHex" function or not?
Edit: Spelling
networks.. why did you give him that >_<
Yes, It would.... Read my edit! :o
all that is.. is ur username correct?
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
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
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?
then what is that string?
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
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
well in soup bot it says
urname = Mid(Data, 77, Len(Data) - 79)
/me notes that WTFMATE is GoSuGaMiNg
uh...
*notes* im not?
I think what everyone posted should of helped you lol....
* MoNeY notes that also *
As does baddblood
Bye Mike :)
As do I (Money Told me)
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 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.
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
Yea if you start to use GoSuGaMiNg and ask for help I would help.
now that im all caught up... is the name thing just the username?
Mike.. i'll help you
if you take back what you said on aim about me!
*notes wtfmate was me*
GoSuGaMING, take a look at my 3rd to last post excluding this one 11:54:23pm EST.
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!
where did u get that quote from? putting words in my mouth? not cool ;/
down with badd!
Yes also GoSuGaMING has his AIM screen name formatted like "GoSuGaMING".
Kinda odd that WTFMATE and GOsuGaming Need the same Help at the same time.... Huremm must be fate
Must be
so it has to be the username i know it does ^^ but after i get connected it goes straight to sckMCP_error
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
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".
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?
Heh, must of had the reply box open to long. :-\
wtf is a bad MCP chunk ;/
ok lets play...... I win b/c I have done these before.....GG?
do u mean on the data_arrival?
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
you wouldnt get a _error event b/c if the chucks are bad you would get disconnected or be sent 0x01 saying you failed.
i think it has to be my dataarrival...
Well what is the code?
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
10 bucks its his packet header for mcp
Well that doesn't help what is the beginning of "ParseMCP" look like?
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
Yeah that looks good.
thats all i have on it so far ^^
lets help meh write the rest? <3
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
indeed ^^
now send me the rest of it
*bows down*
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?
cause i felt like it?
Quote from: BaDDBLooD on April 25, 2004, 12:46 AM
cause i felt like it?
Inaccurate, but what ever floats your boat.
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))
damn lord u just got hoed?
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.
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.
hmm... i see
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.
lord why do u seem to piss everyone off on these fourms? ;/
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
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...
This is not an instant messaging environment.