Valhalla Legends Forums Archive | Battle.net Bot Development | WAR3 RoC / TFT stat string

AuthorMessageTime
PunK
I was wondering if the method I'm using to parse statistics is correct.

PX3W 3H3W 16
[code]
    Select Case Race
        Case "H"
            Select Case Num
                Case 1: HandleStat = 44 'Footman
                Case 2: HandleStat = 45 'Knight
                Case 3: HandleStat = 46 'Archmage
                Case 4: HandleStat = 47 'Medivh
                Case Else: HandleStat = ICON_WAR3
            End Select
[/code]
This would mean he has the Archmage icon with 16 wins, correct?

My second question. What does the stat string look like for a user with a Tournament record?
November 26, 2007, 2:16 AM
BreW
CHRIS?! <3
Answer to your question: Yes.
November 26, 2007, 2:32 AM
HdxBmx27
Shot answer: Yes you're doing it right, and insted of "XX3W" you would see things like "0KBK" for KBK turnie icons.
~Hdx
November 26, 2007, 2:34 AM
PunK
Hey Brew =]

Hdx, I was talking to a kid who had a tourny icon and the string was "3D3W". But the icon was off by 1. Instead of Case 3, I would have to use Case 2...

And I tried using StealthBot for a reference... that wasn't a great idea because his parsing is way off.

--edit

Warcraft III TFT has there own tournaments.
http://www.battle.net/war3/ladder/w3xp-ladder-info-laddericons.aspx
November 26, 2007, 2:55 AM
HdxBmx27
If you're referring to these images, it's simply T instead of H, U, N, R, or O
W3T2: [img]http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T2.gif[/img]
W3T3: [img]http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T3.gif[/img]
W3T4: [img]http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T4.gif[/img]
W3T5: [img]http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T5.gif[/img]
~Hdx
November 26, 2007, 3:02 AM
PunK
Hmm, so I should subtract 1 from the number so it adds a peon icon.

And uhh... are you sure about the character being T? Like I said, I asked somebody who had a tourny icon and the character was D.
November 26, 2007, 3:04 AM
HdxBmx27
Umm, Off the top of my head 1*3W is ALWAYS Peon icon.
So no you shouldn't need to -1.
And actually, I think your original thing is wrong. everything should be
[code]    Select Case Race
        Case "H"
            Select Case Num
                Case 1: HandleStat = 41 'Peon
                Case 2: HandleStat = 44 'Footman
                Case 3: HandleStat = 45 'Knight
                Case 4: HandleStat = 46 'Archmage
                Case 5: HandleStat = 47 'Medivh
                Case Else: HandleStat = ICON_WAR3
            End Select[/code]
~Hdx
November 26, 2007, 3:09 AM
PunK
You're right. But subtracting one will result it going to Case Else which is default peon icon.
November 26, 2007, 3:20 AM
HdxBmx27
Something like this should be fine:
[code]
    Icon = ICON_PEON
    Select Case Race
        Case "H"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case "U"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case "O"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case "N"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case "R"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case "T"
            Select Case Num
                Case 2:
                Case 3:
                Case 4:
                Case 5:
            End Select
      Case Else: Icon = ICON_UNKNOWNWC3
  End Select[/code]
~Hdx
November 26, 2007, 3:27 AM
Barabajagal
[code]    ClassName = Mid$(Values(1), 3, 1)
    ClassLev = CLng(Right$(Values(1), 1))
    'WAR3
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Footman (25 wins)"
                Case &H3
                    cType = "Human Knight (250 wins)"
                Case &H4
                    cType = "Human Archmage (500 wins)"
                Case &H5
                    cType = "Human Medivh (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Grunt (25 wins)"
                Case &H3
                    cType = "Orc Tauren (250 wins)"
                Case &H4
                    cType = "Orc Far Seer (500 wins)"
                Case &H5
                    cType = "Orc Thrall (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Archer (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Claw (250 wins)"
                Case &H4
                    cType = "Night Elf Priestess of the Moon (500 wins)"
                Case &H5
                    cType = "Night Elf Furion Stormrage (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Ghoul (25 wins)"
                Case &H3
                    cType = "Undead Abomination (250 wins)"
                Case &H4
                    cType = "Undead Lich (500 wins)"
                Case &H5
                    cType = "Undead Tichondrius (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Green Dragon Whelp (25 wins)"
                Case &H3
                    cType = "Random Blue Dragon (250 wins)"
                Case &H4
                    cType = "Random Red Dragon (500 wins)"
                Case &H5
                    cType = "Random Deathwing (1500 wins)"
            End Select
    End Select

    'W3XP
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Rifleman (25 wins)"
                Case &H3
                    cType = "Human Sorceress (150 wins)"
                Case &H4
                    cType = "Human Spellbreaker (350 wins)"
                Case &H5
                    cType = "Human Blood Mage (750 wins)"
                Case &H6
                    cType = "Human Jaina (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Troll Headhunter (25 wins)"
                Case &H3
                    cType = "Orc Shaman (150 wins)"
                Case &H4
                    cType = "Orc Spirit Walker (350 wins)"
                Case &H5
                    cType = "Orc Shadow Hunter (750 wins)"
                Case &H6
                    cType = "Orc Rexxar (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Huntress (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Talon (150 wins)"
                Case &H4
                    cType = "Night Elf Dryad (350 wins)"
                Case &H5
                    cType = "Night Elf Keeper of the Grove (750 wins)"
                Case &H6
                    cType = "Night Elf Maiev (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Crypt Fiend (25 wins)"
                Case &H3
                    cType = "Undead Banshee (150 wins)"
                Case &H4
                    cType = "Undead Destroyer (350 wins)"
                Case &H5
                    cType = "Undead Crypt Lord (750 wins)"
                Case &H6
                    cType = "Undead Sylvanas (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Myrmidon (25 wins)"
                Case &H3
                    cType = "Random Siren (150 wins)"
                Case &H4
                    cType = "Random Dragon Turtle (350 wins)"
                Case &H5
                    cType = "Random Sea Witch (750 wins)"
                Case &H6
                    cType = "Random Illidan (1500 wins)"
            End Select
        Case "D"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Tournament Felguard (10 wins)"
                Case &H3
                    cType = "Tournament Infernal (75 wins)"
                Case &H4
                    cType = "Tournament Doomguard (150 wins)"
                Case &H5
                    cType = "Tournament Pit Lord (250 wins)"
                Case &H6
                    cType = "Tournament Archimonde (500 wins)"
            End Select
    End Select
[/code]

And Icons:
http://realityripple.com/Uploads/icons/Warcraft%20III/
November 26, 2007, 4:08 AM
PunK
Yah, what Hdx posted was basically what I had and it works =]

Thanks guys.
November 26, 2007, 5:16 AM
UserLoser
[quote author=Andy link=topic=17190.msg175033#msg175033 date=1196050087]
[code]    ClassName = Mid$(Values(1), 3, 1)
    ClassLev = CLng(Right$(Values(1), 1))
    'WAR3
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Footman (25 wins)"
                Case &H3
                    cType = "Human Knight (250 wins)"
                Case &H4
                    cType = "Human Archmage (500 wins)"
                Case &H5
                    cType = "Human Medivh (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Grunt (25 wins)"
                Case &H3
                    cType = "Orc Tauren (250 wins)"
                Case &H4
                    cType = "Orc Far Seer (500 wins)"
                Case &H5
                    cType = "Orc Thrall (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Archer (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Claw (250 wins)"
                Case &H4
                    cType = "Night Elf Priestess of the Moon (500 wins)"
                Case &H5
                    cType = "Night Elf Furion Stormrage (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Ghoul (25 wins)"
                Case &H3
                    cType = "Undead Abomination (250 wins)"
                Case &H4
                    cType = "Undead Lich (500 wins)"
                Case &H5
                    cType = "Undead Tichondrius (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Green Dragon Whelp (25 wins)"
                Case &H3
                    cType = "Random Blue Dragon (250 wins)"
                Case &H4
                    cType = "Random Red Dragon (500 wins)"
                Case &H5
                    cType = "Random Deathwing (1500 wins)"
            End Select
    End Select

    'W3XP
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Rifleman (25 wins)"
                Case &H3
                    cType = "Human Sorceress (150 wins)"
                Case &H4
                    cType = "Human Spellbreaker (350 wins)"
                Case &H5
                    cType = "Human Blood Mage (750 wins)"
                Case &H6
                    cType = "Human Jaina (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Troll Headhunter (25 wins)"
                Case &H3
                    cType = "Orc Shaman (150 wins)"
                Case &H4
                    cType = "Orc Spirit Walker (350 wins)"
                Case &H5
                    cType = "Orc Shadow Hunter (750 wins)"
                Case &H6
                    cType = "Orc Rexxar (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Huntress (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Talon (150 wins)"
                Case &H4
                    cType = "Night Elf Dryad (350 wins)"
                Case &H5
                    cType = "Night Elf Keeper of the Grove (750 wins)"
                Case &H6
                    cType = "Night Elf Maiev (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Crypt Fiend (25 wins)"
                Case &H3
                    cType = "Undead Banshee (150 wins)"
                Case &H4
                    cType = "Undead Destroyer (350 wins)"
                Case &H5
                    cType = "Undead Crypt Lord (750 wins)"
                Case &H6
                    cType = "Undead Sylvanas (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Myrmidon (25 wins)"
                Case &H3
                    cType = "Random Siren (150 wins)"
                Case &H4
                    cType = "Random Dragon Turtle (350 wins)"
                Case &H5
                    cType = "Random Sea Witch (750 wins)"
                Case &H6
                    cType = "Random Illidan (1500 wins)"
            End Select
        Case "D"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Tournament Felguard (10 wins)"
                Case &H3
                    cType = "Tournament Infernal (75 wins)"
                Case &H4
                    cType = "Tournament Doomguard (150 wins)"
                Case &H5
                    cType = "Tournament Pit Lord (250 wins)"
                Case &H6
                    cType = "Tournament Archimonde (500 wins)"
            End Select
    End Select
[/code]

And Icons:
http://realityripple.com/Uploads/icons/Warcraft%20III/
[/quote]

That can be optimized in so many different ways...eww
November 27, 2007, 9:26 AM
MyStiCaL
[quote author=UserLoser link=topic=17190.msg175054#msg175054 date=1196155573]
[quote author=Andy link=topic=17190.msg175033#msg175033 date=1196050087]
[code]    ClassName = Mid$(Values(1), 3, 1)
    ClassLev = CLng(Right$(Values(1), 1))
    'WAR3
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Footman (25 wins)"
                Case &H3
                    cType = "Human Knight (250 wins)"
                Case &H4
                    cType = "Human Archmage (500 wins)"
                Case &H5
                    cType = "Human Medivh (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Grunt (25 wins)"
                Case &H3
                    cType = "Orc Tauren (250 wins)"
                Case &H4
                    cType = "Orc Far Seer (500 wins)"
                Case &H5
                    cType = "Orc Thrall (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Archer (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Claw (250 wins)"
                Case &H4
                    cType = "Night Elf Priestess of the Moon (500 wins)"
                Case &H5
                    cType = "Night Elf Furion Stormrage (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Ghoul (25 wins)"
                Case &H3
                    cType = "Undead Abomination (250 wins)"
                Case &H4
                    cType = "Undead Lich (500 wins)"
                Case &H5
                    cType = "Undead Tichondrius (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Green Dragon Whelp (25 wins)"
                Case &H3
                    cType = "Random Blue Dragon (250 wins)"
                Case &H4
                    cType = "Random Red Dragon (500 wins)"
                Case &H5
                    cType = "Random Deathwing (1500 wins)"
            End Select
    End Select

    'W3XP
    Select Case ClassName
        Case "H"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Human Rifleman (25 wins)"
                Case &H3
                    cType = "Human Sorceress (150 wins)"
                Case &H4
                    cType = "Human Spellbreaker (350 wins)"
                Case &H5
                    cType = "Human Blood Mage (750 wins)"
                Case &H6
                    cType = "Human Jaina (1500 wins)"
            End Select
        Case "O"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Orc Troll Headhunter (25 wins)"
                Case &H3
                    cType = "Orc Shaman (150 wins)"
                Case &H4
                    cType = "Orc Spirit Walker (350 wins)"
                Case &H5
                    cType = "Orc Shadow Hunter (750 wins)"
                Case &H6
                    cType = "Orc Rexxar (1500 wins)"
            End Select
        Case "N"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Night Elf Huntress (25 wins)"
                Case &H3
                    cType = "Night Elf Druid of the Talon (150 wins)"
                Case &H4
                    cType = "Night Elf Dryad (350 wins)"
                Case &H5
                    cType = "Night Elf Keeper of the Grove (750 wins)"
                Case &H6
                    cType = "Night Elf Maiev (1500 wins)"
            End Select
        Case "U"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Undead Crypt Fiend (25 wins)"
                Case &H3
                    cType = "Undead Banshee (150 wins)"
                Case &H4
                    cType = "Undead Destroyer (350 wins)"
                Case &H5
                    cType = "Undead Crypt Lord (750 wins)"
                Case &H6
                    cType = "Undead Sylvanas (1500 wins)"
            End Select
        Case "R"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Random Myrmidon (25 wins)"
                Case &H3
                    cType = "Random Siren (150 wins)"
                Case &H4
                    cType = "Random Dragon Turtle (350 wins)"
                Case &H5
                    cType = "Random Sea Witch (750 wins)"
                Case &H6
                    cType = "Random Illidan (1500 wins)"
            End Select
        Case "D"
            Select Case ClassLev
                Case &H1
                    cType = "Peon"
                Case &H2
                    cType = "Tournament Felguard (10 wins)"
                Case &H3
                    cType = "Tournament Infernal (75 wins)"
                Case &H4
                    cType = "Tournament Doomguard (150 wins)"
                Case &H5
                    cType = "Tournament Pit Lord (250 wins)"
                Case &H6
                    cType = "Tournament Archimonde (500 wins)"
            End Select
    End Select
[/code]

And Icons:
http://realityripple.com/Uploads/icons/Warcraft%20III/
[/quote]

That can be optimized in so many different ways...eww
[/quote]

to say somthing and not give him an example is very bad.
November 27, 2007, 9:28 AM
Barabajagal
It was for easy display and comprehension. If I wanted it to be "optimized", I would have used an array.
November 27, 2007, 9:32 AM
iNsaNe
[quote author=PunK link=topic=17190.msg175020#msg175020 date=1196043405]
PX3W 3H3W 16
...
This would mean he has the Archmage icon with 16 wins, correct?
[/quote]

no it means he's level 16 and has the sorceress icon.
December 1, 2007, 11:17 PM
UserLoser
Way back in the day W3 statstrings included the amount of wins
December 2, 2007, 9:47 AM
Camel
That was two changes to W3 statstrings ago.

I keep an object linked to my 'bnet user' object that keeps track of the statstring info. It knows what the 'product id' and 'icon id' of the user are; both are stored as DWORDs. When I look for an icon do display in the userlist, if 'legacy icons' are enabled, I look for an entry matching the 'icon id' and fall back on Icons.bni against the 'product id'.

By using a DWORD for product id/icon id, you can avoid dealing with strings all together. This is particularly desirable for conditions where the information isn't really a string at all. These DWORDs just happens to be a human-readable. In reality, the only constraint is that they do not contain zero-value bytes, since they are stored in an NT string. Because of this, it's important to use binary-safe operations.
December 2, 2007, 11:51 AM

Search