• Welcome to Valhalla Legends Archive.
 

Ignore flag not working right

Started by Gangz, November 17, 2003, 01:47 AM

Previous topic - Next topic

Gangz

Quote
Case ID_JOIN
   If (flags And BNFLAGS_SQUELCH) <> BNFLAGS_SQUELCH Then
   Form1.Send "/ban " & Username & " Ip Ban"

Can anyone see why this does not work? I do not under stand it

Soul Taker

Because you're checking if the person ISN'T squelched.

hismajesty

#2
Quote from: Gangz on November 17, 2003, 01:47 AM
Quote
Case ID_JOIN
   If (flags And BNFLAGS_SQUELCH) <> BNFLAGS_SQUELCH Then
   Form1.Send "/ban " & Username & " Ip Ban"

Can anyone see why this does not work? I do not under stand it

As Soul Taker said, why would you ban an unsquelched user?
<> means not equal to, so you're saying if the flags the person has do not equal squelch flags..then ban them.

Gangz


Case ID_JOIN
   If (flags And BNFLAGS_SQUELCH) = BNFLAGS_SQUELCH Then Form1.Send "/ban " & Username & " Ip Ban"


Does that look right? Because all possible solutions i have tried are not working

Spht

Quote from: UserLoser. on November 17, 2003, 04:47 PM
if (0x20 and usersflags) = 0x20 then send "boo, you're banned"

so basically switch around what you have

It's the same thing.

iago

If form1.send right?

What DOES happen?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Gangz


Spht

#7
Quote from: Gangz on November 17, 2003, 05:21 PM
Nothing happens

Do this:

Case ID_JOIN
   Debug.Print "flags = " & flags
   Debug.Print "BNFLAGS_SQUELCH = " & BNFLAGS_SQUELCH
   If (flags And BNFLAGS_SQUELCH) = BNFLAGS_SQUELCH Then Form1.Send "/ban " & Username & " Ip Ban"


Then, at the top of your Form1.Send function (which takes only one parameter and since you never pasted the contents of that function, I'll use the title Message as the parameter's name for an example), do this:

   Debug.Print "Send: " & Message


Replace Message with the name of the parameter in your Form1.Send function.

Now, when a squelched user joins your channel, paste the results here (result will be in the "Immediate" debug window).

If Form1.Send is never called, then flags or BNFLAGS_SQUELCH is most likely wrong.

Gangz

wow thanks let me run this through

UserLoser.

Quote from: Spht on November 17, 2003, 05:11 PM
It's the same thing.

maybe he didn't have BNFLAGS_SQUELCH declared correctly, and also, should be &H20 :P

Spht

Quote from: UserLoser. on November 17, 2003, 05:48 PM
Quote from: Spht on November 17, 2003, 05:11 PM
It's the same thing.

maybe he didn't have BNFLAGS_SQUELCH declared correctly, and also, should be &H20 :P

Oh, that was what you were trying to accomplish. I thought you just wanted him to switch the order of And.

Gangz

#11
Case ID_JOIN
   If if (&20 and usersflags) = &20 Then Form1.Send "/ban " & Username & " Ip Ban"

Case ID_JOIN
   If (flags And BNFLAGS_SQUELCH) <> BNFLAGS_SQUELCH Then Form1.Send "/ban " & Username & " Ip Ban"

Public Sub Send(ByVal strText As String)
On Error Resume Next
With tcp
TextAdd Time & " - " & strText
strText = Mid(strText, 1, 255)
.InsertNTString strText
.sendPacket &HE
End With
End Sub


those are the codes i have tried and my send code nothing has worked so far and nothing come up on the debug[/code]

Spht


Gangz

I tried what you said and nothig changes

Spht

Quote from: Gangz on November 17, 2003, 07:37 PM
I tried what you said and nothig changes

Are you doing If (flags And BNFLAGS_SQUELCH) = BNFLAGS_SQUELCH or If (flags And BNFLAGS_SQUELCH) <> BNFLAGS_SQUELCH? In what you pasted, you were using <>.