• Welcome to Valhalla Legends Archive.
 

S -> C 0x50?

Started by Abolition, September 24, 2006, 12:40 PM

Previous topic - Next topic

Abolition

#15
Eh, I found that that was my Data_Arrival sub...

I got this(I found this sub on this forum):

Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
    Static PktBuff As String 'Packet Buffer
    Dim Incoming As String
    Dim PacketLength As Long
    Winsock2.GetData Incoming, vbString, bytesTotal
    PktBuff = PktBuff & Incoming
   
    While Len(PktBuff) > 3
        PacketLength = GetWord(Mid$(PktBuff, 3, 2))
        If Len(PktBuff) < PacketLength Then Exit Sub
        ParseData Left(PktBuff, PacketLength))
        PktBuff = Mid(PktBuff, PacketLength + 1)
    Wend
End Sub


When I run it, I get a type mismatch error... it highlights this line:

ParseData Left(PktBuff, PacketLength))


ParseData is another sub that takes my packets and, like the name explains, parse packets.

l2k-Shadow

you have an extra ) at the end ::)
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Abolition

Quote from: l2k-Shadow on September 24, 2006, 05:38 PM
you have an extra ) at the end ::)

Sorry, I made a mistake in my post. It was supposed be:

ParseData (Left(PktBuff, PacketLength))


I still get the same error.

l2k-Shadow

Then your ParseData is looking for something other than a string.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Abolition

Here is my ParseData sub.
It was just a test to see if I received the packets correctly.

Public Sub ParseData(PacketID As Long)
'Parsing
Select Case PacketID
Case &H25
AddChat vbYellow, "Received: 0x25"
Case &H50
AddChat vbYellow, "Received: 0x50"
End Select
End Sub

l2k-Shadow

Quote from: Abolition on September 24, 2006, 05:47 PM
Here is my ParseData sub.
It was just a test to see if I received the packets correctly.

Public Sub ParseData(PacketID As Long)
'Parsing
Select Case PacketID
Case &H25
AddChat vbYellow, "Received: 0x25"
Case &H50
AddChat vbYellow, "Received: 0x50"
End Select
End Sub


Exactly, your ParseData is expecting a Long, but Left$() returns a String.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Cat Food

Quote from: Abolition on September 24, 2006, 05:40 PM
Quote from: l2k-Shadow on September 24, 2006, 05:38 PM
you have an extra ) at the end ::)

Sorry, I made a mistake in my post. It was supposed be:

ParseData (Left(PktBuff, PacketLength))


I still get the same error.


Not exactly how I would do things but you can try
ParseData (Val#(Left$(PktBuff, PacketLength)))

But by the looks of this you arn't extracting the packet ID to begin with. So I have a feeling you are going to have a lot more problems in the future.

FrostWraith

Dear God, just post a packet log.

l2k-Shadow

Quote from: ImaWh0re on September 24, 2006, 07:29 PM
Quote from: Abolition on September 24, 2006, 05:40 PM
Quote from: l2k-Shadow on September 24, 2006, 05:38 PM
you have an extra ) at the end ::)

Sorry, I made a mistake in my post. It was supposed be:

ParseData (Left(PktBuff, PacketLength))


I still get the same error.


Not exactly how I would do things but you can try
ParseData (Val#(Left$(PktBuff, PacketLength)))

But by the looks of this you arn't extracting the packet ID to begin with. So I have a feeling you are going to have a lot more problems in the future.

Yes! Use Val#() on a string, excellent suggestion.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Eric


topaz

RLY...?

FrostWraith

I have it too lol. Not useful anymore. Il sell for $10.

Cat Food

Quote from: l2k-Shadow on September 24, 2006, 08:47 PM
Quote from: ImaWh0re on September 24, 2006, 07:29 PM
Quote from: Abolition on September 24, 2006, 05:40 PM
Quote from: l2k-Shadow on September 24, 2006, 05:38 PM
you have an extra ) at the end ::)

Sorry, I made a mistake in my post. It was supposed be:

ParseData (Left(PktBuff, PacketLength))


I still get the same error.


Not exactly how I would do things but you can try
ParseData (Val#(Left$(PktBuff, PacketLength)))

But by the looks of this you arn't extracting the packet ID to begin with. So I have a feeling you are going to have a lot more problems in the future.

Yes! Use Val#() on a string, excellent suggestion.

Dear MORON,
  Msgbox Val#("23")

Mystical

Quote from: Abolition on September 24, 2006, 05:47 PM
Here is my ParseData sub.
It was just a test to see if I received the packets correctly.

Public Sub ParseData(PacketID As Long)
'Parsing
Select Case PacketID
Case &H25
AddChat vbYellow, "Received: 0x25"
Case &H50
AddChat vbYellow, "Received: 0x50"
End Select
End Sub



maybe somthing like?

Public Sub ParseData(Data as String)

   Dim PacketID As Byte
       PacketID = Asc(Mid(Data, 2, 1))
   
          Select Case PacketID

                     Case &H25

                     Case &H50

                     Case &H51

           End Select

End Sub


l2k-Shadow

Quote from: ImaWh0re on September 24, 2006, 11:54 PM
Quote from: l2k-Shadow on September 24, 2006, 08:47 PM
Quote from: ImaWh0re on September 24, 2006, 07:29 PM
Quote from: Abolition on September 24, 2006, 05:40 PM
Quote from: l2k-Shadow on September 24, 2006, 05:38 PM
you have an extra ) at the end ::)

Sorry, I made a mistake in my post. It was supposed be:

ParseData (Left(PktBuff, PacketLength))


I still get the same error.


Not exactly how I would do things but you can try
ParseData (Val#(Left$(PktBuff, PacketLength)))

But by the looks of this you arn't extracting the packet ID to begin with. So I have a feeling you are going to have a lot more problems in the future.

Yes! Use Val#() on a string, excellent suggestion.

Dear MORON,
  Msgbox Val#("23")


Yes, however, Left$(PktBuff, PacketLength) does not return a number.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

|