hello guys how to create IRC bot anti spammer i have no idea how to please tell me
Which message spam? the messages sent in-game or the one of channel itself?
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();
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
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
maybe the warchiefs spam may work?
LOL,,!!, we are talking about anti-spam for IRC, not for in-game xD
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
i want it for commands spam!!!!
[player.ID] will not work i think on bot!!!!!
i use fbs!!!!!!
help!!!!!!!
please!!!!!!!!!!!!!
thanks!!!!!!!
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!!!!!!!
use /mode #Channel +Kfnt 3:5 ( 3 for 3 times player types then get kicked in 5 seconds. ).
Really? It would be very helpful.
Uh, I told you guys that XD
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.
I did it in every channel which I am set +O, It should be locked now.