• Welcome to Valhalla Legends Archive.
 

Problem With Sweepban

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

Previous topic - Next topic

Spht

Quote from: synth on February 20, 2004, 01:58 PM
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.)

Why get the length if you never need to use it?

Quote from: synth on February 20, 2004, 01:58 PM
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.

Note this will only work if the server lists two names per message. This could change in the future to list 5 names per message (for example), or a single name. To avoid generalizing things, you should work under the logic of "each name is seperated by a comma" instead of "there are two names per message."

Quote from: synth on February 20, 2004, 01:58 PM
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.

ChR0NiC

#31
Quote from: Simi on February 19, 2004, 12:12 AM
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. :)

Ok you need to get over me, you still think I know nothing about anything.

I did write my own sweepban code

And since everyone is making such a big deal over a discontinued post, here's my sweepban code.


If InStr(Message, ", ") Then
Call SweepBan (Message)
End If

That's where I call it


Sub SweepBan(ChannelList As String)
Dim S() As String
S() = Split(ChannelList, " ")
For i = 0 To UBound(S)
If Left(S(i), 1) = "[" And Right(S(i), 1) = "]" Then
Send "/ban " & S(i) & Chr(32) & "Defense Sweep"
Send "/ban " & Mid(S(i), 2, Len(S(i)) - 2) & Chr(32) & "Defense Sweep"
End If
Else
Send "/ban " & S(i) & Chr(32) & "Defense Sweep"
End If
End If
Next i
End Sub


That is where I execute it, I noticed mine is a bit similar to Lord's...anyways can someone give me an idea on how to fix the motherf***ing code to ban the odd man out??

Edit: The reason I do "/ban " twice, is to be sure I ban the name, because the name surrounded by brackets are not always operators. Just thought I'd let you know...

Spht

Quote from: ChR0NiC on February 20, 2004, 07:21 PM
anyways can someone give me an idea on how to fix the motherf***ing code to ban the odd man out??

That's no way to treat code!

But regardless, when your bChannelScanInProgress = True, simply ban the name if no comma is in sight.

ChR0NiC

#33
Quote from: Spht on February 20, 2004, 07:29 PM
That's no way to treat code!

But regardless, when your bChannelScanInProgress = True, simply ban the name if no comma is in sight.

So I guess when I receive "Users in channel", it will be true right?
And then only split it if there is a comma. I guess I can try it.

Edit: How will I know when to end it??

SiMi

#34
omfg you just figured out how to do a L33T H4X, Congrats! :)
This is what i used a long long time ago, very long ago. Did i mention i used it a long time ago?


Private Sub info(info As String)
On Error Resume Next
If InStr(1, info, ",") Then
Dim User As Variant, UserArray() As String
UserArray = Split(info, ", ")
For Each User In UserArray
Send "/Ban " & User & " Sweep Banned"
Next User
Exit Sub
End If

on my sendchat function it checked and filtered out the other stuff that didn't get filtered out here such as the brackets etc

[Kp edit: changed quote tags to code tags.  Be warned that I am getting tired of the running battle between you and Chr0nic, Simi.  If this continues, you may both find yourselves getting deleted for flaming.  Focus on the topic at hand, not some personal vendetta.]

Eric

#35
Quote
omfg you just figured out how to do a L33T H4X, Congrats!
This is what i used a long long time ago, very long ago. Did i mention i used it a long time ago?

Quote:
Private Sub info(info As String)
On Error Resume Next
If InStr(1, info, ",") Then
Dim User As Variant, UserArray() As String
UserArray = Split(info, ", ")
For Each User In UserArray
Send "/Ban " & User & " Sweep Banned"
Next User
Exit Sub
End If


on my sendchat function it checked and filtered out the other stuff that didn't get filtered out here such as the brackets etc

What if there's no comma in the data received? Looks like your "L33T H4X" failed once again.

BTW: When adding code to the forum use the code tags not the quote tags.

Quote
So I guess when I receive "Users in channel", it will be true right?
And then only split it if there is a comma. I guess I can try it.
Edit: How will I know when to end it??
One method: Use a 500ms - 1000ms timer, enable it when you parse out "Users in channel " from EID_INFO, and disable at the end of the time. Second method: Send a packet after the /who, start the parsing of EID_INFO's and when the packet is received, you stop parsing EID_INFO's

UserLoser.

100% effective working method (for VB users):

Requirements:
BotNet connection
Custom scripting


Sub UserInChannel(Username, Flags, Message, Ping)
   LocalCommand.ProcessLocalCommand "/botnetwhisper ModeratorBot ban " & Username
End Sub


In my case, LocalCommand is the set name for my command processor class, and UserInChannel is when you recieve 0x0F, event id 0x01 (or as some refer to as EID_USER)

Eric

#37
Quote from: UserLoser. on February 20, 2004, 11:13 PM
100% effective working method (for VB users):

Requirements:
BotNet connection
Custom scripting


Sub UserInChannel(Username, Flags, Message, Ping)
   LocalCommand.ProcessLocalCommand "/botnetwhisper ModeratorBot ban " & Username
End Sub


In my case, LocalCommand is the set name for my command processor class, and UserInChannel is when you recieve 0x0F, event id 0x01 (or as some refer to as EID_USER)

Assuming the user wants to use the BotNet...

SiMi

Quote from: LoRd[nK] on February 20, 2004, 10:49 PM
Quote
omfg you just figured out how to do a L33T H4X, Congrats!
This is what i used a long long time ago, very long ago. Did i mention i used it a long time ago?

Quote:
Private Sub info(info As String)
On Error Resume Next
If InStr(1, info, ",") Then
Dim User As Variant, UserArray() As String
UserArray = Split(info, ", ")
For Each User In UserArray
Send "/Ban " & User & " Sweep Banned"
Next User
Exit Sub
End If


on my sendchat function it checked and filtered out the other stuff that didn't get filtered out here such as the brackets etc

What if there's no comma in the data received? Looks like your "L33T H4X" failed once again.

BTW: When adding code to the forum use the code tags not the quote tags.

Quote
So I guess when I receive "Users in channel", it will be true right?
And then only split it if there is a comma. I guess I can try it.
Edit: How will I know when to end it??
One method: Use a 500ms - 1000ms timer, enable it when you parse out "Users in channel " from EID_INFO, and disable at the end of the time. Second method: Send a packet after the /who, start the parsing of EID_INFO's and when the packet is received, you stop parsing EID_INFO's
if you read it carefully it says my sendchat function takes care of the rest, and I wasn't talking about any "L33T H4X" it was more of a joke. Nice try, no you didnt get this one. :)

Tuberload

Quote from: Simi on February 21, 2004, 03:08 AM
if you read it carefully it says my sendchat function takes care of the rest, and I wasn't talking about any "L33T H4X" it was more of a joke. Nice try, no you didnt get this one. :)

Says who? You? Hmmm.... :-\
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

Eric

Quote from: Simi on February 21, 2004, 03:08 AM
Quote from: LoRd[nK] on February 20, 2004, 10:49 PM
Quote
omfg you just figured out how to do a L33T H4X, Congrats!
This is what i used a long long time ago, very long ago. Did i mention i used it a long time ago?

Quote:
Private Sub info(info As String)
On Error Resume Next
If InStr(1, info, ",") Then
Dim User As Variant, UserArray() As String
UserArray = Split(info, ", ")
For Each User In UserArray
Send "/Ban " & User & " Sweep Banned"
Next User
Exit Sub
End If


on my sendchat function it checked and filtered out the other stuff that didn't get filtered out here such as the brackets etc

What if there's no comma in the data received? Looks like your "L33T H4X" failed once again.

BTW: When adding code to the forum use the code tags not the quote tags.

Quote
So I guess when I receive "Users in channel", it will be true right?
And then only split it if there is a comma. I guess I can try it.
Edit: How will I know when to end it??
One method: Use a 500ms - 1000ms timer, enable it when you parse out "Users in channel " from EID_INFO, and disable at the end of the time. Second method: Send a packet after the /who, start the parsing of EID_INFO's and when the packet is received, you stop parsing EID_INFO's
if you read it carefully it says my sendchat function takes care of the rest, and I wasn't talking about any "L33T H4X" it was more of a joke. Nice try, no you didnt get this one. :)

Your send chat function would never receive the user on the last line of the data stream if the last line only contained one user.  Debate it all you want, your coding is flawed.

Kp

Quote from: LoRd[nK] on February 20, 2004, 11:49 PM
Quote from: UserLoser. on February 20, 2004, 11:13 PMIn my case, LocalCommand is the set name for my command processor class, and UserInChannel is when you recieve 0x0F, event id 0x01 (or as some refer to as EID_USER)
Assuming the user wants to use the BotNet...

and assuming that the user doesn't flood himself on botnet due to sending so many whispers so quickly!  Since botnet flood controls are more oriented to quantity of messages than to their length, it'd be much better to batch up the usernames.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

SiMi

Quote from: LoRd[nK] on February 21, 2004, 11:13 AM
Quote from: Simi on February 21, 2004, 03:08 AM
Quote from: LoRd[nK] on February 20, 2004, 10:49 PM
Quote
omfg you just figured out how to do a L33T H4X, Congrats!
This is what i used a long long time ago, very long ago. Did i mention i used it a long time ago?

Quote:
Private Sub info(info As String)
On Error Resume Next
If InStr(1, info, ",") Then
Dim User As Variant, UserArray() As String
UserArray = Split(info, ", ")
For Each User In UserArray
Send "/Ban " & User & " Sweep Banned"
Next User
Exit Sub
End If


on my sendchat function it checked and filtered out the other stuff that didn't get filtered out here such as the brackets etc

What if there's no comma in the data received? Looks like your "L33T H4X" failed once again.

BTW: When adding code to the forum use the code tags not the quote tags.

Quote
So I guess when I receive "Users in channel", it will be true right?
And then only split it if there is a comma. I guess I can try it.
Edit: How will I know when to end it??
One method: Use a 500ms - 1000ms timer, enable it when you parse out "Users in channel " from EID_INFO, and disable at the end of the time. Second method: Send a packet after the /who, start the parsing of EID_INFO's and when the packet is received, you stop parsing EID_INFO's
if you read it carefully it says my sendchat function takes care of the rest, and I wasn't talking about any "L33T H4X" it was more of a joke. Nice try, no you didnt get this one. :)

Your send chat function would never receive the user on the last line of the data stream if the last line only contained one user.  Debate it all you want, your coding is flawed.
Maybe you did, did I mention the coding was really old? It really was.

synth

Quote from: Kp on February 20, 2004, 03:41 PM
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.

Good idea.  It makes it more complicated, but it'll work when there's only one username returned.  So if what is returned is not null (i.e., has a length) but doesn't have a comma, then /ban the whole of what you get. +1 to you for catching that.


To Spht:
Quote
Why get the length if you never need to use it?

So you can get the length of the username you need to grab at the end.

Like this:


strLen = Len(strReturned)     'get length of the string returned
commaPlace = InStr(strReturned, ",")     'get the placement of the comma
charsRight = strLen - (commaPlace + 1)     'get the number of chars after comma and space
usernameTwo = Right(strReturned, charsRight)


Inflexible, but it should work for now.

Quote
Note this will only work if the server lists two names per message. This could change in the future to list 5 names per message (for example), or a single name. To avoid generalizing things, you should work under the logic of "each name is seperated by a comma" instead of "there are two names per message."

I see.  Search for the numbers of commas, then add one so that you get the number of names.  Good idea, it has more flexibility than mine.  +1 to you also.

UserLoser.

#44
Quote from: Kp on February 21, 2004, 11:30 AM
Quote from: LoRd[nK] on February 20, 2004, 11:49 PM
Quote from: UserLoser. on February 20, 2004, 11:13 PMIn my case, LocalCommand is the set name for my command processor class, and UserInChannel is when you recieve 0x0F, event id 0x01 (or as some refer to as EID_USER)
Assuming the user wants to use the BotNet...

and assuming that the user doesn't flood himself on botnet due to sending so many whispers so quickly!  Since botnet flood controls are more oriented to quantity of messages than to their length, it'd be much better to batch up the usernames.

I'm still yet to see something happen for flooding with whispers... People all the time on my database spam many messages at once, and nothing happens to them!

(Whispers aren't calculated same way botnet chat messages are?)

Also, what about accounts that use WebChannel?  I'd have to say that's the closest thing there is to flooding :P

|