Author | Message | Time |
---|---|---|
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. [code]Public Sub Send1E() InsertDWORD 1 InsertDWORD 0 InsertDWORD 0 InsertDWORD 0 InsertDWORD 1 InsertNTString "0x25" InsertNTString "0x25" sendPacket &H1E InsertNonNTString "68XI" & varproduct InsertDWORD "&H" & GetVerByte() InsertDWORD 0 sendPacket &H6 If Form2.noping.Value = True Then InsertDWORD &H0 sendPacket &H25 End If End Sub[/code] And at the end I have [code]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[/code] Could someone please tell me what I'm doing wrong? Again, please no flames or disrespect. Thank you, JoeSchmoe Edit - Fixed your code tags. | September 21, 2003, 2:59 AM |
Spht | I'm not sure why you're treating varproduct as a reversed string, but: [code] 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[/code] 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: [code]InsertDWORD GetVerByte()[/code] Since GetVerByte returns a long (assuming InsertDWORD takes a long). | September 21, 2003, 3:06 AM |