• Welcome to Valhalla Legends Archive.
 

Verbyte Problems

Started by JoeSchmoe, September 20, 2003, 09:59 PM

Previous topic - Next topic

JoeSchmoe

Hello, I am new to bots and I'm currently trying to study them. This is a "newb" question, and I'm sure all of you know the answer, but since I'm know, I do not know, so please no flames or disrespect.

Okay so, when I try to compile this code into an .EXE, the Visual Basic 6 debugger highlights the following bold text.

Public Sub Send1E()
   InsertDWORD 1
   InsertDWORD 0
   InsertDWORD 0
   InsertDWORD 0
   InsertDWORD 1
   InsertNTString "0x25"
   InsertNTString "0x25"
   sendPacket &H1E
   InsertNonNTString "68XI" & varproduct
   [B]InsertDWORD "&H" & GetVerByte()[/B]
   InsertDWORD 0
   sendPacket &H6
   If Form2.noping.Value = True Then
       InsertDWORD &H0
       sendPacket &H25
   End If
End Sub


And at the end I have

Private Function GetVerByte() As Long
On Error Resume Next
Select Case varproduct
       Case "RATS", "PXES"
           GetVerByte = "C7"
       Case "NB2W"
           GetVerByte = "4F"
       Case "VD2D", "PX2D"
           GetVerByte = "09"
       Case "3RAW", "PX3W"
           GetVerByte = "0C"
   End Select
End Function


Could someone please tell me what I'm doing wrong? Again, please no flames or disrespect.

Thank you,
JoeSchmoe

Edit - Fixed your code tags.

Spht

#1
I'm not sure why you're treating varproduct as a reversed string, but:


Private Function GetVerByte() As Long
   Select Case varproduct
       Case "RATS", "PXES"
           GetVerByte = &HC7
       Case "NB2W"
           GetVerByte = &H4F
       Case "VD2D", "PX2D"
           GetVerByte = &H09
       Case "3RAW", "PX3W"
           GetVerByte = &H0C
   End Select
End Function


Return the numerical value for long (or hexidecimal representation like I did). I removed your On Error Resume Next since not much wrong can go on there.

Now, when you use that, it should be:

InsertDWORD GetVerByte()

Since GetVerByte returns a long (assuming InsertDWORD takes a long).