Valhalla Legends Forums Archive | Battle.net Bot Development | More ping help

AuthorMessageTime
TeEhEiMaN
alright i need help with this code, no errors it just dont work, im trying to add the ping where, getpingicon is, i made the function but i suck at making them, so i need some help with it.

[code]
ElseIf Client = "PXES" Then
Form1.Channel.ListItems.Add , , UserName, , 9
Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , getpingicon
[/code]

[code]
Public Function getpingicon(ByVal Ping As Long, Optional ByVal Flags As Long) As Integer
Dim getpingicon As Integer
If Ping >= 500 Then getpingicon = 20
ElseIf Ping >= 400 Then getpingicon = 19
ElseIf Ping >= 300 Then getpingicon = 18
ElseIf Ping >= 200 Then getpingicon = 17
ElseIf Ping >= 100 Then getpingicon = 16
ElseIf Ping < 100 Then getpingicon = 15
End If
End Function
[/code]
June 20, 2004, 9:22 PM
GoSuGaMING
try something like this

[code]
If (Ping >= 5) And (Ping <= 199) Then
IconCode = ICON_LAG1
End If
If (lPing >= 200) And (Ping <= 300) Then
IconCode = ICON_LAG2
End If
If (lPing >= 301) And (Ping <= 400) Then
IconCode = ICON_LAG3
End If
If (lPing >= 401) And (Ping <= 600) Then
IconCode = ICON_LAG4
End If
If (Ping >= 601) And (Ping <= 1200) Then
IconCode = ICON_LAG5
End If
If Ping > 1201 Then
IconCode = ICON_LAG6
End If
If (Ping < 0) Then
IconCode = ICON_LAG6
End If
If (Ping = 0) Then
IconCode = 0
End If

GetPingIcon= IconCode
[/code]
June 20, 2004, 10:14 PM
TeEhEiMaN
I tryed your way but, but my problem is the varuables, im pretty sure my codeing aint correct
June 20, 2004, 10:15 PM
GoSuGaMING
[quote author=TeEhEiMaN link=board=17;threadid=7357;start=0#msg66392 date=1087769737]
I tryed your way but, but my problem is the varuables, im pretty sure my codeing aint correct
[/quote]

show me what you have so far
June 20, 2004, 10:25 PM
Soul Taker
[quote author=GoSuGaMING link=board=17;threadid=7357;start=0#msg66390 date=1087769668]
try something like this

[code]
If (Ping >= 5) And (Ping <= 199) Then
IconCode = ICON_LAG1
End If
If (lPing >= 200) And (Ping <= 300) Then
IconCode = ICON_LAG2
End If
If (lPing >= 301) And (Ping <= 400) Then
IconCode = ICON_LAG3
End If
If (lPing >= 401) And (Ping <= 600) Then
IconCode = ICON_LAG4
End If
If (Ping >= 601) And (Ping <= 1200) Then
IconCode = ICON_LAG5
End If
If Ping > 1201 Then
IconCode = ICON_LAG6
End If
If (Ping < 0) Then
IconCode = ICON_LAG6
End If
If (Ping = 0) Then
IconCode = 0
End If

GetPingIcon= IconCode
[/code]
[/quote]
What if someone has a ping of 3? No lag icon should be from 0 to 8 ms.
June 20, 2004, 10:33 PM
TeEhEiMaN
i dont need really any help on the actual getting the ping code its more getting the function to work. like

Public Function pooo()
pooo = 1

end function


Public Sub parsep()
If Client = PXES then
form1.list.add pooo
end sub

then pooo would come out to be 1. so i must be doing something wrong cause it doesnt work.
June 20, 2004, 10:51 PM
Spht
[quote author=GoSuGaMING link=board=17;threadid=7357;start=0#msg66390 date=1087769668]
try something like this

[code]
If (Ping >= 5) And (Ping <= 199) Then
IconCode = ICON_LAG1
End If
If (lPing >= 200) And (Ping <= 300) Then
IconCode = ICON_LAG2
End If
If (lPing >= 301) And (Ping <= 400) Then
IconCode = ICON_LAG3
End If
If (lPing >= 401) And (Ping <= 600) Then
IconCode = ICON_LAG4
End If
If (Ping >= 601) And (Ping <= 1200) Then
IconCode = ICON_LAG5
End If
If Ping > 1201 Then
IconCode = ICON_LAG6
End If
If (Ping < 0) Then
IconCode = ICON_LAG6
End If
If (Ping = 0) Then
IconCode = 0
End If

GetPingIcon= IconCode
[/code]
[/quote]

You're using incorrect logic there. I posted this a while back...

(ping being an unsigned long)

[code] Ping Is < 10
' No latency bars
Ping Is < 200
' ONE latency bar
Ping Is < 300
' TWO latency bars
Ping Is < 400
' THREE latency bars
Ping Is < 500
' FOUR latency bars
Ping Is < 600
' FIVE latency bars
Ping Is >= 600
' SIX latency bars[/code]
June 20, 2004, 10:53 PM
TeEhEiMaN
i can write my own ping code, i just need help with what i said on the last message
June 20, 2004, 10:56 PM
Spht
[quote author=TeEhEiMaN link=board=17;threadid=7357;start=0#msg66404 date=1087772160]
i can write my own ping code, i just need help with what i said on the last message
[/quote]

You're calling getpingcode with no parameters.

[quote author=TeEhEiMaN link=board=17;threadid=7357;start=0#msg66377 date=1087766529]
[code]
Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , getpingicon
[/code][/quote]

It should be something like... (depending on the name of your variables)

[code] Form1.Channel.ListItems.Item(Form1.Channel.ListItems.Count).ListSubItems.Add 1, , , getpingicon(Ping, Flags)[/code]
June 20, 2004, 11:05 PM
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 22, 2004, 8:50 PM

Search