:'( I have spent litterally hours triing to do ip bans and wildcards in vb if anyone can help me please reply or whisper me at Gangz@uswest. thnx much
I spent like 2 hours surfing through the Previous posts to see what i can find....As of ip bans i can make it ignore right before it bans, but I Do not understand how to make it check the flags when users join to ban it..
..as of wildcards i found the script
If Lcase(username) Like "a" Then
CleanSlateBot1.Send "/ban " & Username
I was wondering if this would work if i added it to the bans and kicks...or does "a" need to be substituted with something else...
I know im not to far from learning these commands..All help is much appreciated
Ok this is for CSB, i used it when i made a quick bot 2 hold ops and ban every1 that entered i change i took over =P
If Form1.chkIPBan = vbChecked And Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
if you want it to ALWAYS be on just remove the "Form1.chkIPBan = vbChecked And" so it looks like this;
If Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
Quiet easy, but we all have to start somewhere.
tHNX WILd
You have to squelch them first.
Quote from: WiLD on October 15, 2003, 04:18 AMOk this is for CSB, i used it when i made a quick bot 2 hold ops and ban every1 that entered i change i took over =P
If Form1.chkIPBan = vbChecked And Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
if you want it to ALWAYS be on just remove the "Form1.chkIPBan = vbChecked And" so it looks like this;
If Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
I can avoid your "IP ban" very easily simply by not sending 0x14 at logon, thus getting myself the plug. Then my flags would be 0x30 (after you squelch me). Thus, your test would fail to recognize me as IP banned. The correct way to test for squelch (as well as test for any other properties a user's flags indicate) is to use bitwise
and, not to test for equality, as you are doing.
Interesting KP..So are you saying that anyone with a botplug on would slip through the ip ban that Wild has produced?
No, he said that that code is checking flags incorrectly, since if he has a plug, his flags will be:
0x10 (Plug) | 0x20 (squelched), which is 0x30 (Plug | squelched)
See this is where the problem is...I dont understand how to make it identify the proper flags...Sorry im kinda new to this...
Check http://www.valhallalegends.com/arta/docs/flags.txt it explains such things.
If (BattleNetFlag And FlagValue) = 0x30 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
would that be correct?
If Flags = &H20 And Flags = &H30 Then ' Flags is already declared when you are using CleanSlatebot2.
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
I suppose that'd work, It depends how you setup your flags though. The flags could be 48 and 32.
Quote from: Gangz on October 15, 2003, 04:43 PM
If (BattleNetFlag And FlagValue) = 0x30 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
would that be correct?
Nope.
First, you can't use 0x in VB
Second, just say:
if(UserFlag and 0x20) then
...
thanks iago ill give it a try..If anyone can help with cards please post..thanks
hrm..Thanks sniff i think that might work and be a little bit easier :P
For example (sorry I'm using C#), I have an enumeration set up for flags.
[Flags]
public enum UserFlags
{
Blizzard = 0x01,
Moderator = 0x02,
Speaker = 0x04,
BnetAdmin = 0x08,
Squelched = 0x20,
Guest = 0x40
}
Then I use bitwise operators to check for concurrency. In C#, the | operator is OR, & operator is AND, ! is NOT, and ^ is XOR.
private void User_Joined(UserEventArgs e)
{
// e.Name is the screen name,
// e.Flags are the user's flags,
// e.Text is (currently) the user's statstring and product ID.
User u = new User(e.Name, e.Flags, e.Text);
// Here's the important part:
bool isSquelched = ((u.Flags & UserFlags.Squelched) == UserFlags.Squelched);
That last statement ANDs the user's flags with the one flag UserFlags.Squelched. The result is either 0x00 (no flags) or UserFlags.Squelched. If it's 0x00, then it does NOT equal UserFlags.Squelched, and the boolean isSquelched is assigned false; otherwise (blinding flash of the obvious) it is assigned true.
Hope this helps!
wow thanks fo the input on the ip bans..I have used all you information together and i have it figured out so it cant be bypassed form any angle and it responds quickly....=) Now..i need to learn wild cards for the perfect ops bot...thanks Again everyone!!