Author Topic: Stop Flooding  (Read 4946 times)

Mummybrain.com

  • Newbie
  • *
  • Posts: 9
Stop Flooding
« on: May 03, 2007, 08:21:51 PM »
I run a chatroom, i want to be able to ban someone if they flood the chat room. I know about the flood protection in icechat, but that only stops it for me, i want to stop it for everyone in the room.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Stop Flooding
« Reply #1 on: May 03, 2007, 08:35:24 PM »
What kind of specifics/settings do you want?
The IceChat God

Mummybrain.com

  • Newbie
  • *
  • Posts: 9
Re: Stop Flooding
« Reply #2 on: May 04, 2007, 03:55:49 AM »
I am getting cases of a member name logging in adn out very quickly, hundreds of times. I want to ban them from the room i am op in.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Stop Flooding
« Reply #3 on: May 04, 2007, 09:14:38 AM »
You may want to get a bot that does this for you, as they are more suited for such things.

In the mean time, I will see if I can find a join flood script and convert it for IceChat's use.
The IceChat God

Mummybrain.com

  • Newbie
  • *
  • Posts: 9
Re: Stop Flooding
« Reply #4 on: May 04, 2007, 11:02:31 AM »
i don't really understand how bots work. but would love to hear more if you think it wil help!

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Stop Flooding
« Reply #5 on: May 04, 2007, 07:42:39 PM »
Ok, I have made up a script, did a little testing, and it works pretty good.
It checks for floods for channel messages and channel joins.

The way both are setup are 5 times in 15 seconds.
You can change the variables inside the script to suit your needs.

Currently it does not kick voices or ops, but you can set them to True, if you wish.

Copy the code to the IceChat Editor, under Scripts tab.
Choose File, Save As,  change file type to IceChat 5 Script, give it a filename.
Save And Exit, and give it a whir.

This works for all the channels you are in, so you will need ops in each of the channels.
If the script needs a little work, or some changes, post them here.
This is just a basic, crude script to see how it works so far.


Code: [Select]
Dim NickText
Set NickText = CreateObject("Scripting.Dictionary")

Dim NickJoin
Set NickJoin = CreateObject("Scripting.Dictionary")

Dim TextFloodMax
'how many lines to flood before a kick
TextFloodMax = 5

Dim TextFloodTime
'how many seconds to check for flood
TextFloodTime = 15

Dim KickTextMessage
KickTextMessage = "Flood Kicker - You have been removed for channel flooding"

Dim JoinFloodMax
'how many joins before we kick
JoinFloodMax = 5

Dim JoinFloodTime
JoinFloodTime = 15

Dim KickJoinMessage
KickJoinMessage = "Flood Kicker - You have been removed for join flooding"


Dim KickOps
KickOps=False

Dim KickVoice
KickVoice=False


Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
'check for ops and voice
If IsOp(NickName,Channel,ServerNumber) and KickOps = False then Exit Sub
If IsVoice(NickName,Channel,ServerNumber) and KickVoice = False then Exit Sub

If NickText.Exists(NickName & ServerNumber) then
    NickText.Item(NickName & ServerNumber) = NickText.Item(NickName & ServerNumber) + 1
    If NickText.Item(NickName & ServerNumber) = TextFloodMax then
        'add the TextFloodkick/ban message here
        SendCommand "/mode " & Channel & " +b *!*" & Host, ServerNumber
        SendCommand "/kick " & Channel & " " & NickName & " " & KickTextMessage,ServerNumber
    End if
Else
    NickText.Add NickName & ServerNumber, 1
    SendCommand "/timer " & NickName & ServerNumber & " 1 " & TextFloodTime & " /! CheckTextFlood " & NickName & ServerNumber & " | " & ServerNumber, ServerNumber
End if

End Sub

Sub CheckTextFlood(Nick,ServerNumber)
if NickText.Exists(Nick) then NickText.Remove(Nick)
End Sub

Sub ONJOIN(Nickname,Host,Channel,ServerNumber)

If NickJoin.Exists(NickName & ServerNumber) then
    NickJoin.Item(NickName & ServerNumber) = NickJoin.Item(NickName & ServerNumber) + 1
    If NickJoin.Item(NickName & ServerNumber) = JoinFloodMax then
        'add the JoinFlood kick/ban message here
        SendCommand "/mode " & Channel & " +b *!*" & Host, ServerNumber
        SendCommand "/kick " & Channel & " " & NickName & " " & KickJoinMessage,ServerNumber
    End if
Else
    NickJoin.Add NickName & ServerNumber, 1
    SendCommand "/timer " & NickName & ServerNumber & " 1 " & JoinFloodTime & " /! CheckJoinFlood " & NickName & ServerNumber & " | " & ServerNumber, ServerNumber
End if

End Sub

Sub CheckJoinFlood(Nick,ServerNumber)
if NickJoin.Exists(Nick) then NickJoin.Remove(Nick)
End Sub
The IceChat God

Mummybrain.com

  • Newbie
  • *
  • Posts: 9
Re: Stop Flooding
« Reply #6 on: May 05, 2007, 08:16:53 AM »
Thanks :) i'll let you know how it goes!