Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TeEhEiMaN on June 28, 2004, 03:55 PM

Title: Ping mess up... Kinda weird
Post by: TeEhEiMaN on June 28, 2004, 03:55 PM
Alright, you can see the problem in the screen shot, it doubles up the ping, on add username. And it also doesnt add the ops ping, maybe u can see the problem.

(http://www.tee.gamershost.net/p1.JPG)

Heres the code also. and also the get plugin code isent working eiether in this code:

[Get ping code]

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

If flag = 16 Or 32 Then
           GetLagIcon = 21
           Exit Function
End If

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

         
End Function



And heres the "Here" event code.


flag = Form1.MakeLong(Mid$(Data, 9, 4))
Ping = Form1.MakeLong(Mid$(Data, 13, 4))
UserName = Decode.KillNull(Mid$(Data, 29))
Message = Decode.KillNull(Mid$(Data, Len(UserName) + 30))
Client = Left(Message, 4)
lagicoN = GetLagIcon(Ping)
   Select Case MakeLong(Mid$(Data, 5, 4))
       Case &H1 ' HERE

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
       
       
  thx, let me know


Title: Re:Ping mess up... Kinda weird
Post by: hismajesty on June 28, 2004, 04:12 PM
Also it didn't add me to the channel list!  >:(
Title: Re:Ping mess up... Kinda weird
Post by: UserLoser. on June 28, 2004, 06:00 PM
Note that milliseconds only go up to 1000, so your timestamp is providing a totally invalid time.
Title: Re:Ping mess up... Kinda weird
Post by: TeEhEiMaN on June 28, 2004, 10:04 PM
well, i can fix the time stamp... i just never noticed it =P.... ummm well does anyone know why the ping does that. It seems to stump a lot of people =P
Title: Re:Ping mess up... Kinda weird
Post by: Anubis on July 03, 2004, 01:48 PM
Quote from: TeEhEiMaN on June 28, 2004, 03:55 PM
Public Function GetLagIcon(ByVal Ping As Long, Optional ByVal flag As Long) As Integer
lagicoN = GetLagIcon(Ping)
       

It doesn't appear that you're calling the flag variable in your "Here" function/sub which always makes the falg variable be nothing, so it won't detect a lag plug. (See above)

Perhaps try something like:

lagicoN = GetLagIcon(Ping, Flags)

Just replace 'Flags' with whatever your flags variable is...

As for the double ping picture thingy, I have no clue...My bot is adding random people to it's room list 2 times when it shouldn't..heh

Hope this stuff helps,
Anubis
Title: Re:Ping mess up... Kinda weird
Post by: Lenny on July 03, 2004, 08:47 PM
Check your column sizes for your ListView (most likely ping column), it could be a repainting problem.  Perhaps the column is too large or too small.

Also: To LW-Warrior, I always thought Cows slept standing up....
Title: Re:Ping mess up... Kinda weird
Post by: GoSuGaMING on July 03, 2004, 10:09 PM
Quote from: Lenny on July 03, 2004, 08:47 PM
Check your column sizes for your ListView (most likely ping column), it could be a repainting problem.  Perhaps the column is too large or too small.

Also: To LW-Warrior, I always thought Cows slept standing up....

I fixed his problem VIA realVNC :D
Title: Re:Ping mess up... Kinda weird
Post by: Lenny on July 03, 2004, 10:36 PM
What was the solution?  The ListView Column size?
Title: Re:Ping mess up... Kinda weird
Post by: GoSuGaMING on July 03, 2004, 10:58 PM
Quote from: Lenny on July 03, 2004, 10:36 PM
What was the solution?  The ListView Column size?

I dont know his code was all messy... i totally redid it all for him :X
Title: Re:Ping mess up... Kinda weird
Post by: MyndFyre on July 04, 2004, 04:07 AM
Quote from: GoSuGaMING on July 03, 2004, 10:58 PM
Quote from: Lenny on July 03, 2004, 10:36 PM
What was the solution?  The ListView Column size?

I dont know his code was all messy... i totally redid it all for him :X

To quote Code Complete:

Quote
To fix a bug without understanding the problem is just begging for another problem to come up later.
Title: Re:Ping mess up... Kinda weird
Post by: GoSuGaMING on July 04, 2004, 11:53 AM
Quote from: Myndfyre on July 04, 2004, 04:07 AM
Quote from: GoSuGaMING on July 03, 2004, 10:58 PM
Quote from: Lenny on July 03, 2004, 10:36 PM
What was the solution?  The ListView Column size?

I dont know his code was all messy... i totally redid it all for him :X

To quote Code Complete:

Quote
To fix a bug without understanding the problem is just begging for another problem to come up later.


no, I showed him what I did... He watched me while I coded it... it has comments :X
Title: Re:Ping mess up... Kinda weird
Post by: Maddox on July 09, 2004, 03:12 PM
LEARN TO DEBUG.
Title: Re:Ping mess up... Kinda weird
Post by: MyndFyre on July 10, 2004, 01:57 PM
Quote from: GoSuGaMING on July 04, 2004, 11:53 AM
Quote from: Myndfyre on July 04, 2004, 04:07 AM
Quote from: GoSuGaMING on July 03, 2004, 10:58 PM
Quote from: Lenny on July 03, 2004, 10:36 PM
What was the solution?  The ListView Column size?

I dont know his code was all messy... i totally redid it all for him :X

To quote Code Complete:

Quote
To fix a bug without understanding the problem is just begging for another problem to come up later.


no, I showed him what I did... He watched me while I coded it... it has comments :X

So what you're saying is this....  You didn't understand the problem, so you provided a workaround?

Again I say: to fix a bug without understanding the problem is just begging for another problem to come up later.
Title: Re:Ping mess up... Kinda weird
Post by: BaDDBLooD on July 10, 2004, 02:00 PM
Very good advice, Thanks
Title: Re:Ping mess up... Kinda weird
Post by: GoSuGaMING on July 10, 2004, 07:07 PM
his code was way to messey :/ lol i didnt even wanna mess with it but i wanted to help :/