Private Sub ChatBot_OnFlags(ByVal Username As String, ByVal Flags As Long, ByVal message As String, ByVal Ping As Long)
If (BNFLAGS_OP And Flags) = BNFLAGS_OP Then
frmMain.lstChannel.ListItems.Remove frmMain.lstChannel.FindItem(Username).Index
With frmMain.lstChannel
.ListItems.Add 1, , Username, , ChatBot.GetIconCode(message, Flags)
.ListItems(1).ListSubItems.Add , , , ChatBot.GetPingCode(Ping, Flags)
End With
AddChat vbGreen, Username & " [ " & Ping & " ms ] " & " - Flags: " & Flags & " Has acquired operator status."
End If
frmMain.lstChannel.ListItems.Item(frmMain.lstChannel.FindItem(Username).Index).SmallIcon = ChatBot.GetIconCode(message, Flags)
End Sub
Whenever i unsquelch some body, my Operator Flag even fires. I did a little debugging, and that didn't really turn out much. Any help is apreciated, i'll check back here in like 10 minutes or so. I have a few things yet to try!
This is because when you unsquelch someone bnet sends the flags again for everyone. So you might want to compare the new flags against the old flags and if they are different then make changes.
Thank you zorm, all fixed.
Incase anyone else has this problem, this is how i did it. I Just used a If statement to see if the Username they sent me was already a operator, and if they weren't, added them.
Note that I have heard of instances where you receive the flags change event where something other than the flags has changed (such as the user's statstring or in the case of third party server software, the user's ping). If you're only checking and/or changing the user's flags, then you could be missing something sometimes.
Quote from: tA-Kane on August 11, 2004, 12:13 PM
Note that I have heard of instances where you receive the flags change event where something other than the flags has changed (such as the user's statstring or in the case of third party server software, the user's ping). If you're only checking and/or changing the user's flags, then you could be missing something sometimes.
Thanks alot kane, i'll be sure to add support for that!
Quote from: tA-Kane on August 11, 2004, 12:13 PM
Note that I have heard of instances where you receive the flags change event where something other than the flags has changed (such as the user's statstring or in the case of third party server software, the user's ping). If you're only checking and/or changing the user's flags, then you could be missing something sometimes.
Ping is set on logon and should never change. Statstring changes all the time, but uses an IN CHANNEL event rather than a flags update. In fact, flags updates don't even bother to send the statstring under certain circumstances.
Have you ever seen an instance where flags were not the only thing that changed? I don't bother handling the possibility, because as far as I know it can't happen.
Quote from: Zakath on August 13, 2004, 05:06 PM
Quote from: tA-Kane on August 11, 2004, 12:13 PM
Note that I have heard of instances where you receive the flags change event where something other than the flags has changed (such as the user's statstring or in the case of third party server software, the user's ping). If you're only checking and/or changing the user's flags, then you could be missing something sometimes.
Ping is set on logon and should never change. Statstring changes all the time, but uses an IN CHANNEL event rather than a flags update. In fact, flags updates don't even bother to send the statstring under certain circumstances.
Have you ever seen an instance where flags were not the only thing that changed? I don't bother handling the possibility, because as far as I know it can't happen.
He said third party server software for a reason :P