• Welcome to Valhalla Legends Archive.
 

Creating a Sweep Ban Function

Started by TriCk, September 03, 2003, 09:29 PM

Previous topic - Next topic

TriCk

Language: VB6

Hey ppl i need to know what to do to get sweepban working. Is it a packet i have to send to get ./who channel or something?

Spht

Quote from: TriCk on September 03, 2003, 09:29 PM
Language: VB6

Hey ppl i need to know what to do to get sweepban working. Is it a packet i have to send to get ./who channel or something?


I have no idea what you mean by "sweepban." Some details would be helpful instead of a title.

Hazard

Quote from: Spht on September 03, 2003, 09:32 PM
Quote from: TriCk on September 03, 2003, 09:29 PM
Language: VB6

Hey ppl i need to know what to do to get sweepban working. Is it a packet i have to send to get ./who channel or something?


I have no idea what you mean by "sweepban." Some details would be helpful instead of a title.

I believe he is referring to a feature that I know Camel has implemented into his bot. When directed, the bot will check the users in a given channel, and ban them all. For instance if you gave the bot the command .sweepban Clan Recruitment, the bot would check the users in the channel and ban whomever was in the channel at the time. I am fairly certain this is what Trick was getting at.

"Courage is being scared to death - but saddling up anyway." --John Wayne

TriCk

Sorry, Sweepban means
ban everyone in a specified channel, like
?sweepban Clan Recruitment
would recieve all the ppl in that channel and ban them 1 by 1 ...

-1 to myself :P for not saying what it was

Spht

Quote from: TriCk on September 03, 2003, 09:40 PM
Sorry, Sweepban means
ban everyone in a specified channel, like
?sweepban Clan Recruitment
would recieve all the ppl in that channel and ban them 1 by 1 ...

-1 to myself :P for not saying what it was

OK, then /who the channel and ban everyone that's in it.

TriCk

hmmm, yeah i got that much ... im thinking something like this ...

Send "/who " & Channel

If InStr(Form1.Talk, ", ") Then
  Form1.Talk = Replace(Form1.Talk, ", ", vbCrLf)


But, i still need some help on banning the ppl, because this would just list them ...
Unless when a user does it, it adds to a listbox and goes through?

TriCk

Also that may take out other pieces of text people have sent ...

Hazard

Quote from: TriCk on September 03, 2003, 09:49 PM
hmmm, yeah i got that much ... im thinking something like this ...

Send "/who " & Channel

If InStr(Form1.Talk, ", ") Then
  Form1.Talk = Replace(Form1.Talk, ", ", vbCrLf)


But, i still need some help on banning the ppl, because this would just list them ...
Unless when a user does it, it adds to a listbox and goes through?

You need to use the code tool... for the love of GOD

"Courage is being scared to death - but saddling up anyway." --John Wayne

TriCk

Whats the packets id need to send and recv the battle.net information?

Stealth

It's actually very easy to do. Just store server info messages for, say, two seconds after the /who command is sent. Once caching is complete, parse the commas and extraneous information out of your stored information and ban, shitlist, squelch, whisper, poke or otherwise harrass the targeted users accordingly.

This can be accomplished using Static or (more messy) global-scope declarations.
- Stealth
Author of StealthBot

TriCk

Hmmmm -.-
Ok stealth keep in mind i'm not as good of a programmer as you

So english would help  :(

Also maybe some code...

Hazard

Quote from: TriCk on September 03, 2003, 09:54 PM
Also maybe some code...

How did I know he'd end up asking for code?

"Courage is being scared to death - but saddling up anyway." --John Wayne

Stealth

#12
Here's the code you're getting:


Public Function Cache(ByVal Inpt As String, ByVal Mode As Byte, Optional ByRef Typ As String) As String
   Static s() As String
   Static sTyp As String


The Cache function performs many things for me. During caching, it stores (in that static array) the server info responses. At the start of caching, it stores the output purpose in the sTyp string (this can be ban, squelch, or whatever else I need.) The actions it performs are completely controlled by the value of the Mode byte: One will tell the function that it will be recieving data, a different byte will resize and add to the cache array, another will clear the cache and return the stored information.

Writing an independent function such as this allows me to avoid using messy global declarations, and I can do absolutely anything I want with the returned data -- ban the users, shitlist them, squelch them, or whatever I please.
- Stealth
Author of StealthBot

TriCk

So sTyp is like what
ID_* would be?
and s() stores the received info?

Soul Taker

Or you could have a second bot join the channel and send (via BotNet for no flooding) the list of names it sees in the channel, and have the other bot automagically ban them.