Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TeEhEiMaN on October 27, 2003, 12:02 PM

Title: Need help with Flags
Post by: TeEhEiMaN on October 27, 2003, 12:02 PM
Does anyone know of a good tutorial on Flags update in a Listview? and all that stuff?

VB
Title: Re:Need help with Flags
Post by: bmwrb16 on October 27, 2003, 12:55 PM
VB 6
      If (Flags And BNFLAGS_OP) = BNFLAGS_OP Then
               frmMain.lvChannel.ListItems.Remove frmMain.lvChannel.FindItem(Username).Index
               With frmMain.lvChannel.ListItems.Add(1, , Username, , ICON_GAVEL)
                   .ListSubItems.Add 1, , , GetLagIcon(Ping, Flags)
               End With
       Else
               With frmMain.lvChannel
                   .ListItems(.FindItem(Username).Index).SmallIcon = icon
               End With
       End If
Title: Re:Need help with Flags
Post by: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
Title: Re:Need help with Flags
Post by: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.
Title: Re:Need help with Flags
Post by: Tuberload on October 27, 2003, 03:11 PM
I never said the code above was incorrect. He did however ask for a tutorial, as in something to teach him, on how to make his flags work. You responded with code, which works, and I responded with a way to learn about what you posted. See the difference? How will it help him to use code he may not understand?
Title: Re:Need help with Flags
Post by: bmwrb16 on October 27, 2003, 04:28 PM
Yeah, I didn't know who you were talking to, and he can look it up on MSDN.
Title: Re:Need help with Flags
Post by: iago on October 27, 2003, 04:32 PM
Quote from: bmwrb16 on October 27, 2003, 04:28 PM
Yeah, I didn't know who you were talking to, and he can look it up on MSDN.

Stop being a jerk.  You both gave valid answers.
Title: Re:Need help with Flags
Post by: Gangz on October 27, 2003, 04:42 PM
If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill  help you
Title: Re:Need help with Flags
Post by: Adron on October 27, 2003, 05:37 PM
Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.

It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.
Title: Re:Need help with Flags
Post by: UserLoser on October 27, 2003, 05:43 PM
http://www.valhallalegends.com/arta/docs/flags.txt

Quote
      If (BattleNetFlag And FlagValue) = BattleNetFlag Then
         ' flag is set
      Else
         ' flag is not set
      End If

if the flag's set, update the icon on your listview, if not, leave it how it is
Title: Re:Need help with Flags
Post by: Etheran on October 27, 2003, 05:52 PM
Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe.  (just in case you want to look this up)
Title: Re:Need help with Flags
Post by: bmwrb16 on October 27, 2003, 08:58 PM
Quote from: Gangz on October 27, 2003, 04:42 PM
If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill  help you

He wasn't asking for help with the flags I think he meant the event.


Quote from: Adron on October 27, 2003, 05:37 PM
Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.

It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.

Well his question was kind of ambiguous so I just gave a code sample of the "flagsupdate_event".

Quote from: UserLoser on October 27, 2003, 05:43 PM
http://www.valhallalegends.com/arta/docs/flags.txt

Quote
     If (BattleNetFlag And FlagValue) = BattleNetFlag Then
        ' flag is set
     Else
        ' flag is not set
     End If

Basically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly


Quote from: Etheran on October 27, 2003, 05:52 PM
Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe.  (just in case you want to look this up)

Not really since bitmasking is different then bitwise.
Title: Re:Need help with Flags
Post by: Etheran on October 27, 2003, 09:16 PM
QuoteNot really since bitmasking is different then bitwise.
bitmasking is a bitwise function?

QuoteBasically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly
btw, you mean MY GetIconCode function.