• Welcome to Valhalla Legends Archive.
 

CSB_FlagsUpate..?

Started by Vernors, January 29, 2005, 01:03 PM

Previous topic - Next topic

Vernors

Ok, I am wondering what the heck I do under this sub exactly.. I know it's for when like a user in the channel gains/loses ops and a user is squelched/unsquelched, but what exactly do I do here?..

CrAz3D

If you are usign a user list that shows users that are ignore/have ops differently than regular users (ie: the hammer icon for the user with ops)... this tells you WHEN they gain ops so you can change your information (ie: that user's icon)
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Vernors

Quote from: CrAz3D on January 29, 2005, 01:53 PM
If you are usign a user list that shows users that are ignore/have ops differently than regular users (ie: the hammer icon for the user with ops)... this tells you WHEN they gain ops so you can change your information (ie: that user's icon)

What exactly do you mean? Could you maybe give an example because I kinda know what your talking about, but then again I don't...

Falcon[anti-yL]

Users with the hammer icon next to their name in the channel have the flags 0x02, flagupdate tells you when an ops or squelched user enters the channel so that you could change the icon for it to distinguish it from the others. You can find all the b.net flags on bnetdocs.
http://bnetdocs.valhallalegends.com/content.php?Section=d&id=1

Vernors

#4
Erm, I am using CSB for right now.. Will not be using it once I get the hang of VB and stuff. So how would I do it in CSB?

CrAz3D

This is basically what happens when you are sitting in a channel & another user gains ops.

Bnet says "hey, User3 over there just got ops!".  Then you are like "ok!, I'll update my channel list accordingly".  So now you change User3's user icon by checking his flags (the same way you did it when you added him to the list the first time)
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Joe[x86]

Basically, you take username and find them on the userlist, or to be more specific, their index (<-- Hint Hint). Then you change that list item's icon to a hammer (or whatever else their flags are at now.)
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Vernors

So.. Since I am not at home would it be something like..

Private Sub CSB_FlagsUpdate(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
Dim strTime As String, strUser As String
strTime = "<" & Time & ">"

If Flags = 2 Then 'Has ops
lvChannel.FindItem(Username).SmallIcon = 1
AddChat, Grey, strTime, _
vbRed, "Bot", vbWhite, ": ", _
vbBlue, Username & " has just gained ops."
End If

If Flags = 32 Or Flags = 34 ' 32 Squelched User, 34 Squelched Ops
lvChannel.FindItem(Username).SmallIcon = 16
End If
End Sub


Would it be anything like that?

CrAz3D

Looks like it might work.

The Flags = 2 kinda thing, that seems to be a no no for alot of people here, you might want to try If Flags And &h2.  ;) <3!



Did you test it out?...
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Vernors

Quote from: CrAz3D on January 30, 2005, 12:17 PM
Did you test it out?...


Not yet I am not at home. I will be in like 5-10mins, I will test it then and edit this post and say.

shout

What diffrence would it of made if you made the post 5-10 minutes later than you did?

Mephisto

Flag = 2 is unlikely to work.  I'm assuming VB uses '=' as its comparison operator, so that conditional would only pass if Flags is in fact 2.  Since a user is likely to have additional flags than 0x02, you'll want to use the & operator (or And in VB).  Given the example: if Flags And &H2 would mask out all of the flags (or values) in the data Flags except for &H2 and if they have &H2 it will be true, otherwise it'll be false because everything will be masked out.

Vernors

Quote from: shout on January 30, 2005, 02:25 PM
What diffrence would it of made if you made the post 5-10 minutes later than you did?

I don't know. Lol, I wasn't really thinking.. But..


Private Sub CSB_FlagsUpdate(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
Dim strTime As String, strUser As String
strTime = "<" & Time & ">"

If Flags And &H2 Then 'Has ops
lvChannel.FindItem(Username).SmallIcon = 1
AddChat , Grey, strTime, _
vbRed, "Bot", vbWhite, ": ", _
vbBlue, Username & " has just gained ops."
End If

If Flags = 32 Or Flags = 34 Then ' 32 Squelched User, 34 Squelched Ops
lvChannel.FindItem(Username).SmallIcon = 16
End If
End Sub


Does work, however when I join a channel, lets say it was op myaccount I got ops, but if there was someone in that channel and I joined I gained ops but I stay in my position and not goto the top of the channel list. How would I make so I do? Also, when I squelch someone they do get their product replaced with the "big red X" but when I unsquelch them it stays there, how would I make it go back to their regular product?

Mephisto

Stop using operator = to check for flags.  What if it's a squelched operator w/ a UDP plug?  It's not going to equal that number anymore.  Use the bitwise & operator (And in VB) and the flags you want to check for.  Also, 0x32 is not squelched, it's 0x20.

Vernors

Quote from: Mephisto on January 30, 2005, 02:39 PM
Also, 0x32 is not squelched, it's 0x20.

Then tell me, how come when I squelch a user with flags of 0 their flags turn to 32? I would like to know. Also when I squelch an ops with flags of 2 their flags turn to 34?