anitspammer

Started by kokia, Sep 24, 2015, 03:57 AM

Previous topic - Next topic

kokia

hello guys how to create IRC bot anti spammer i have no idea how to please tell  me

DizzasTeR

Which message spam? the messages sent in-game or the one of channel itself?

Thijn

The principle is the same. What I usually do is make two variables. One to hold warnings, and one to hold times.
When someone says something, you check the time of the previous message. If it's within, something like, 2 seconds, you increase the warnings counter.
You do that until the warnings are above to the amount of lines someone is allowed to spam.
When the message is above 2 seconds of the previous message you reset the warnings to 0.
Quick little piece of code, you'd have to make it work yourself.
if ( ( time() - antiSpamTime[ player.ID ] ) <= 2 ) {
antiSpamWarnings[ player.ID ]++;
if ( antiSpamWarnings[ player.ID ] > 4 ) {
Kick( player );
}
} else {
antiSpamWarnings[ player.ID ] = 0;
}
antiSpamTime[ player.ID ] = time();

FinchDon

Killerx Next Reply

2 Replies

1.Where i add it?
2.I add it it say antiSpamTime does not exist or antiSpamWarning does not exist
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

Quote from: Thijn on Sep 24, 2015, 05:44 AMThe principle is the same. What I usually do is make two variables. One to hold warnings, and one to hold times.
When someone says something, you check the time of the previous message. If it's within, something like, 2 seconds, you increase the warnings counter.
You do that until the warnings are above to the amount of lines someone is allowed to spam.
When the message is above 2 seconds of the previous message you reset the warnings to 0.
Quick little piece of code, you'd have to make it work yourself.
if ( ( time() - antiSpamTime[ player.ID ] ) <= 2 ) {
antiSpamWarnings[ player.ID ]++;
if ( antiSpamWarnings[ player.ID ] > 4 ) {
Kick( player );
}
} else {
antiSpamWarnings[ player.ID ] = 0;
}
antiSpamTime[ player.ID ] = time();
I tried many ways to create a IRC anti-spam function, but it never worked!

Quote from: Doom_Killer on Sep 24, 2015, 04:18 AMWhich message spam? the messages sent in-game or the one of channel itself?
Anything is okay, I just need a example
oh no

FinchDon

maybe the warchiefs spam may work?
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

LOL,,!!, we are talking about anti-spam for IRC, not for in-game xD
oh no

MacTavish

This Is Impossible because Chatting on an IRC channel is not from Server side you just have only one way that is mute the channel by /MODE #yourchannel +m

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

kokia

i want it for commands spam!!!!
[player.ID] will not work i think on bot!!!!!
i use fbs!!!!!!
help!!!!!!!
please!!!!!!!!!!!!!
thanks!!!!!!!

Murdock

Quote from: kokia on Sep 24, 2015, 02:10 PMi want it for commands spam!!!!
[player.ID] will not work i think on bot!!!!!
i use fbs!!!!!!
help!!!!!!!
please!!!!!!!!!!!!!
thanks!!!!!!!

i want $10000 from you!!!
send it to my bank account!!!
help!!!!!!!
please!!!!!!!!!!!!!
thanks!!!!!!!

SAzEe21

use /mode #Channel +Kfnt 3:5 ( 3 for 3 times player types then get kicked in 5 seconds. ).

KAKAN

Really? It would be very helpful.
oh no

Xmair

Uh, I told you guys that XD

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

Quote from: Xmair on Oct 11, 2015, 03:45 AMUh, I told you guys that XD
You actually never did it, atleast not in this topic.
oh no

Xmair

I did it in every channel which I am set +O, It should be locked now.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD