Valhalla Legends Forums Archive | Battle.net Bot Development | When Ops joins, it doesn't give him Ops icon. (Using CSB)

AuthorMessageTime
the_lord_mephy
Topic.. It will give him ops icon if I join a channel where he is already ops, but not if he joins after me. This is my code:


Public Function GetIconCode(Optional ByVal Client As String, Optional ByVal Flags As Long, Optional ByVal SS As String) As Integer
Dim Code As Integer
Dim pA() As String
Dim Spawn As Integer
Dim stats As Boolean
On Error GoTo GetIconCode_Error
If Len(Client) > 4 Then stats = True
If Len(Client) <> 0 Then
Statstring = Client

    If (BNFLAGS_BLIZZ And Flags) = BNFLAGS_BLIZZ Then
        GetIconCode = ICON_BLIZZ
        Exit Function
    ElseIf (BNFLAGS_OP And Flags) = BNFLAGS_OP Then
        GetIconCode = ICON_GAVEL
        Exit Function
    ElseIf (BNFLAGS_SYSOP And Flags) = BNFLAGS_SYSOP Then
        GetIconCode = ICON_SYSOP
        Exit Function
    ElseIf (BNFLAGS_SQUELCH And Flags) = BNFLAGS_SQUELCH Then
        GetIconCode = ICON_SQUELCH
        Exit Function
    ElseIf (BNFLAGS_GLASSES And Flags) = BNFLAGS_GLASSES Then
        GetIconCode = ICON_GLASSES
        Exit Function
  ElseIf Flags = 48 Or Flags = 32 Then
        GetIconCode = ICON_SQUELCH
        Exit Function
    ElseIf Flags = 0 Then: GoTo Product
    End If
   
Product:
Select Case Mid(Client, 1, 4)
  Case "CHAT"
      Code = ICON_CHAT
  Case "STAR"
    Code = ICON_STAR
  Case "JSTR"
      Code = ICON_JSTR
  Case "SSHR"
      Code = ICON_SSHR
  Case "WAR3"
      Code = ICON_3RAW
  Case "D2DV"
      Code = ICON_D2DV
  Case "DSHR"
      Code = ICON_DSHR
  Case "D2XP"
      Code = ICON_D2XP
  Case "W2BN"
      Code = ICON_W2BN
  Case "SEXP"
      Code = ICON_SEXP
  Case "W3XP"
      Code = ICON_WAR3XP
  Case "DRTL"
      Code = ICON_DRTL
End Select
End If
GetIconCode = Code
Exit Function
GetIconCode_Error:

End Function



and this is in _UserJoins sub

Dim Icon As Integer
Icon = GetIconCode(Product, Flags)
Dim lagicoN As Integer
lagicoN = GetLagIcon(Ping, Flags)

If Icon = ICON_GAVEL Then
    AddChat vbBlue, "[" & Time & "]: A mod has joined the channel."
  With Form1.Listview1.ListItems.Add(1, , Username, , Icon)

    .ListSubItems.Add , , , lagicoN
    End With
End If

If Icon <> ICON_GAVEL Then
    With Form1.Listview1.ListItems.Add(, , Username, , Icon)
    .ListSubItems.Add , , , lagicoN
    End With
End If


The code above is also in the UserInChannel sub. But for _UserInChannel, Ops has Flags: 2 .  and when an Op joins he has Flags: 0
August 18, 2005, 3:10 AM
R.a.B.B.i.T
Is that icon in your imagelist?
August 18, 2005, 3:58 AM
the_lord_mephy
yes because when I join a channel where there is already an Op, he gets the Op flag. It has to do with Flags because in the user inchannel sub i put:
AddChat vbWhite, Username & " " & Flags
and in the userjoins sub i put:
AddChat vbWhite, Username & " " & Flags

for UserInChannel, Ops has Flags 2 and everyone else has flags 0
for UserJoins, Everyone has flags 0
August 18, 2005, 3:00 PM
l2k-Shadow
There should be something like UserFlags sub which you need to use, Battle.net sends UserFlags whenever you join a channel or whenever someone joins the channel you're currently in. You should receive the correct flags for users in this sub. Why would Battle.net choose to send another packet instead of just using UserJoins for correct flags? Who knows, Battle.net just sucks...  :-\
August 18, 2005, 3:35 PM
the_lord_mephy
I agree, I think it's kinda weird. Do you think it could be CSB is reading them wrong or something? It doesn't make sense for Bnet to send the wrong packet
[Edit]
There's no UserFlags Sub it's just:
Private Sub CleanSlateBot1_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)
and

Private Sub CleanSlateBot1_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)
August 18, 2005, 3:46 PM
KkBlazekK
Yes, there is a flag update.  You will get a user join message, and then you will get the flag update after.  You're just not handling it because you can't find it.
August 18, 2005, 4:40 PM
the_lord_mephy
How would I go about finding it :-\ Edit  ooh i think i got it, nevermind. I'll post again if i need anymore help. Thanks
August 18, 2005, 6:42 PM
l2k-Shadow
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)
August 18, 2005, 7:47 PM
bethra
[quote author=l2k-Shadow link=topic=12552.msg124645#msg124645 date=1124394472]
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)
[/quote]

Quote For Truth!
August 18, 2005, 8:40 PM
Lead
On Flags update have it check the channel list for people with the flags 2 or 18 and then readd them to the userlist with the gavel icon.
August 21, 2005, 5:23 AM
Quarantine
Battle.net does this incase a user gets designated in the channel or someone gets squelched or promoted in permissions, you wouldn't want to send a join packet for that.

Sorry if I misread sorta skimmed over it.
August 21, 2005, 5:38 AM
the_lord_mephy
[quote author=Sorc.Polgara link=topic=12552.msg124646#msg124646 date=1124397606]
[quote author=l2k-Shadow link=topic=12552.msg124645#msg124645 date=1124394472]
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)
[/quote]

Quote For Truth!
[/quote]
Hehe, Best and brightest of the bottom of the barrel  :P
[quote author=Lead link=topic=12552.msg124834#msg124834 date=1124601829]
On Flags update have it check the channel list for people with the flags 2 or 18 and then readd them to the userlist with the gavel icon.
[/quote]
Yep, thanks that's what I did.

PS: Sorry for bumping old topic, I haven't checked on this thread in a few days
August 24, 2005, 11:44 PM
Myndfyr
You shouldn't store data like a user's flags within the ListView.
August 25, 2005, 1:12 AM
the_lord_mephy
Why not? How else would I have a channel list?
August 27, 2005, 1:03 AM
Newby
[quote author=l2k-Shadow link=topic=12552.msg124645#msg124645 date=1124394472]
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)
[/quote]

Uh, I'm nearly 100% positive that code is leeched.

Please tell me you are being sarcastic...
August 27, 2005, 1:11 AM
R.a.B.B.i.T
[quote author=the_lord_mephy link=topic=12552.msg125606#msg125606 date=1125104610]
Why not? How else would I have a channel list?
[/quote]A ListView should only be used for displaying data, not storing.  I'd suggest you create a type and then an array of that type to store all the data for users in a given channel.
August 27, 2005, 2:46 AM

Search