Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: PunK on November 25, 2007, 08:16 PM

Title: WAR3 RoC / TFT stat string
Post by: PunK on November 25, 2007, 08:16 PM
I was wondering if the method I'm using to parse statistics is correct.

PX3W 3H3W 16

    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

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?
Title: Re: WAR3 RoC / TFT stat string
Post by: brew on November 25, 2007, 08:32 PM
CHRIS?! <3
Answer to your question: Yes.
Title: Re: WAR3 RoC / TFT stat string
Post by: Hdx on November 25, 2007, 08:34 PM
Shot answer: Yes you're doing it right, and insted of "XX3W" you would see things like "0KBK" for KBK turnie icons.
~Hdx
Title: Re: WAR3 RoC / TFT stat string
Post by: PunK on November 25, 2007, 08:55 PM
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
Title: Re: WAR3 RoC / TFT stat string
Post by: Hdx on November 25, 2007, 09:02 PM
If you're referring to these images, it's simply T instead of H, U, N, R, or O
W3T2: (http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T2.gif)
W3T3: (http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T3.gif)
W3T4: (http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T4.gif)
W3T5: (http://www.battle.net/war3/ladder/portraits/large/w3xp/W3T5.gif)
~Hdx
Title: Re: WAR3 RoC / TFT stat string
Post by: PunK on November 25, 2007, 09:04 PM
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.
Title: Re: WAR3 RoC / TFT stat string
Post by: Hdx on November 25, 2007, 09:09 PM
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
    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

~Hdx
Title: Re: WAR3 RoC / TFT stat string
Post by: PunK on November 25, 2007, 09:20 PM
You're right. But subtracting one will result it going to Case Else which is default peon icon.
Title: Re: WAR3 RoC / TFT stat string
Post by: Hdx on November 25, 2007, 09:27 PM
Something like this should be fine:

    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

~Hdx
Title: Re: WAR3 RoC / TFT stat string
Post by: Barabajagal on November 25, 2007, 10:08 PM
    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


And Icons:
http://realityripple.com/Uploads/icons/Warcraft%20III/
Title: Re: WAR3 RoC / TFT stat string
Post by: PunK on November 25, 2007, 11:16 PM
Yah, what Hdx posted was basically what I had and it works =]

Thanks guys.
Title: Re: WAR3 RoC / TFT stat string
Post by: UserLoser on November 27, 2007, 03:26 AM
Quote from: Andy on November 25, 2007, 10:08 PM
    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


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

That can be optimized in so many different ways...eww
Title: Re: WAR3 RoC / TFT stat string
Post by: Mystical on November 27, 2007, 03:28 AM
Quote from: UserLoser on November 27, 2007, 03:26 AM
Quote from: Andy on November 25, 2007, 10:08 PM
    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


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

That can be optimized in so many different ways...eww

to say somthing and not give him an example is very bad.
Title: Re: WAR3 RoC / TFT stat string
Post by: Barabajagal on November 27, 2007, 03:32 AM
It was for easy display and comprehension. If I wanted it to be "optimized", I would have used an array.
Title: Re: WAR3 RoC / TFT stat string
Post by: iNsaNe on December 01, 2007, 05:17 PM
Quote from: PunK on November 25, 2007, 08:16 PM
PX3W 3H3W 16
...
This would mean he has the Archmage icon with 16 wins, correct?

no it means he's level 16 and has the sorceress icon.
Title: Re: WAR3 RoC / TFT stat string
Post by: UserLoser on December 02, 2007, 03:47 AM
Way back in the day W3 statstrings included the amount of wins
Title: Re: WAR3 RoC / TFT stat string
Post by: Camel on December 02, 2007, 05:51 AM
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.