Valhalla Legends Forums Archive | Battle.net Bot Development | 0x0F ON FLAGS Event help

AuthorMessageTime
BaDDBLooD
[code]

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

[/code]

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!
August 11, 2004, 4:43 AM
zorm
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.
August 11, 2004, 4:52 AM
BaDDBLooD
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.
August 11, 2004, 5:21 AM
tA-Kane
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.
August 11, 2004, 5:13 PM
BaDDBLooD
[quote author=tA-Kane link=board=17;threadid=8120;start=0#msg75043 date=1092244409]
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]

Thanks alot kane, i'll be sure to add support for that!
August 11, 2004, 6:08 PM
Zakath
[quote author=tA-Kane link=board=17;threadid=8120;start=0#msg75043 date=1092244409]
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]

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.
August 13, 2004, 10:06 PM
Soul Taker
[quote author=Zakath link=board=17;threadid=8120;start=0#msg75394 date=1092434760]
[quote author=tA-Kane link=board=17;threadid=8120;start=0#msg75043 date=1092244409]
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]

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]
He said third party server software for a reason :P
August 14, 2004, 1:53 AM

Search