Valhalla Legends Forums Archive | Battle.net Bot Development | Wildcards and Ip bans

AuthorMessageTime
Gangz
:'( 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
October 15, 2003, 7:30 AM
Gangz
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
October 15, 2003, 8:41 AM
WiLD
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
[code]
If Form1.chkIPBan = vbChecked And Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
[/code]
if you want it to ALWAYS be on just remove the "Form1.chkIPBan = vbChecked And" so it looks like this;
[code]
If Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
[/code]
Quiet easy, but we all have to start somewhere.
October 15, 2003, 9:18 AM
Gangz
tHNX WILd
October 15, 2003, 6:55 PM
St0rm.iD
You have to squelch them first.
October 15, 2003, 7:00 PM
Kp
[quote author=WiLD link=board=17;threadid=3097;start=0#msg24234 date=1066209510]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
[code]
If Form1.chkIPBan = vbChecked And Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
[/code]
if you want it to ALWAYS be on just remove the "Form1.chkIPBan = vbChecked And" so it looks like this;
[code]
If Flags = &H20 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
[/code][/quote]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.
October 15, 2003, 8:00 PM
Gangz
Interesting KP..So are you saying that anyone with a botplug on would slip through the ip ban that Wild has produced?
October 15, 2003, 8:54 PM
iago
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)
October 15, 2003, 9:24 PM
Gangz
See this is where the problem is...I dont understand how to make it identify the proper flags...Sorry im kinda new to this...
October 15, 2003, 9:30 PM
Soul Taker
Check http://www.valhallalegends.com/arta/docs/flags.txt it explains such things.
October 15, 2003, 9:37 PM
Gangz
If (BattleNetFlag And FlagValue) = 0x30 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
would that be correct?
October 15, 2003, 9:43 PM
SNiFFeR
[code]
If Flags = &H20 And Flags = &H30 Then ' Flags is already declared when you are using CleanSlatebot2.
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
[/code]

I suppose that'd work, It depends how you setup your flags though. The flags could be 48 and 32.
October 15, 2003, 9:47 PM
iago
[quote author=Gangz link=board=17;threadid=3097;start=0#msg24285 date=1066254195]
If (BattleNetFlag And FlagValue) = 0x30 Then
CleanSlateBot2.Send "/ban " & Username & " IP Banned"
End If
would that be correct?
[/quote]

Nope.

First, you can't use 0x in VB
Second, just say:
if(UserFlag and 0x20) then
...

October 15, 2003, 9:55 PM
Gangz
thanks iago ill give it a try..If anyone can help with cards please post..thanks
October 15, 2003, 10:03 PM
Gangz
hrm..Thanks sniff i think that might work and be a little bit easier :P
October 15, 2003, 10:06 PM
Myndfyr
For example (sorry I'm using C#), I have an enumeration set up for flags.

[code]
[Flags]
public enum UserFlags
{
Blizzard = 0x01,
Moderator = 0x02,
Speaker = 0x04,
BnetAdmin = 0x08,
Squelched = 0x20,
Guest = 0x40
}
[/code]
Then I use bitwise operators to check for concurrency. In C#, the | operator is OR, & operator is AND, ! is NOT, and ^ is XOR.
[code]
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);
[/code]

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!
October 15, 2003, 11:34 PM
Gangz
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!!
October 16, 2003, 12:49 AM

Search