Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: BaDDBLooD on August 10, 2004, 11:43 PM

Title: 0x0F ON FLAGS Event help
Post by: BaDDBLooD on August 10, 2004, 11:43 PM


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!
Title: Re:0x0F ON FLAGS Event help
Post by: Zorm on August 10, 2004, 11:52 PM
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.
Title: Re:0x0F ON FLAGS Event help
Post by: BaDDBLooD on August 11, 2004, 12:21 AM
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.
Title: Re:0x0F ON FLAGS Event help
Post by: 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.
Title: Re:0x0F ON FLAGS Event help
Post by: BaDDBLooD on August 11, 2004, 01:08 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.

Thanks alot kane, i'll be sure to add support for that!
Title: Re:0x0F ON FLAGS Event help
Post by: 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.
Title: Re:0x0F ON FLAGS Event help
Post by: Soul Taker on August 13, 2004, 08:53 PM
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