Valhalla Legends Forums Archive | Battle.net Bot Development | Help please

AuthorMessageTime
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.



[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
[/code]



Heres the add user code,

[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
[/code]
June 23, 2004, 11:54 PM
KkBlazekK
I don't see where the two codes meet...
June 24, 2004, 5:00 AM
UserLoser.
[quote author=TeEhEiMaN link=board=17;threadid=7414;start=0#msg66906 date=1088034847]
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.

[/quote]

A bit of optimization:

Put
[code]
Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , lagicoN
[/code]
After all of those if statements.

Then in each if statement for comparing the product, something like:
[code]
TheIconIndex = Whatever the number is
[/code]
And once again, at the end of all those if statements:

[code]
Form1.Channel.ListItems.Add , , UserName, , TheIconIndex
[/code]
June 24, 2004, 5:57 AM

Search