CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2013
    Posts
    1

    Need Help with this code

    last week i found this code from online game DB

    0x551d000c500001c80002c8
    551d = thats mean weapon enchanted level 29
    0c50 = crit rate 80%
    01c8 = str+200

    and thats red 00 = (space)

    my question.. how to make that code with VB?
    i already tried for 4days, but nothing..
    anybody can help me?

    thanks
    Regards

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Need Help with this code

    I think that is Hexadecimal code ( if I'm not mistaken ). Do a search on the forums for Hex - there is a lot of info

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Need Help with this code

    Not nearly enough info in the OP to even guess what he is actually trying to do. My guess would be that value is stored somewhere with a save game file or other data file and he wants to replace the data that is there with something like this.

    Without more detailed info not much anyone could do to help other than suggest a search.

    Need better description of what you are trying to do,
    Need to know what you tried and what problem you were having
    would help to have some idea of you programming knowledge
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Need Help with this code

    and that would be a HACK
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Apr 2011
    Posts
    2

    Re: Need Help with this code

    try this

    Code:
    Option Explicit
    
    ' Created by Asymetrix 2013
    
    ' requires Multiline Text box , TXTOutput on form1
    
    Private Type stat
        Weapon As String
        Code As String
        Value As Integer
    End Type
    
    Private WeaponStat() As stat
    Private WeaponLine As String
    
    Private Sub Form_Load()
        ReDim WeaponStat(0)
    
        ' set weapon name with its own hex code - name, item code (hex), item value in decimal
        ' AddWeaponStat is used to add new weapons to the array
        '0x 551d 00 0c50 00 01c8 00 02c8
        ' [
        '0x [Enchantedhexcode]1d 00 [critratehexcode]50 00 [strhexcode]c8 00 [newweaponhexcode]c8
        'OR
        '0x [Enchantedhexcode]1d 00 [critratehexcode]50 00 [strhexcode]c8 00 [EndOfLinehexcode]
        ' ]
        ' further breakdown ..
        ' [
        '0x [Enchantedhexcode][29inhex] 00 [critratehexcode][80inhex] 00 [strhexcode][200inhex] 00 [newweaponhexcode][200inhex]
        'OR
        '0x [Enchantedhexcode][29inhex] 00 [critratehexcode][80inhex] 00 [strhexcode][200inhex] 00 [EndOfLinehexcode]
        ' ]
    
        AddWeaponStat "Enchanted", "55", 29
        AddWeaponStat "crit rate", "0c", 80
        AddWeaponStat "str", "01", 200
        AddWeaponStat "newweapon", "02", 200    ' or add EndOfLine marker AddWeaponStat "EOW", "02", 200
    
        ' add these weapons to the output string
        AddWeaponLine "Enchanted"
        AddWeaponLine "crit rate"
        AddWeaponLine "str"
        AddWeaponLine "newweapon"    ' or EndOfLine marker AddWeaponLine "EOW"
    
        TXTOutput.Text = WeaponLine
    
    End Sub
    
    Private Sub AddWeaponStat(ByVal WeaponName As String, ByVal WeaponCode As String, ByVal WeaponValueDec As Integer)
    ' set dynamic arrays to hold weapon data
        WeaponStat(UBound(WeaponStat)).Weapon = WeaponName
        WeaponStat(UBound(WeaponStat)).Code = WeaponCode
        WeaponStat(UBound(WeaponStat)).Value = WeaponValueDec
    
        ReDim Preserve WeaponStat(UBound(WeaponStat) + 1)
    
    End Sub
    
    Private Function ShowWeaponHex(WeaponName As String) As String
    ' Find Weapon Name and return hex code
        Dim i As Integer
    
        ShowWeaponHex = ""
    
        For i = 0 To UBound(WeaponStat) - 1
            ' match weapon name
            If WeaponName = WeaponStat(i).Weapon Then
                ShowWeaponHex = WeaponStat(i).Code & Hex(WeaponStat(i).Value)
                ' lowercase
                ShowWeaponHex = LCase(ShowWeaponHex)
                Exit For
            End If
    
        Next i
    
    End Function
    Private Sub AddWeaponLine(WeaponName As String)
    ' add selected weapon to the output list
        If WeaponLine = "" Then
            WeaponLine = "0x" & ShowWeaponHex(WeaponName)
        Else
            WeaponLine = WeaponLine & "00" & ShowWeaponHex(WeaponName)
        End If
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured