• Welcome to Valhalla Legends Archive.
 

Add Lag Images?

Started by Vernors, January 25, 2005, 12:09 PM

Previous topic - Next topic

Kp

Yes, most of us have the numbers.  You could just look at how Blizzard's client does it if you want to be fully compatible.  I'll go ahead and mention that your range for 1green is wrong. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Vernors

Quote from: Kp on January 27, 2005, 08:34 PM
Yes, most of us have the numbers.  You could just look at how Blizzard's client does it if you want to be fully compatible.  I'll go ahead and mention that your range for 1green is wrong. :)


Well thanks for the hint, but.. how would I look at how blizzards client did it? See, at least I am trying -_-, but I am not trying hard enough would I look at it by like joining 1000+ channels comparing pings?(Probably not was just guessing...) But how would I? Would it be in a file somewhere? At least maybe give me a hint on as to where I could look..

tA-Kane

Quote from: Vernors on January 27, 2005, 09:40 PMWell thanks for the hint, but.. how would I look at how blizzards client did it? See, at least I am trying -_-, but I am not trying hard enough would I look at it by like joining 1000+ channels comparing pings?(Probably not was just guessing...) But how would I? Would it be in a file somewhere? At least maybe give me a hint on as to where I could look..
You would have to disassemble Blizzard's clients, which isn't exactly an easy feat.

You've got a good idea (though not exactly the most efficient) start of an idea with joining 1000+ channels and comparing pings, but there's just one problem with that: your ping does not change when you join different channels.

You could connect 1000+ times, with an incrementing sleep() just before you reply to your first 0x25, but that could take quite a long time especially if you got IP banned for connecting too many times in a short period of time.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Vernors

#18
Ok, I think I have an idea on how it would all go after just thinking about it and joining like 30-40 channels viewing their pings. How is this?


Function GetPing(ByVal Username As String, ByVal Ping As Long)

If Ping >= 1201 Then
strPingIcon = 22 '6Red
ElseIf Ping >= 601 Or Ping <= 1200 Then
strPingIcon = 21 '5Red
ElseIf Ping >= 401 Or Ping <= 600 Then
strPingIcon = 20 '4Yellow
ElseIf Ping >= 301 Or Ping <= 400 Then
strPingIcon = 19 '3Yellow
ElseIf Ping >= 200 Or Ping <= 300 Then
strPingIcon = 18 '2Green
ElseIf Ping >= 1 Or Ping <= 199 Then
strPingIcon = 17 '1Green
ElseIf Ping = 0 Then
strPingIcon = 23 'UDP Plug
ElseIf Ping Like "-#" Then
strPingIcon = 22 '6Red
End If
End Function


Please tell me how far off I am so I can go do it again -_-, Also will that function work properly?

Edit:

The function didn't work, I end up with everyone in the channel with all 6Reds bars. Could someone tell me also what could possibly be wrong with my function? This is how I use that function:


Private Sub CSB_UserInChannel(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, _
        ByVal Ping As Long, ByVal Product As String, Statupdate As Boolean, SimulatedEvent As Boolean)
         GetIcon Username, Product, Flags, Ping
         GetPing Username, Ping
       lvChannel.ListItems.Add(, , Username, , strProduct).ListSubItems.Add , , , strPingIcon
End Sub

Private Sub CSB_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)
Dim strTime As String
GetIcon Username, Product, Flags, Ping
          GetPing Username, Ping
    strTime = "<" & Time & ">"
    AddChat Grey, strTime & " ", vbRed, Username & Space(1) & "With a ping of:" & Space(1) & Ping & "ms", _
            vbGreen, " has joined the channel using " & Message
       lvChannel.ListItems.Add(, , Username, , strProduct).ListSubItems.Add , , , strPingIcon
End Sub

Vernors

Ok, I got it all figured out now thanks.

MyndFyre

Quote from: Vernors on January 28, 2005, 10:15 PM
Ok, I got it all figured out now thanks.

And you're not going to share your newly-garnered knowledge?  Hypocrite.
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.

Vernors

Quote from: MyndFyre on January 29, 2005, 04:44 AM
Quote from: Vernors on January 28, 2005, 10:15 PM
Ok, I got it all figured out now thanks.

And you're not going to share your newly-garnered knowledge?  Hypocrite.

Lol, sorry. All I did was changed this from:


Function GetPing(ByVal Username As String, ByVal Ping As Long)

If Ping >= 1201 Then
strPingIcon = 22 '6Red
ElseIf Ping >= 601 Or Ping <= 1200 Then
strPingIcon = 21 '5Red
ElseIf Ping >= 401 Or Ping <= 600 Then
strPingIcon = 20 '4Yellow
ElseIf Ping >= 301 Or Ping <= 400 Then
strPingIcon = 19 '3Yellow
ElseIf Ping >= 200 Or Ping <= 300 Then
strPingIcon = 18 '2Green
ElseIf Ping >= 1 Or Ping <= 199 Then
strPingIcon = 17 '1Green
ElseIf Ping = 0 Then
strPingIcon = 23 'UDP Plug
ElseIf Ping Like "-#" Then
strPingIcon = 22 '6Red
End If
End Function


To:


Function GetPing(ByVal Username As String, ByVal Ping As Long)

If Ping >= 1201 Then
strPingIcon = 22 '6Red
ElseIf Ping >= 601 Or Ping = 1200 Then
strPingIcon = 21 '5Red
ElseIf Ping >= 401 Or Ping = 600 Then
strPingIcon = 20 '4Yellow
ElseIf Ping >= 301 Or Ping = 400 Then
strPingIcon = 19 '3Yellow
ElseIf Ping >= 200 Or Ping = 300 Then
strPingIcon = 18 '2Green
ElseIf Ping >= 1 Or Ping = 199 Then
strPingIcon = 17 '1Green
ElseIf Ping = 0 Then
strPingIcon = 23 'UDP Plug
ElseIf Ping Like "-#" Then
strPingIcon = 22 '6Red
End If
End Function


And the function worked and it added the users to the channel with the right ping icon and everything. Thanks for the help everyone.

Joe[x86]

#22
Eww Eww Eww!

First, don't use function if its not going to return something (use Sub).
Second, use Select Case for more than one ElseIf.
Third, UCase the product incase it gets passed wrong. Shouldn't happen, but it could.
Fourth, use Public or Private scope declarations.

Public Sub AddUserToChannel(Username As String, Product As String, Flags As Long, Ping As Long)
    Select Case UCase(Product)
        Case "STAR"
            frmMain.lvChannel.ListItems.Add , , Username, , 6
        Case "SEXP"
            frmMain.lvChannel.ListItems.Add , , Username, , 9
        Case "D2DV"
            frmMain.lvChannel.ListItems.Add , , Username, , 5
        Case "D2XP"
            frmMain.lvChannel.ListItems.Add , , Username, , 13
        Case "W2BN"
            frmMain.lvChannel.ListItems.Add , , Username, , 10
        Case "WAR3"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case "W3XP"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case "CHAT"
            frmMain.lvChannel.ListItems.Add , , Username, , 2
        Case "DRTL"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case "DSHR"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case "JSTR"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case "SSHR"
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
        Case Else
            frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    End Select
End Sub


Public Function GetIconCode(Flags As Long, Ping As Long) As Integer

    If Flags And 1 Then
        'TODO: Insert "GetIconCode = " and a number for a Blizzard Rep Icon.
    End If
   
    If Flags And 2 Then
        'TODO: Insert "GetIconCode = " and a number for a Hammer Icon.
    End If
   
    If Flags And 4 Then
        'TODO: Insert "GetIconCode = " and a number for a Megaphone Icon.
    End If
   
    If Flags And 8 Then
        'TODO: Insert "GetIconCode = " and a number for a Admin Icon.
    End If
   
    If Flags And 16 Then
        'TODO: Insert "GetIconCode = " and a number for a UDP Plug Icon.
    End If
   
    If Flags And 32 Then
        'TODO: Insert "GetIconCode = " and a number for a Squelched Icon.
    End If
   
    If GetIconCode <> "" Then Exit Sub
   
    If Ping >= 1201 Then
        GetIconCode = 22 '6 Red
    End If
   
    If Ping >= 601 And Ping <= 1200 Then
        GetIconCode = 21 '5 Red
    End If
   
    If Ping >= 401 And Ping <= 600 Then
        GetIconCode = 20 '4 Yellow
    End If
   
    If Ping >= 301 And Ping <= 400 Then
        GetIconCode = 19 '3 Yellow
    End If
   
    If Ping >= 200 And Ping <= 300 Then
        GetIconCode = 18 '2 Green
    End If
   
    If Ping >= 1 And Ping <= 199 Then
        GetIconCode = 17 '1 Green
    End If
   
    If Ping = 0 Or Ping = -1 Then
        'TODO: Insert "GetIconCode = " and a number for a Spoof Icon.
    End If
   
End Function
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.