• Welcome to Valhalla Legends Archive.
 

Re: WAR3 Statstring Parsing

Started by SoulTaker, October 15, 2002, 12:36 PM

Previous topic - Next topic

SoulTaker

That link is for the old statstrings.

The W3 stands for War3 (AFAIK), O is for Orcs as you said, and the 2 is indeed the icon tier.
You can find the icons/wins to go with them on the War3 Ladder Page over at battle.net
1 would be peon icon, 2 would be Grunt icon (for orcs), etc.

warz

how i do it..
-------------
       Case "3RAW"
            sprintf outbuf, "WarCraft III: Reign of Chaos ("
            If Len(statstring) > 4 Then
                Values = Split(statstring, " ")
                    Select Case Mid$(Values(1), 1, 1)
                        Case 1: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
                        Case 2: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
                        Case 3: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
                        Case 4: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
                        Case Else: strcpy outbuf, "unknown icon " & Mid$(Values(1), 1, 1) & ", "
                    End Select
                    Select Case Mid$(Values(1), 2, 1)
                        Case "H": strcpy outbuf, "human race, "
                        Case "O": strcpy outbuf, "orc race, "
                        Case "N": strcpy outbuf, "night elf race, "
                        Case "U": strcpy outbuf, "undead race, "
                        Case "R": strcpy outbuf, "random race, "
                        Case Else: strcpy outbuf, "unknown race, "
                    End Select
                    strcpy outbuf, Values(2) & " wins)"
                Exit Sub
            ElseIf Len(statstring) = 4 Then
                strcpy outbuf, "No stats available)"
                Exit Sub
            Else
                strcpy outbuf, "error: " & statstring & ")"
                Exit Sub
            End If

warz

Public Function GetIconTier(ByVal IconNum As Long, ByVal Race As String) As String
    Select Case Race
        Case "H"
            Select Case IconNum
                Case 1: GetIconTier = "footman"
                Case 2: GetIconTier = "knight"
                Case 3: GetIconTier = "archmage"
                Case 4: GetIconTier = "medivh"
                Case Else: GetIconTier = "unknown human"
            End Select
        Case "O"
            Select Case IconNum
                Case 1: GetIconTier = "grunt"
                Case 2: GetIconTier = "tauren"
                Case 3: GetIconTier = "far seer"
                Case 4: GetIconTier = "thrall"
                Case Else: GetIconTier = "unknown orc"
            End Select
        Case "N"
            Select Case IconNum
                Case 1: GetIconTier = "archer"
                Case 2: GetIconTier = "druid of the claw"
                Case 3: GetIconTier = "priestess of the moon"
                Case 4: GetIconTier = "furion stomrage"
                Case Else: GetIconTier = "unknown night elf"
            End Select
        Case "U"
            Select Case IconNum
                Case 1: GetIconTier = "ghoul"
                Case 2: GetIconTier = "abomination"
                Case 3: GetIconTier = "lich"
                Case 4: GetIconTier = "tichondrius"
                Case Else: GetIconTier = "unknown undead"
            End Select
        Case "R"
            Select Case IconNum
                Case 1: GetIconTier = "green dragon whelp"
                Case 2: GetIconTier = "blue dragon"
                Case 3: GetIconTier = "red dragon"
                Case 4: GetIconTier = "deathwing"
                Case Else: GetIconTier = "unknown random"
            End Select
        Case Else
            GetIconTier = "unknown race"
    End Select
End Function

warz

Eww, totally ruins my tab skills..which is why [code] helps!

iago

#4
put it in a [code] block.. preserves tabs if I remember right :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Noodlez

#5
warz: geticontier = INNCORRECTAGE!!

Case 1: = ALWAYS Orc peon!!!! bad boy

everything else should start with case 2: and end with case 5:

 :D

warz

#6
for reeaallsss???
i thought if there were no stats games played, it was peon.

iago

#7
Select Case Mid$(Values(1), 1, 1)
Case 1: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
Case 2: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
Case 3: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
Case 4: strcpy outbuf, GetIconTier(Mid$(Values(1), 1, 1), Mid$(Values(1), 2, 1)) & " icon, "
Case Else: strcpy outbuf, "unknown icon " & Mid$(Values(1), 1, 1) & ", "
End Select

you DO realize this case statement makes no sense at all..
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Noodlez

#8
in vb it does =P