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

AuthorMessageTime
blinkdude
Any see why i get an error here with "item" from ImageList1.Item highlighted
[code]
If Ping > 0 And Ping < 200 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(4).Picture
If Ping > 201 And Ping < 300 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(5).Picture
If Ping > 301 And Ping < 400 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(6).Picture
If Ping > 401 And Ping < 500 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(7).Picture
If Ping > 501 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(8).Picture
[/code]
August 6, 2003, 9:24 PM
sPlOrYgOn
[quote author=blinkdude link=board=17;threadid=2229;start=0#msg17250 date=1060205084]
Any see why i get an error here with "item" from ImageList1.Item highlighted
[code]
If Ping > 0 And Ping < 200 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(4).Picture
If Ping > 201 And Ping < 300 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(5).Picture
If Ping > 301 And Ping < 400 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(6).Picture
If Ping > 401 And Ping < 500 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(7).Picture
If Ping > 501 Then MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(8).Picture
[/code]
[/quote]

don't u mean
MyItem.ListSubItems(1).ReportIcon
and
ImageList1.ListImages.Item(1).Picture
?
August 6, 2003, 9:47 PM
Soul Taker
Also note that no lag icon ranges from 0 to 8 ms ping times, IIRC.
August 6, 2003, 11:32 PM
Grok
[code][/code]You're also completely missing some values.
negative numbers, and 0, 200, 201, 300, 301, 400, 401, 500, 501
are all unaccounted for. Try this structure:

[code]
Select Case Ping
Case Is <= 0
picSmallIcon = 3
Case Is <= 200
picSmallIcon = 4
Case Is <= 300
picSmallIcon = 5
Case Is <= 400
picSmallIcon = 6
Case Is <= 500
picSmallIcon = 7
Case Else
picSmallIcon = 8
End Select
MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(picSmallIcon).Picture
[/code]

That is of course assuming the given is the correct syntax for loading the smallicon from an imagelist. I haven't done that in a while and it may be inaccurate.
August 7, 2003, 2:02 AM
blinkdude
OK it will run with now errors but when i connect and join a channel i get this error
[code]
Run Time 35600
Index Out Of bounds
[/code]
August 7, 2003, 4:43 AM
Maddox
If you want to keep consistency with the client, negative ping times have an icon of 6 red.

This should fix it:
[code]
Select Case Ping
Case Is < 0
picSmallIcon = 8
Case 0
picSmallIcon = 3
Case Is <= 200
picSmallIcon = 4
Case Is <= 300
picSmallIcon = 5
Case Is <= 400
picSmallIcon = 6
Case Is <= 500
picSmallIcon = 7
Case Else
picSmallIcon = 8
End Select
[/code]
August 7, 2003, 8:09 AM
Spht
[quote author=Maddox link=board=17;threadid=2229;start=0#msg17301 date=1060243759]
If you want to keep consistency with the client, negative ping times have an icon of 6 red.

This should fix it:
[code]
Select Case Ping
Case Is < 0
picSmallIcon = 8
Case 0
picSmallIcon = 3
Case Is <= 200
picSmallIcon = 4
Case Is <= 300
picSmallIcon = 5
Case Is <= 400
picSmallIcon = 6
Case Is <= 500
picSmallIcon = 7
Case Else
picSmallIcon = 8
End Select
[/code]
[/quote]

Ping 0-9 renders no icon on real game clients. Also, 10-199 is one latency bar, not 1-200 which you show. So it should look something like this:

[code]Select Case Ping
Case Is < 0, Is >= 600
' SIX latency bars
Case Is < 10
' No latency bars
Case Is < 200
' ONE latency bar
Case Is < 300
' TWO latency bars
Case Is < 400
' THREE latency bars
Case Is < 500
' FOUR latency bars
Case Is < 600
' FIVE latency bars
End Select[/code]
August 7, 2003, 4:07 PM
blinkdude
the case's are right its this code that gets the error
[code]
MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(picSmallIcon).Picture
[/code]
It says index is out of bounds
August 7, 2003, 8:35 PM
Grok
The value you are passing for 'picSmallIcon' is too high. You need to look at your image list and make sure you have a bitmap inserted for each value you wish to use.
August 7, 2003, 9:54 PM
blinkdude
oki got the values right but i get the error on this code.. ".Item" is highlighted when i gover over it when i run th e program it says this

[code]
MyItem.ListSubItems(1).SmallIcon = <index out of bouds>
[/code]
[code]
MyItem.ListSubItems(1).SmallIcon = ImageList1.Item(picSmallIcon).Picture
[/code]
August 7, 2003, 10:41 PM
Grok
Once again, the ImageList1 does not contain enough images.

For example, say the value of picSmallIcon is 8. Look in your ImageList1 and you will see the image list only goes up to some value 7 or less.
August 8, 2003, 12:40 AM

Search