Valhalla Legends Forums Archive | Battle.net Bot Development | Icon Troubles

AuthorMessageTime
Death-Merchant
For some reason when I squelch someone then unsquelch them all the icons and lab bars disapear and the icon turns to unknown. Anyway to fix this? I'm working with VB.
September 17, 2003, 2:50 AM
Spht
[quote author=Death-Merchant link=board=17;threadid=2730;start=0#msg21492 date=1063767031]
For some reason when I squelch someone then unsquelch them all the icons and lab bars disapear and the icon turns to unknown. Anyway to fix this? I'm working with VB.
[/quote]

Paste some code.
September 17, 2003, 2:51 AM
iago
put [code ] and [/code ] tags around your code, please.
September 17, 2003, 3:36 AM
Death-Merchant
This is my ChangeFlags

[code]
Public Function ChangeFlags(Flags As String)
On Error Resume Next
Dim Code As Integer
If Flags = "2" Then
Code = ICON_GAVEL
ElseIf Flags = "32" Then
Code = ICON_IGNORE
ElseIf Flags = "1" Then
Code = ICON_BLIZZ
ElseIf Flags = "4" Then
Code = ICON_MEGA
Else
Code = ICON_QUES
End If
ChangeFlags = Code
End Function[/code]

GetIconCode

[code]Public Function GetIconCode(Client As String, Optional Flags As String) As Integer
On Error Resume Next
Dim Code As Integer
Select Case Client
Case "[CHAT]": Code = ICON_CHAT
Case "[DRTL]": Code = ICON_DRTL
Case "[DSHR]": Code = ICON_DSHR
Case "[D2XP]": Code = ICON_D2XP
Case "[STAR]": Code = ICON_STAR
Case "[SEXP]": Code = ICON_SEXP
Case "[SSHR]": Code = ICON_SSHR
Case "[W2BN]": Code = ICON_W2BN
Case "[D2DV]": Code = ICON_D2DV
Case "[JSTR]": Code = ICON_JSTR
Case "[BRX]": Code = ICON_IGNORE
Case "[WAR3]": Code = ICON_WAR3
Case "[W3XP]": Code = ICON_W3XP

Case Else: Code = ICON_QUES
End Select
If Flags = "2" Then Code = ICON_GAVEL
If Flags = "18" Then Code = ICON_GAVEL
If Flags = "32" Then Code = ICON_IGNORE
If Flags = "1" Then Code = ICON_BLIZZ
If Flags = "4" Then Code = ICON_MEGA
GetIconCode = Code
End Function[/code]

And this is my Event_Flags()

[code]Public Sub Event_Flags(strUser, strFlag)

Dim newicon As Integer
newicon = ChangeFlags(strFlag)

Dim i As Integer
On Error Resume Next


For i = 0 To frmBot.ChannelUsers.ListItems.Count
If frmBot.ChannelUsers.ListItems(i) = "" Then
GoTo hi
End If
If frmBot.ChannelUsers.ListItems(i).Text = strUser Then
If strFlag = "0000" Then
If frmBot.ChannelUsers.ListItems(i).SmallIcon = ICON_IGNORE Then GoTo muaha
Exit Sub
End If
If strFlag = "0010" Then
If frmBot.ChannelUsers.ListItems(i).SmallIcon = ICON_IGNORE Then GoTo muaha
Exit Sub
End If
muaha:
frmBot.ChannelUsers.ListItems.Remove (i)
Exit For
End If
hi:
Next i
frmBot.ChannelUsers.ListItems.Add (i), , strUser, , newicon
End Sub[/code]
September 17, 2003, 4:00 AM
Skywing
You should be using the And operator and not the = operator. To do this you should probably convert the flags to a Long value and do tests on integral constants, not string constants.
September 17, 2003, 5:41 AM
Camel
[quote author=Skywing link=board=17;threadid=2730;start=0#msg21501 date=1063777318]
You should be using the And operator and not the = operator. To do this you should probably convert the flags to a Long value and do tests on integral constants, not string constants.
[/quote]

Someone should write a hack for YaBB that finds this sort of thing automaticly -- for example, search for "if flags = " -- and highlights it with a link to an explanation of why it's wrong. ;D
September 17, 2003, 5:47 AM
BlazingKnight
Nice help Camel.
September 17, 2003, 10:44 PM

Search