• Welcome to Valhalla Legends Archive.
 

0x0F ON FLAGS Event help

Started by BaDDBLooD, August 10, 2004, 11:43 PM

Previous topic - Next topic

BaDDBLooD



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!
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

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.
"Now, gentlemen, let us do something today which the world make talk of hereafter."
- Admiral Lord Collingwood

BaDDBLooD

#2
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.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

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.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

BaDDBLooD

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!
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Zakath

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: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Soul Taker

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