• Welcome to Valhalla Legends Archive.
 

Clan Member List

Started by GoSuGaMING, June 28, 2004, 12:44 AM

Previous topic - Next topic

GoSuGaMING

What do you guys think is the best way to sort the different ranks out?



You know
(Chieftain top)
(shamin)
(Grunt)
(Peon)

MyndFyre

#1
Quote from: GoSuGaMING on June 28, 2004, 12:44 AM
What do you guys think is the best way to sort the different ranks out?



You know
(Chieftain top)
(shamin)
(Grunt)
(Peon)

I do it this way:

Chieftan: Insert at 0.

Shaman: Insert at 0 plus the number of Chieftans received.

Grunt: Insert at 1 plus the number of Shamans received.

Peons: Insert at 1 plus the number of Shamans and Grunts received.

Recruits: Insert at 1 plus the number of Shamans, Grunts, and Peons received.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

BaDDBLooD

#2
I added them all to a array

Than for each item in the array

i had

Name as String
Rank as Integer
Status as Integer

Than i just used a Loop to add them to the listview depending on Rank ;\
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Stealth

I use the ListView's built-in sorting system - one of my columns [invisible] contains their rank, so I just sort Ascending based on that column.
- Stealth
Author of StealthBot

BaDDBLooD

Stealth.. I might look into doing it that way! Is that ok if i use your idea?
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

GoSuGaMING

#5
Quote from: Stealth on June 28, 2004, 04:36 PM
I use the ListView's built-in sorting system - one of my columns [invisible] contains their rank, so I just sort Ascending based on that column.


Public Function GetClanList(Data As String)

Form1.LvClan.ListItems.Clear

Dim List() As String
Dim x As Integer
List = Split(Mid$(Data, 10), Chr(0), -1)
     For x = 0 To UBound(List)
     
     If Not List(x) = "" Then

     Select Case Asc(List(x))
     Case Is > 4
     Form1.LvClan.ListItems.Add , , List(x)
     Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 128
     Case 0, 1, 2, 3, 4
 
Select Case Asc(List(x))
Case 4
   Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 131
       Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "1"
'Clan Chieftain
Case 3
   Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 132
       Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "2"
'Clan Leader
Case 2
   Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 130
       Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "3"
'Clan Member
Case 1
   Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 129
       Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "4"
'Member thats been in clan for over a week
Case 0
   Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 128
       Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "4"
'Member thats been in clan under a week


       
       Case Else
           Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).SmallIcon = 128
               Form1.LvClan.ListItems(Form1.LvClan.ListItems.Count).Add , , "4"
       End Select
       Case Else
       End Select
       End If
 Next x

Form1.LvClan.Refresh
End Function


It doesnt add the 4 for Peons... I know that it sorts it by Numerical Numbers... Do you see a flaw in the code?

Stealth

Sub AddMember(ByVal Name As String, Rank As Integer, Online As Integer)
   
   If Rank = 0 Then Rank = 1
   If Rank > 4 Then Rank = 5 '// handle bad ranks
   
   '// add user
   
   With lvClan
       .ListItems.Add lvClan.ListItems.Count + 1, , Name, , Rank
       .ListItems(.ListItems.Count).ListSubItems.Add , , , Online + 6
       .ListItems(.ListItems.Count).ListSubItems.Add , , Rank
       .SortKey = 2
       .SortOrder = lvwDescending
       .Sorted = True
   End With
   
End Sub
- Stealth
Author of StealthBot

GoSuGaMING

Quote from: Stealth on June 28, 2004, 06:56 PM
Sub AddMember(ByVal Name As String, Rank As Integer, Online As Integer)
   
   If Rank = 0 Then Rank = 1
   If Rank > 4 Then Rank = 5 '// handle bad ranks
   
   '// add user
   
   With lvClan
       .ListItems.Add lvClan.ListItems.Count + 1, , Name, , Rank
       .ListItems(.ListItems.Count).ListSubItems.Add , , , Online + 6
       .ListItems(.ListItems.Count).ListSubItems.Add , , Rank
       .SortKey = 2
       .SortOrder = lvwDescending
       .Sorted = True
   End With
   
End Sub


If i use your code i will never learn.. help me with mine if you would :X

BaDDBLooD

#8
Quote from: MoNeY on June 29, 2004, 12:30 AM
the code you posted wasnt yours >.< it was from Void Bot Source

I'm not surprised

Anyways, Maybe if you Instant Messaged Or Private Messaged stealth and asked him to explain how to use the Listview's Sort Property, he would explain it to you.

Otherwise you could post in the Visual Basic section of this forum; under the topic "Sorting listview items".
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Tuberload

Or here's a revolutionary idea: rtfm...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

BaDDBLooD

There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Eli_1

#11
Quote from: BaDDBLooD on June 29, 2004, 07:53 AM
Quote from: MoNeY on June 29, 2004, 12:30 AM
the code you posted wasnt yours >.< it was from Void Bot Source
Anyways, Maybe if you Instant Messaged Or Private Messaged stealth and asked him to explain how to use the Listview's Sort Property, he would explain it to you.

The ListView's sort feature is self-explanitory, as are most VB things.

Edit:
Whew, this is my first post in this forum in a little while - feels wierd. :P

GoSuGaMING

Quote from: BaDDBLooD on June 29, 2004, 07:53 AM
Quote from: MoNeY on June 29, 2004, 12:30 AM
the code you posted wasnt yours >.< it was from Void Bot Source

I'm not surprised

Anyways, Maybe if you Instant Messaged Or Private Messaged stealth and asked him to explain how to use the Listview's Sort Property, he would explain it to you.

Otherwise you could post in the Visual Basic section of this forum; under the topic "Sorting listview items".

I know the method for it... stop posting stupid shit... better yet dont try to help me... you never can or do so ignore my threads ... k thnx

Tuberload

Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

GoSuGaMING

#14
Quote from: Tuberload on June 29, 2004, 05:01 PM
Quote from: BaDDBLooD on June 29, 2004, 04:47 PM
rtfm?

read the f*cking manual

MSDN is better


The problem right now is that its not recgonizing my &H0 case