• Welcome to Valhalla Legends Archive.
 

Creating a Sweep Ban Function

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

Previous topic - Next topic

TriCk

Soul Taker, id prefer not to have another bot loading.... I think i got how to do it my own way ....

Code:
If InStr(Message, ", ") Then
Splt() = Split(Message, ", ")
AddC Form1.CHAT, vbGreen, Splt(0)
AddC Form1.CHAT, vbGreen, Splt(1)
Form1.List1.AddItem Splt(0)
Form1.List1.AddItem Splt(1)
End If

TriCk

That goes under ur Identifier for &H12
Then u simply do
For i = 0 to List1.ListCount
Send List1(i).Text
Next i

Stealth

I love your variable and object names.. they're so descriptive ;)
- Stealth
Author of StealthBot

TriCk

Hehe thx stealth  :P

Aite...
Dim Splt() As String
AddC = Sub to add chat
Form1.CHAT = RichTextBox
List1 = ListBox ... Duh :P

For i = 0 to List1.ListCount
Send List1(i).Text
Next i
That is a little bit wrong, my bad...

I've decided to do ...
If Form1.List1.ListCount > -1 Then
   Send "/ban " & Form1.List1.List(0)
   Form1.List1.RemoveItem (0)
End If

TriCk

Ok Heres another problem, I need to make the bot ban Operators too ... which have "[" name "]" and i was wondering how would i remove this from a message...

I've already got down that UCase(Message) is needed mostlikely... but i don't know how to remove "[" "]" from the start and end of names ...

Camel

I wasn't patient enough to read all of the replies to see if the answer was given, but here's what I use:

      'WARNING: The following code is used for sweepban,
      ' a method to ban every user in a channel by using
      ' /who. If you cannot figgure out how to use it on
      ' your own, do not expect me to explain it.
      '
      'If Left(Info, 17) = "Users in channel " Then
      '   bot.SendText "Sweepbanning #" & Mid(Info, 18, len(Info) - 18)
      'End If
      '
      'For Each User In Split(Info, ", ")
      '   If InStr(User, " ") = 0 Then
      '      If ( (Left(User, 1) = "[") And (Right(User, 1) = "]") ) Then User = Mid(User, 2, Len(User) - 2)
      '      'bot.ShowText "ÿC9ÿci/ban " & User & " sweepban"
      '      bot.SendText "/ban " & User & " sweepban"
      '   End If
      'Next


BTW, that's in an external script file, which is why everything is a variant.

TriCk

Is bot a Public Type?

Camel

Not that it's relevant to the topic, but 'bot' is a class module passed to the script control which contains functions used to control the bot. It's not glorious, but it was the most effective method I came across at the time.

TriCk


Banana fanna fo fanna

/who the channel and send just /. Parse every info message following the command. Ignore the error message, which means you should stop parsing the info messages.

Yeah yeah, it does take two packets, but imo it's the cleanest way you can do it.

Skywing

Quote from: St0rm.iD on September 06, 2003, 07:25 PM
/who the channel and send just /. Parse every info message following the command. Ignore the error message, which means you should stop parsing the info messages.

Yeah yeah, it does take two packets, but imo it's the cleanest way you can do it.
Not necessarily foolproof either.  Battle.net events have been proven completely asynchronous, so there's not really a sure-fire way to know.

For instance, I've logged receiving a notification of a user talking in the middle of receiving the initial channel userlist, before I received a notification that said user was actually in the channel.

Banana fanna fo fanna

Oh, thought they were always in-order.

Soul Taker

I've recieved a ban message and a user leave message on someone, then they spammed two lines of text AFTER I saw them banned/leave.  Happens once in a while.

UserLoser

#28
Two bots in same channel.  Bot A, and Bot B.  Bot B gets banned.  Bot A recieves the "bot b has been banned by the operator" message.  Bot A recieves the leave event for Bot B.  Bot B doesn't recieve the message that it has been banned by the channel operator, until about 7 seconds later.

Hazard

Quote from: UserLoser on September 06, 2003, 09:55 PM
One time I had two bots in the same channel, someone banned one of the bots, and right away on the bot that didn't get banned, it displayed the ban message.  But on the bot that did get banned, I believe it was 7 seconds later it said blah was banned by blah!, blah has kicked you out of the channel!

I've read that like 8 times and I still don't get it. It is less than coherent.

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

|