• Welcome to Valhalla Legends Archive.
 

When Ops joins, it doesn't give him Ops icon. (Using CSB)

Started by the_lord_mephy, August 17, 2005, 10:10 PM

Previous topic - Next topic

the_lord_mephy

Topic.. It will give him ops icon if I join a channel where he is already ops, but not if he joins after me. This is my code:


Public Function GetIconCode(Optional ByVal Client As String, Optional ByVal Flags As Long, Optional ByVal SS As String) As Integer
Dim Code As Integer
Dim pA() As String
Dim Spawn As Integer
Dim stats As Boolean
On Error GoTo GetIconCode_Error
If Len(Client) > 4 Then stats = True
If Len(Client) <> 0 Then
Statstring = Client

    If (BNFLAGS_BLIZZ And Flags) = BNFLAGS_BLIZZ Then
        GetIconCode = ICON_BLIZZ
        Exit Function
    ElseIf (BNFLAGS_OP And Flags) = BNFLAGS_OP Then
        GetIconCode = ICON_GAVEL
        Exit Function
    ElseIf (BNFLAGS_SYSOP And Flags) = BNFLAGS_SYSOP Then
        GetIconCode = ICON_SYSOP
        Exit Function
    ElseIf (BNFLAGS_SQUELCH And Flags) = BNFLAGS_SQUELCH Then
        GetIconCode = ICON_SQUELCH
        Exit Function
    ElseIf (BNFLAGS_GLASSES And Flags) = BNFLAGS_GLASSES Then
        GetIconCode = ICON_GLASSES
        Exit Function
   ElseIf Flags = 48 Or Flags = 32 Then
        GetIconCode = ICON_SQUELCH
        Exit Function
    ElseIf Flags = 0 Then: GoTo Product
    End If
   
Product:
Select Case Mid(Client, 1, 4)
  Case "CHAT"
      Code = ICON_CHAT
  Case "STAR"
     Code = ICON_STAR
  Case "JSTR"
      Code = ICON_JSTR
  Case "SSHR"
      Code = ICON_SSHR
  Case "WAR3"
      Code = ICON_3RAW
  Case "D2DV"
      Code = ICON_D2DV
  Case "DSHR"
      Code = ICON_DSHR
  Case "D2XP"
      Code = ICON_D2XP
  Case "W2BN"
      Code = ICON_W2BN
  Case "SEXP"
      Code = ICON_SEXP
  Case "W3XP"
      Code = ICON_WAR3XP
  Case "DRTL"
      Code = ICON_DRTL
End Select
End If
GetIconCode = Code
Exit Function
GetIconCode_Error:

End Function



and this is in _UserJoins sub

Dim Icon As Integer
Icon = GetIconCode(Product, Flags)
Dim lagicoN As Integer
lagicoN = GetLagIcon(Ping, Flags)

If Icon = ICON_GAVEL Then
    AddChat vbBlue, "[" & Time & "]: A mod has joined the channel."
  With Form1.Listview1.ListItems.Add(1, , Username, , Icon)

    .ListSubItems.Add , , , lagicoN
    End With
End If

If Icon <> ICON_GAVEL Then
    With Form1.Listview1.ListItems.Add(, , Username, , Icon)
    .ListSubItems.Add , , , lagicoN
    End With
End If


The code above is also in the UserInChannel sub. But for _UserInChannel, Ops has Flags: 2 .  and when an Op joins he has Flags: 0

R.a.B.B.i.T


the_lord_mephy

yes because when I join a channel where there is already an Op, he gets the Op flag. It has to do with Flags because in the user inchannel sub i put:
AddChat vbWhite, Username & " " & Flags
and in the userjoins sub i put:
AddChat vbWhite, Username & " " & Flags

for UserInChannel, Ops has Flags 2 and everyone else has flags 0
for UserJoins, Everyone has flags 0

l2k-Shadow

There should be something like UserFlags sub which you need to use, Battle.net sends UserFlags whenever you join a channel or whenever someone joins the channel you're currently in. You should receive the correct flags for users in this sub. Why would Battle.net choose to send another packet instead of just using UserJoins for correct flags? Who knows, Battle.net just sucks...  :-\
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

the_lord_mephy

#4
I agree, I think it's kinda weird. Do you think it could be CSB is reading them wrong or something? It doesn't make sense for Bnet to send the wrong packet
[Edit]
There's no UserFlags Sub it's just:
Private Sub CleanSlateBot1_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)
and

Private Sub CleanSlateBot1_UserInChannel(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)

Blaze

Yes, there is a flag update.  You will get a user join message, and then you will get the flag update after.  You're just not handling it because you can't find it.
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

the_lord_mephy

#6
How would I go about finding it :-\ Edit  ooh i think i got it, nevermind. I'll post again if i need anymore help. Thanks

l2k-Shadow

I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Sorc.Polgara

Quote from: l2k-Shadow on August 18, 2005, 02:47 PM
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)

Quote For Truth!

Lead

On Flags update have it check the channel list for people with the flags 2 or 18 and then readd them to the userlist with the gavel icon.

Warrior

Battle.net does this incase a user gets designated in the channel or someone gets squelched or promoted in permissions, you wouldn't want to send a join packet for that.

Sorry if I misread sorta skimmed over it.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

the_lord_mephy

Quote from: Sorc.Polgara on August 18, 2005, 03:40 PM
Quote from: l2k-Shadow on August 18, 2005, 02:47 PM
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)

Quote For Truth!
Hehe, Best and brightest of the bottom of the barrel  :P
Quote from: Lead on August 21, 2005, 12:23 AM
On Flags update have it check the channel list for people with the flags 2 or 18 and then readd them to the userlist with the gavel icon.
Yep, thanks that's what I did.

PS: Sorry for bumping old topic, I haven't checked on this thread in a few days

MyndFyre

You shouldn't store data like a user's flags within the ListView.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

the_lord_mephy


Newby

Quote from: l2k-Shadow on August 18, 2005, 02:47 PM
I think it's safe to say that this post marked one of the few non-retarded CSB user who actually worked with his code and didn't ask retard questions aka "code it for me." Good job. :)

Uh, I'm nearly 100% positive that code is leeched.

Please tell me you are being sarcastic...
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.