• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Getting Username without Numbers

Status
Not open for further replies.
Level 2
Joined
Oct 2, 2011
Messages
8
I want to detect when the game is played in Reforged and for players names detect where the # and numbers start.
For example Username#1234
I want to auto detect where the # starts and cut everything to the left of it so i have only Username (the players name) and store to a string var array.

I'm new back to editing, so can you make it GUI friendly?
:ogre_haosis: Thanks!
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set VariableSet TempPlayer = (Picked player)
        • Set VariableSet TempString[0] = (Name of TempPlayer)
        • For each (Integer NameLoop) from 1 to (Length of TempString[0]), do (Actions)
          • Loop - Actions
            • Set VariableSet TempString[1] = (Substring(TempString[0], NameLoop, NameLoop))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • TempString[1] Equal to #
              • Then - Actions
                • Set VariableSet PlayerName[(Player number of TempPlayer)] = (Substring(TempString[0], 1, (NameLoop - 1)))
                • Player - Set name of TempPlayer to PlayerName[(Player number of TempPlayer)]
              • Else - Actions
You can even incorporate colors, so the player's name is color-coded. This is useful for text messages and multiboards.
  • Actions
    • Set VariableSet PlayerColor[1] = |CFFFF0303
    • Set VariableSet PlayerColor[2] = |CFF0042FF
    • Set VariableSet PlayerColor[3] = |C0000FFFF
    • Set VariableSet PlayerColor[4] = |CFF540081
    • Set VariableSet PlayerColor[5] = |CFFFFFF01
    • Set VariableSet PlayerColor[6] = |CFFFE8A0E
    • Set VariableSet PlayerColor[7] = |CFF20C000
    • Set VariableSet PlayerColor[8] = |CFFE55BB0
    • Set VariableSet PlayerColor[9] = |CFF959697
    • Set VariableSet PlayerColor[10] = |CFF7EBFF1
    • Set VariableSet PlayerColor[11] = |CFF106246
    • Set VariableSet PlayerColor[12] = |CFF4E2A04
    • Set VariableSet PlayerColor[13] = |CFF800000
    • Set VariableSet PlayerColor[14] = |CFF000080
    • Set VariableSet PlayerColor[15] = |cFF40E0D0
    • Set VariableSet PlayerColor[16] = |cFFAE17AE
    • Set VariableSet PlayerColor[17] = |cFFF5DEB3
    • Set VariableSet PlayerColor[18] = |cFFFFCB9B
    • Set VariableSet PlayerColor[19] = |cff96ff96
    • Set VariableSet PlayerColor[20] = |cffffcde6
    • Set VariableSet PlayerColor[21] = |cFF2C2C2C
    • Set VariableSet PlayerColor[22] = |cFFFFFAFA
    • Set VariableSet PlayerColor[23] = |cFF33A457
    • Set VariableSet PlayerColor[24] = |cFFAB6049
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set VariableSet TempPlayer = (Picked player)
        • Set VariableSet TempString[0] = (Name of TempPlayer)
        • For each (Integer NameLoop) from 1 to (Length of TempString[0]), do (Actions)
          • Loop - Actions
            • Set VariableSet TempString[1] = (Substring(TempString[0], NameLoop, NameLoop))
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • TempString[1] Equal to #
              • Then - Actions
                • Set VariableSet PlayerName[(Player number of TempPlayer)] = (PlayerColor[(Player number of TempPlayer)] + ((Substring(TempString[0], 1, (NameLoop - 1))) + |r))
                • Player - Set name of TempPlayer to PlayerName[(Player number of TempPlayer)]
              • Else - Actions
 

Attachments

  • Name Fix.w3m
    17 KB · Views: 29
Last edited:
Status
Not open for further replies.
Top