• Welcome to Valhalla Legends Archive.
 

Add Lag Images?

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

Previous topic - Next topic

Vernors

Ok, I wanna add the Product then the Username then the lag image. But I am not sure on how to do it. Here is my current code:

Function AddUserToChannel(ByVal Username As String, ByVal Product As String, ByVal flags As Long, ByVal Ping As Long)
   
    If Product = "STAR" Then
        frmMain.lvChannel.ListItems.Add , , Username, , 6
    ElseIf Product = "SEXP" Then
       frmMain.lvChannel.ListItems.Add , , Username, , 9
    ElseIf Product = "D2DV" Then
       frmMain.lvChannel.ListItems.Add , , Username, , 5
    ElseIf Product = "D2XP" Then
       frmMain.lvChannel.ListItems.Add , , Username, , 13
    ElseIf Product = "W2BN" Then
      frmMain.lvChannel.ListItems.Add , , Username, , 10
    ElseIf Product = "WAR3" Then
        frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    ElseIf Product = "W3XP" Then
        frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    ElseIf Product = "CHAT" Then
        frmMain.lvChannel.ListItems.Add , , Username, , 2
    ElseIf Product = "DRTL" Then
       frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    ElseIf Product = "DSHR" Then
       frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    ElseIf Product = "JSTR" Then
       frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    ElseIf Product = "SSHR" Then
       frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    Else
        frmMain.lvChannel.ListItems.Add , , Username 'Gotta find the image
    End If
End Function


So from that code how would I go about adding in their lag also?

Blaze

#1
Use the sublist property on the listitems. Use code Tags.

Make a second tab and call it Ping for the ping icons.

Example.

frmMain.lvChannel.ListItems.add(, , strUsername, , GetIconCode(strProduct, strFlags)).ListSubItems.add , ,strPing, GetLagIcon(intPing, strFlags), strFlags
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Vernors

How do I know exactly which ping icon to show? I am not sure on your example with functions in your example that aren't there either.

Blaze

Get Icon Code basicly checks the product and flags, and returns the client icon's for the list (Client or Operator or Squelch, ect)

Get Lag Icon uses the ping and the flags, and determines the lag icon to use, or lagplug.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Vernors

But how exactly would I get the ping and flags? Could you maybe post the 2 functions for me? Because I am not sure how it would go..

Blaze

If your using csb, it will be sent to you on UserJoin as one of the variables, if this is a regular bot, it will be sent to you in 0x0F.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Vernors

Umm, I don't think I understand. How would I know which ping icon to show? Would have to do with the Ping value? Like..

If Ping <= 100 Then
'Show 1 green icon..
ElseIf Blah Blah
'Blah Blah and so on..
End IF

Would I have to do it something sorta that way? I am kinda new to visual basics and yes I am using CSB as for my starting pad until I can the hang of VB. I will soon later switch over to WinSock, but until then I am just making a Chat Bot but I want it to show the ping as well.. I hope I am not being a bother with all this..

Kp

Quote from: Vernors on January 26, 2005, 09:31 AMUmm, I don't think I understand. How would I know which ping icon to show? Would have to do with the Ping value? Like..

Right idea, wrong constants.  Extremely low latencies cause real clients to display zero bars.  Also, due to the limitations of your language, you're going to show the wrong icon for people with extremely high (2billion+ millisecond) latencies.

Quote from: Vernors on January 26, 2005, 09:31 AMI hope I am not being a bother with all this..
Yes, but most CSB users are.  We get used to it after a while.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

MyndFyre

Quote from: Kp on January 26, 2005, 09:41 AM
Also, due to the limitations of your language, you're going to show the wrong icon for people with extremely high (2billion+ millisecond) latencies.

He *could* display the high ping icon if his latency < 0.
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

So how exactly would I do this all? I mean I could use my little idea but make just a bit better.. Or is there some specific way to make it?

hismajesty

Compare a users ping to a defined ping. If the ping is less than/equal to (or greater than) either display an image or compare to another defined ping.

Kp

Quote from: MyndFyre on January 26, 2005, 10:30 AM
Quote from: Kp on January 26, 2005, 09:41 AMAlso, due to the limitations of your language, you're going to show the wrong icon for people with extremely high (2billion+ millisecond) latencies.
He *could* display the high ping icon if his latency < 0.

Yes, he could.  However, as the code was written, fixing his constants for the other cases wouldn't have resolved that because he didn't have any handler for negative latency.  Besides which, it's just silly to store an unsigned value in a signed variable and add extra tests to compensate.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Vernors

Ok, could someone just maybe post some code that would maybe just fix this problem? I have been able to get the latency icons to show up, however I am just not sure which icon to show for each and every latency. Like 1-100 one green, 101-? two green, ect. how would I determine that?

Newby

Quote from: Vernors on January 27, 2005, 12:05 AM
Ok, could someone just maybe post some code that would maybe just fix this problem?
If you got them to show up, you don't need coding. You need numbers. :)
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Vernors

Quote from: Newby on January 27, 2005, 12:15 AM
Quote from: Vernors on January 27, 2005, 12:05 AM
Ok, could someone just maybe post some code that would maybe just fix this problem?
If you got them to show up, you don't need coding. You need numbers. :)

Your right, so does anyone  have the numbers? I mean I don't want my bots latency numbers with the icons to be different from other bots, because someone may have one green on mine but maybe two green if they were looking at their self from another bot..