• Welcome to Valhalla Legends Archive.
 

Help please

Started by TeEhEiMaN, June 23, 2004, 06:54 PM

Previous topic - Next topic

TeEhEiMaN

Alright this codes kinda messy, need some help with it. The problems that happen, is when it add's a ping to the user, it will add the ping twice, so 2 icons behind the username, but it only does it on a list of like 2 out 30 people. Also this code aint workin for me to well If flag = 16 Then GetLagIcon = 21, its at the bottom of the first code.





Public Function GetLagIcon(ByVal Ping As Long, Optional ByVal flag As Long) As Integer
Dim IconCode As Integer


If (Ping >= 5) And (Ping <= 199) Then
   GetLagIcon = 15
End If
If (Ping >= 200) And (Ping <= 300) Then
   GetLagIcon = 16
End If
If (Ping >= 301) And (Ping <= 400) Then
   GetLagIcon = 17
End If
If (Ping >= 401) And (Ping <= 600) Then
   GetLagIcon = 18
End If
If (Ping >= 601) And (Ping <= 1200) Then
 GetLagIcon = 19
End If
If Ping > 1201 Then
   GetLagIcon = 20
End If
If (Ping < 0) Then
   GetLagIcon = 15
End If
If flag = 16 Then
           GetLagIcon = 21
           End If
End Function




Heres the add user code,


If flag = 2 Or flag = 18 Then
       Form1.Channel.ListItems.Add 1, , UserName, , 1
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
         ElseIf Client = "PXES" Then
       Form1.Channel.ListItems.Add , , UserName, , 9
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
               ElseIf Client = "RATS" Then
       Form1.Channel.ListItems.Add , , UserName, , 6
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
               ElseIf Client = "VD2D" Then
       Form1.Channel.ListItems.Add , , UserName, , 5
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
               ElseIf Client = "NB2W" Then
       Form1.Channel.ListItems.Add , , UserName, , 10
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
               ElseIf Client = "PX2D" Then
       Form1.Channel.ListItems.Add , , UserName, , 13
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
               ElseIf Client = "3RAW" Then
       Form1.Channel.ListItems.Add , , UserName, , 61
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
         ElseIf Client = "PX3W" Then
       Form1.Channel.ListItems.Add , , UserName, , 65
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
           ElseIf Client = "TAHC" Then
       Form1.Channel.ListItems.Add , , UserName, , 2
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
           Else
       Form1.Channel.ListItems.Add , , UserName, , 12
       Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN

Blaze

I don't see where the two codes meet...
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

UserLoser.

Quote from: TeEhEiMaN on June 23, 2004, 06:54 PM
Alright this codes kinda messy, need some help with it. The problems that happen, is when it add's a ping to the user, it will add the ping twice, so 2 icons behind the username, but it only does it on a list of like 2 out 30 people. Also this code aint workin for me to well If flag = 16 Then GetLagIcon = 21, its at the bottom of the first code.


A bit of optimization:

Put

Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN

After all of those if statements.

Then in each if statement for comparing the product, something like:

TheIconIndex = Whatever the number is

And once again, at the end of all those if statements:


Form1.Channel.ListItems.Add , , UserName, , TheIconIndex