Valhalla Legends Forums Archive | Battle.net Bot Development References | Creating a Spam Ban Function

AuthorMessageTime
CrAz3D
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
[/quote]
This look close?
May 24, 2003, 8:44 PM
MesiaH
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.
May 24, 2003, 11:54 PM
CrAz3D
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?
May 25, 2003, 3:31 PM
CrAz3D
I got lost in my own thoughts, can anyone help me get through this?
May 27, 2003, 7:40 PM
Kp
[quote author=CrAz3D link=board=17;threadid=1416;start=0#msg10892 date=1054064415]
I got lost in my own thoughts, can anyone help me get through this?[/quote]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? :)
May 27, 2003, 7:51 PM
tA-Kane
[quote author=Kp link=board=17;threadid=1416;start=0#msg10893 date=1054065095]how does the bot know he's spamming?[/quote]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][/quote]
May 27, 2003, 8:00 PM
CrAz3D
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?
May 28, 2003, 12:02 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.
May 28, 2003, 1:22 PM
CrAz3D
that's wat I was thinkin' but I'm wondering how I should make the bot look at it. A listview? an Integer?
May 28, 2003, 1:45 PM
Soul Taker
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.
May 28, 2003, 1:49 PM
CrAz3D
Thank ya, think I could find en thing that might help on on this in ShadowBot source?
May 28, 2003, 3:26 PM
Skywing
[quote author=tA-Kane link=board=17;threadid=1416;start=0#msg10894 date=1054065636]
[quote author=Kp link=board=17;threadid=1416;start=0#msg10893 date=1054065095]how does the bot know he's spamming?[/quote]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][/quote]
[/quote]ZeroBot supports both things (separately). Repeated message ban in it is what you're describing.
May 28, 2003, 6:24 PM
CrAz3D
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?
May 28, 2003, 11:31 PM
c0ol
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.
May 30, 2003, 12:29 AM
CrAz3D
do i have to do a variable per person? or can it be just o ne?
May 30, 2003, 5:57 PM
CrAz3D
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
May 31, 2003, 1:18 AM

Search