Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Gangz on November 17, 2003, 01:47 AM

Title: Ignore flag not working right
Post by: 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
Title: Re:Ignore flag not working right
Post by: Soul Taker on November 17, 2003, 11:36 AM
Because you're checking if the person ISN'T squelched.
Title: Re:Ignore flag not working right
Post by: hismajesty on November 17, 2003, 01:49 PM
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.
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 03:42 PM

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
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 05:11 PM
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.
Title: Re:Ignore flag not working right
Post by: iago on November 17, 2003, 05:20 PM
If form1.send right?

What DOES happen?
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 05:21 PM
Nothing happens
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 05:29 PM
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.
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 05:46 PM
wow thanks let me run this through
Title: Re:Ignore flag not working right
Post by: 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
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 05:51 PM
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.
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 06:49 PM
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]
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 07:27 PM
Do what I said.
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 07:37 PM
I tried what you said and nothig changes
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 07:52 PM
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 <>.
Title: Re:Ignore flag not working right
Post by: Gangz on November 17, 2003, 09:16 PM
From what i gathered <> is incorrect so i changed it to =
Title: Re:Ignore flag not working right
Post by: Spht on November 17, 2003, 09:25 PM
Quote from: Gangz on November 17, 2003, 09:16 PM
From what i gathered <> is incorrect so i changed it to =

Right...

So you say nothing was displayed in the debug box? Then that means that ID_JOIN is never called, so your problem goes back further.