• Welcome to Valhalla Legends Archive.
 

Problem With Sweepban

Started by ChR0NiC, February 15, 2004, 05:03 PM

Previous topic - Next topic

Eli_1

I think we should just assume sweepban is another term for wildcard banning...

or it's probably for parsing the /who [channel] response to get a list of names.

In both cases it's just another word for wildcard banning, just a channel difference in the latter one...  ;)

Tuberload

Quote from: Myndfyre on February 18, 2004, 07:40 PM
Quote from: Tuberload on February 18, 2004, 07:36 PM
Maybe you should re-post it minus the code... The people at least know what's being talked about.

Hear, hear.  I'm a good enough programmer to program my own bot, thanks, but what is this concept?

How does you being a good enough programmer, have anything to do with what I said? Chronic was being hounded for deleting his post, so I offered the obvious solution of putting it back up...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

SiMi

#17
Quote from: ChR0NiC on February 18, 2004, 07:33 PM
Quote from: Myndfyre on February 17, 2004, 07:43 PM
Not only that, but now I'm pissed too because I don't get to see what the question was.  I make it a habit to keep up on things that seem interesting; "Sweep ban" caught my eye as something that might be useful.  Thanks for showing your willingness to participate.

I am sorry about that......But I posted my entire sweepban code here, and I didn't want some first time programmer who has no experience just grabbing my sweepban code and putting it in his bot...I hope you understand  :(

You seem to be having problems not even a "first time" programmer could have. You want others to help you but not others to help others? Who knows if even its your code, you seem to post a new problem here every other day. Why don't you get a clue and then come back with some positive attitude and when you do come back, make sure you auctually learn some programming. After all this is a community, you give to them and they give back to you. :)

Networks

um...anyone wanna provide some input on how to sweep and by splitting the commas because i understand that but how do u get it to go to the next comma. How about helping instead of arguing over the same damn thing.

MyndFyre

Quote from: Tuberload on February 18, 2004, 11:04 PM
Quote from: Myndfyre on February 18, 2004, 07:40 PM
Quote from: Tuberload on February 18, 2004, 07:36 PM
Maybe you should re-post it minus the code... The people at least know what's being talked about.

Hear, hear.  I'm a good enough programmer to program my own bot, thanks, but what is this concept?

How does you being a good enough programmer, have anything to do with what I said? Chronic was being hounded for deleting his post, so I offered the obvious solution of putting it back up...

My point about programming skill was to Chronic for this statement:

Quote
But I posted my entire sweepban code here, and I didn't want some first time programmer who has no experience just grabbing my sweepban code and putting it in his bot...

My point being, I don't need his code.  I would like to know what function a "Sweep ban" serves.  The point of saying "I'm a good enough programmer" meant that I could manage to figure it out without his code.
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.

Eric

#20
Quote from: Networks on February 19, 2004, 07:59 AM
um...anyone wanna provide some input on how to sweep and by splitting the commas because i understand that but how do u get it to go to the next comma. How about helping instead of arguing over the same damn thing.

However, there is no way to be 100% accurate in any "sweepban" method, I feel this would be the most effective way:
Set a timer to approximately 500 - 1500 ms, and have the timer disable itsself when time runs out. Then when you receive an EID_INFO saying "Users in channel ", enable the timer, then split up the and ban the data apon each EID_INFO data arrival until the timer runs out of time.
To determine if a user in the remote channel has operator status (Excluding Diablo II/Diablo II: Lord of Destruction, which will have [*USERNAME] / [REALMCHAR (*USERNAME), instead of [USERNAME]), do the following:
Check to see if the first character and the last character are "[" and "]".
Then check if the UCase of the username is an exact match of the username sent.
If the both are true, remove the "[" and the "]" from the user and ban.
Banning a user on Diablo II/Diablo II: Lord of Destruction is slightly different.  You're given a slight advantage, the username will have a "*" in it, allowing for more accurate parsing of the EID_INFO packet.
Seeing how there is too much room for error, and that banning users that aren't bothering you and aren't even in your channel to be able to bother you is pointless, I'd never put "sweepban" into any of my bots.

Tuberload

Quote from: Myndfyre on February 19, 2004, 09:52 AM
My point about programming skill was to Chronic for this statement:
Quote
But I posted my entire sweepban code here, and I didn't want some first time programmer who has no experience just grabbing my sweepban code and putting it in his bot...

My point being, I don't need his code.  I would like to know what function a "Sweep ban" serves.  The point of saying "I'm a good enough programmer" meant that I could manage to figure it out without his code.

Sorry for the misunderstanding. I thought you were talking directly to me, because you quoted only me. I will honestly say I don't know what Chronic means by "Sweep Ban". I can only come up with conclusions, and wouldn't mind hearing about his idea's. Who knows, someone might learn something. Myself included.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

synth

Quote from: Tuberload on February 20, 2004, 01:42 AM
Sorry for the misunderstanding. I thought you were talking directly to me, because you quoted only me. I will honestly say I don't know what Chronic means by "Sweep Ban". I can only come up with conclusions, and wouldn't mind hearing about his idea's. Who knows, someone might learn something. Myself included.

SweepBan finds the users in another specific channel and bans them all from your channel.

Networks

#23
Quote from: LoRd[nK] on February 19, 2004, 12:27 PM
Quote from: Networks on February 19, 2004, 07:59 AM
um...anyone wanna provide some input on how to sweep and by splitting the commas because i understand that but how do u get it to go to the next comma. How about helping instead of arguing over the same damn thing.

However, there is no way to be 100% accurate in any "sweepban" method, I feel this would be the most effective way:
Set a timer to approximately 500 - 1500 ms, and have the timer disable itsself when time runs out. Then when you receive an EID_INFO saying "Users in channel ", enable the timer, then split up the and ban the data apon each EID_INFO data arrival until the timer runs out of time.
To determine if a user in the remote channel has operator status (Excluding Diablo II/Diablo II: Lord of Destruction, which will have [*USERNAME] / [REALMCHAR (*USERNAME), instead of [USERNAME]), do the following:
Check to see if the first character and the last character are "[" and "]".
Then check if the UCase of the username is an exact match of the username sent.
If the both are true, remove the "[" and the "]" from the user and ban.
Banning a user on Diablo II/Diablo II: Lord of Destruction is slightly different.  You're given a slight advantage, the username will have a "*" in it, allowing for more accurate parsing of the EID_INFO packet.
Seeing how there is too much room for error, and that banning users that aren't bothering you and aren't even in your channel to be able to bother you is pointless, I'd never put "sweepban" into any of my bots.

Once again, thank you LoRd

Tuberload

Quote from: synth on February 20, 2004, 07:24 AM
Quote from: Tuberload on February 20, 2004, 01:42 AM
Sorry for the misunderstanding. I thought you were talking directly to me, because you quoted only me. I will honestly say I don't know what Chronic means by "Sweep Ban". I can only come up with conclusions, and wouldn't mind hearing about his idea's. Who knows, someone might learn something. Myself included.

SweepBan finds the users in another specific channel and bans them all from your channel.

So you set up your bot to monitor other channels, and then ban anyone who joins the bot's channel from one of the monitored channels... While I could see this being usefull in the old days of Battle.net warring, I think it would just be a waste of resources.

Quote from: Networks on February 19, 2004, 07:59 AM
um...anyone wanna provide some input on how to sweep and by splitting the commas because i understand that but how do u get it to go to the next comma. How about helping instead of arguing over the same damn thing.

How did you manage to parse the data received from battle.net in the first place, if you can't parse a list separated with commas?
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

synth

Quote from: Tuberload on February 20, 2004, 01:42 AM
So you set up your bot to monitor other channels, and then ban anyone who joins the bot's channel from one of the monitored channels... While I could see this being usefull in the old days of Battle.net warring, I think it would just be a waste of resources.

AFAIK, there are no bots that "monitor" channels.  The only ones I've seen just get the list of people in the specified channel once, then ban them in the order received.

I don't really see any particular use in this, but still the question remains how one would go about coding a sweepban.  So I'll try and answer it with what I feel is the best answer suited to the situation:

1. Get list of users.  This should give back something like this:

QuoteUsers in channel Clan Recruitment:
D3K]Recru3t, kukubenka
LoRd]ZeR0[, tourny
SaRs, Wishblade
CeLe[aC]ReC4, SiCkeN
Noreaga74@Lordaeron, shadowman22ca
WARRIORS_BLOOD, Sir_Killsalot2@Lordaeron
Rc_Su, SupleX

2. It seems that there are only 2 usernames per line in the server's return to the /who command.  So, find the length of the line (e.g., "D3K]Recru3t, kukubenka" has length 22.)

3. Find the placement of the comma.

4.  Get the string up to the placement of the comma using Left, then get the rest of the string up to the end of the string using Right.  Place those into an array.

5. Do step 4 until there are no usernames left (no comma present).

6. Ban each user with the appropriate anti-flood technique.  If you're using Visual Basic and do not have an anti-flood for your bot, I suggest the algorithm written by Adron and ported by Grok, located at:

http://botdev.valhallalegends.com/documents/vbantiflood.html


LMK if you have success or failure following this logic, if you feel that I am being unclear, or if you feel that my way isn't the best way or is incorrect, or has flawed logic.

Eli_1

#26
Quote from: synth on February 20, 2004, 01:58 PM
Quote from: Tuberload on February 20, 2004, 01:42 AM
So you set up your bot to monitor other channels, and then ban anyone who joins the bot's channel from one of the monitored channels... While I could see this being usefull in the old days of Battle.net warring, I think it would just be a waste of resources.

AFAIK, there are no bots that "monitor" channels.  The only ones I've seen just get the list of people in the specified channel once, then ban them in the order received.

I don't really see any particular use in this, but still the question remains how one would go about coding a sweepban.  So I'll try and answer it with what I feel is the best answer suited to the situation:

1. Get list of users.  This should give back something like this:

QuoteUsers in channel Clan Recruitment:
D3K]Recru3t, kukubenka
LoRd]ZeR0[, tourny
SaRs, Wishblade
CeLe[aC]ReC4, SiCkeN
Noreaga74@Lordaeron, shadowman22ca
WARRIORS_BLOOD, Sir_Killsalot2@Lordaeron
Rc_Su, SupleX

2. It seems that there are only 2 usernames per line in the server's return to the /who command.  So, find the length of the line (e.g., "D3K]Recru3t, kukubenka" has length 22.)

3. Find the placement of the comma.

4.  Get the string up to the placement of the comma using Left, then get the rest of the string up to the end of the string using Right.  Place those into an array.

5. Do step 4 until there are no usernames left (no comma present).

6. Ban each user with the appropriate anti-flood technique.  If you're using Visual Basic and do not have an anti-flood for your bot, I suggest the algorithm written by Adron and ported by Grok, located at:

http://botdev.valhallalegends.com/documents/vbantiflood.html


LMK if you have success or failure following this logic, if you feel that I am being unclear, or if you feel that my way isn't the best way or is incorrect, or has flawed logic.

or you could do something like (assuming data = /who return)


Dim Parse() as string
Parse = Split(Data, VbCrLf, 2)
data = Parse(1)
'this would remove the 'users in channel w/e'
Data = replace(data, vbcrlf, "")
data = replace(data, " ", "")
'this would leave data = to something like name1,name2,name3,name4 ect...
Parse = split(data, ",")
for i = 0 to ubound(parse)
Dim Username as string
Username = parse(i)
'...
next i


This is untested and ugly because it doesn't have the proper indents and such, but I wrote it while in the post window... bear with me :P


[Edit=Fixed a typo in my code...]

Eric

#27

Visual Basic (Keep in mind this is completely untested code):
Dim Splt() as string
Dim I as long
If Instr(Message, ", ") <> 0 Then
 Splt() = Split(Message, ", ")
Else
 Redim Preserve Splt(0)
 Splt(0) = Message
End If
For I = 0 to UBound(Splt)
     If Left(Splt(I)) = "[" And Right(Splt(I)) = "]" And StrComp(UCase(Splt(I)), Splt(I), vbTextCompare) = 0 Then Splt(I) = Splt(I) = Mid(Splt(I), 2, Len(Splt(I) - 1)
     With PBuffer
          .InsertNTString "/ban " & Splt(I) & "Sweep Ban"
          .SendPacket BNCS, &HE
     End With
Next I


In a follow up to my previous post, someone game me the idea that instead of using a timer, it would be more efficient to send some packet that the BNCS replies to when sent after the /who is sent, then you will know exactly when to disable your parsing.

Eli_1

#28
Ouput:

That user is not logged on.
Name2 was banned by OpDude
<OpDude> Sweep Ban
Name3 was banned by OpDude (Sweep Ban)
Name4 was banned by OpDude
<OpDude> Sweep Ban

ect...

(I think anyway)

Kp

Addendum to synth:

Be aware that if there are an odd number of users in channel, the last user gets a line all to himself (with no comma).  That will need to be handled, and would likely be quite easy to detect since a) there are no spaces in that message and b) it'll be the last one before your list-completion comes in.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

|