Valhalla Legends Forums Archive | Battle.net Bot Development | Re: WAR3 Statstring Parsing

AuthorMessageTime
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.
October 15, 2002, 5:36 PM
warz
how i do it..
-------------
[code]
       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
[/code]
October 26, 2002, 1:56 PM
warz
[code]
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
[/code]
October 26, 2002, 1:57 PM
warz
Eww, totally ruins my tab skills..which is why [code] helps!
October 26, 2002, 1:58 PM
iago.
put it in a [code] block.. preserves tabs if I remember right :)
October 26, 2002, 2:06 PM
Noodlez
warz: geticontier = INNCORRECTAGE!!

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

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

:D
October 26, 2002, 2:24 PM
warz
for reeaallsss???
i thought if there were no stats games played, it was peon.
October 26, 2002, 2:27 PM
iago.
[code]
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
[/code]

you DO realize this case statement makes no sense at all..
November 11, 2002, 4:26 PM
Noodlez
in vb it does =P
November 12, 2002, 11:18 PM

Search