Valhalla Legends Archive

Programming => Battle.net Bot Development => Battle.net Bot Development References => Topic started by: CrAz3D on May 24, 2003, 03:44 PM

Title: Creating a Spam Ban Function
Post by: CrAz3D on May 24, 2003, 03:44 PM
Couldn't find ne thing in search so I started this.
I was wondering how I'd go about making a SpamBan option.  I was thinkin' somewhere along the lines as a Rejoin Ban, but that is not exactly what is happening.

Maybe This?

Quote
spam as Long
spam = spam +1
User_Talk
ChannelList.FindItem(strUser).text
   ChannelList.FindItem (strUser).ListSubitems.add Spam




TmrSpam_()
Interval = 5000
if ChannelList.FindItem(strUser), Spam > 5 then
     Send "/ban " & strUser & " Spamming"
end if
This look close?
Title: Re:Spam Ban
Post by: Mesiah / haiseM on May 24, 2003, 06:54 PM
wont work, but if you made the interval on the timer smaller, and if the Spam number is under 5, then set the subitem to 0, this will be like resetting it.
Title: Re:Spam Ban
Post by: CrAz3D on May 25, 2003, 10:31 AM
I am able to add the person's name to a ListView but I am not able to their Spam count...
like
RoomList.ListItems.add,,Username
roomlist.listitems.add,,Spamb

Might anyone be able to help with this?
Title: Re:Spam Ban
Post by: CrAz3D on May 27, 2003, 02:40 PM
I got lost in my own thoughts, can anyone help me get through this?
Title: Quick abstract
Post by: Kp on May 27, 2003, 02:51 PM
Quote from: CrAz3D on May 27, 2003, 02:40 PM
I got lost in my own thoughts, can anyone help me get through this?
I typically implement spamban to be event-driven.  If the user speaking is the same one who just spoke, increment the spam counter.  Otherwise, clear the counter and store the name of the speaking user.  If the counter ever exceeds some threshold, ban the speaking user.  Note that this requires that the spammer be the only one speaking -- but if that wasn't the case, how does the bot know he's spamming? :)
Title: Re:Quick abstract
Post by: tA-Kane on May 27, 2003, 03:00 PM
Quote from: Kp on May 27, 2003, 02:51 PMhow does the bot know he's spamming?
By the user saying the same thing twice.

Or, by the user coming into the channel, saying something, and leaving before a set time has expired (eg, join, spam, leave in 5-10 seconds). This could be argued as fast leave ban, though.
Quote
Title: Re:Spam Ban
Post by: CrAz3D on May 27, 2003, 07:02 PM
so maybe put strText = to the strSpam & then if the second strText = strSpam ban their hind end?...is that what ur saying?...sounds good to me.

What bout diff msg spams?
"Clan aSUFhsd"
"Join clan aSUFhsd"
something like that?
Title: Re:Spam Ban
Post by: ______ on May 28, 2003, 08:22 AM
I would suggest not to look at messages as much , but look at how many times a user has talked and the rate. if it exceeds your rate check if they safelisted else ban them.
Title: Re:Spam Ban
Post by: CrAz3D on May 28, 2003, 08:45 AM
that's wat I was thinkin' but I'm wondering how I should make the bot look at it.  A listview? an Integer?
Title: Re:Spam Ban
Post by: Soul Taker on May 28, 2003, 08:49 AM
I use a two-dimensional string array for my spam-ban.  Have it be like Arr(Messages, Ticks), where Messages are the messages (so you can check their lengths, mostly), and Ticks is the tick that the corresponding message was sent at.  Then just fool around until you get a system that bans people that are spamming while usually not banning people that are just chatting, basically a backwards anti-flood.
Title: Re:Spam Ban
Post by: CrAz3D on May 28, 2003, 10:26 AM
Thank ya, think I could find en thing that might help on on this in ShadowBot source?
Title: Re:Quick abstract
Post by: Skywing on May 28, 2003, 01:24 PM
Quote from: tA-Kane on May 27, 2003, 03:00 PM
Quote from: Kp on May 27, 2003, 02:51 PMhow does the bot know he's spamming?
By the user saying the same thing twice.

Or, by the user coming into the channel, saying something, and leaving before a set time has expired (eg, join, spam, leave in 5-10 seconds). This could be argued as fast leave ban, though.
Quote
ZeroBot supports both things (separately).  Repeated message ban in it is what you're describing.
Title: Re:Spam Ban
Post by: CrAz3D on May 28, 2003, 06:31 PM
How might I go about declaring all of this crap, it is erally gettin confusing.  Rejoin Ban I use just check's a listview, but if spamban is enabled it has to keep track of user & how much they talk for however long...ne code help maybe?
Title: Re:Spam Ban
Post by: c0ol on May 29, 2003, 07:29 PM
set a timer, like 5 seconds, start a variable somwhere associated with the person, when they join again or speak or whatever increment it, when the timer ends, clear it. if the variable reaches like 10 ban them.
Title: Re:Spam Ban
Post by: CrAz3D on May 30, 2003, 12:57 PM
do i have to do a variable per person?  or can it be just o ne?
Title: Re:Spam Ban
Post by: CrAz3D on May 30, 2003, 08:18 PM
I'm tryin to add the stuff to a listview, it ain't workin though...plz tell me what I'm doing wrong?
SpamCount = SpamCount + 1
           frmLists.Spam.ListItems.add , , strUser
           frmLists.Spam.ListItems(frmLists.Spam.ListItems.count).ListSubItems.add , , SpamCount