mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#99570 02/10/04 10:12 PM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline OP
Fjord artisan
OP Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
does anyone know how to make a script that protects my chanel from a flood?
or +v all of the people who join and has +m and +b ~q:*!*@ and devoices them when they begin to flood
+f 5:1 dosent work..

Last edited by IR_n00b; 02/10/04 10:14 PM.
#99571 02/10/04 10:18 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
An example that used to be on the #Helpdesk website:

Code:
[color:green]on @*:text:*:#: {
  if ($nick isop #) { return }
  set -u3 %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] $calc( %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] + 1)
  if (%fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] >= 5) {
    ban -ku60 # $nick 11 Please don't flood
  }
}
[/color]

This will unban the user after 60 seconds, if you don't want that to happen, just remove the 'u60' from the ban command.

You can also find a number of addons or protection scripts/snippets, from some scripting websites:

www.mirc.net
www.mircscripts.org
www.mircscripts.com
www.hawkee.com
www.scriptheaven.net
www.google.com (Search)

Hope this helps!

Regards,


Mentality/Chris
#99572 02/10/04 10:24 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
on @*:text:*:#channel: {
 if ($nick isop #) { halt }
 inc -u[color:blue]N[/color] $+(%talk,$nick)
 if ($eval($+(%talk,$nick),2) >= [color:red]N[/color]) { mode $chan -v $nick | unset $+(%talk,$nick) }
}
This should work as you want to. The first N is the time limit. This will determine the amount of time that the person is allowed to say N lines. The second N is the amount of lines the person can say in N seconds. Kinda redundant putting the last sentence, but I feel like typing smile The code, in this case, devoices the person. To voice them as the join, use this: on @!*:join:#channel: mode # +v $nick

You can use the same code for the ON Action event.. works exactly the same (just gotta change the event, of course).

Hope this helps smile
Zyzzyx.

Edit: Mentality beat me to it :P Also forgot the @Op checking

Last edited by Zyzzyx26; 02/10/04 10:27 PM.

"All we are saying is give peace a chance" -- John Lennon
#99573 02/10/04 10:25 PM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Code:
on @*:text:*:#: {
  if ($nick isop #) { return }
  set -u3 %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] $calc( %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] + 1)
  if (%fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] >= [color:red]5[/color]) {
    ban -ku60 # $nick 11 Please don't flood
  }
}


And change 5 to the number of messages allowed to send before flood.


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99574 02/10/04 10:37 PM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Zyzzyx26, I tested your script and it doesn't work. There's something wrong in line 3.


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99575 02/10/04 10:47 PM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline OP
Fjord artisan
OP Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
is there a way so it will still kick ops?
because some of the ops sorta like to flood

#99576 02/10/04 10:51 PM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
if ($nick isop #) { return }


change return into kick $chan $nick <reson> insted.


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99577 02/10/04 10:54 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yes, I see the problem. You should replace ALL $+(%talk,$nick) for $+(%,talk,$nick)

Edit: like it was before it would evalue %talk, which didnt exist. That is where the error was, I belive.

Last edited by Zyzzyx26; 02/10/04 11:02 PM.

"All we are saying is give peace a chance" -- John Lennon
#99578 02/10/04 11:26 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Simply removing the line 'if ($nick isop #) { return }' should work fine. That line checks if the nickname is an op in the channel, and then stops the script from carrying on. With that line gone, it will trigger for all nicknames.

That said, it is not a good idea to kick ops, it can start off kick wars due to revenge scripts, annoy others and get yourself in trouble.

Regards,


Mentality/Chris
#99579 02/10/04 11:32 PM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline OP
Fjord artisan
OP Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
:\ dont work

#99580 02/10/04 11:41 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Have you change the channel name on the first line? on @*:text:*:#channel: {

You also need to change both N's in the part below for the value you want:

inc -uN $+(%,talk,$nick)
if ($eval($+(%,talk,$nick),2) >= N) {


I've tried it here and, after the correction I made on NoPleX's note (see a couple of posts above), it worked fine.

Zyzzyx smile


"All we are saying is give peace a chance" -- John Lennon
#99581 03/10/04 12:30 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
jep it works fine now smile


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99582 03/10/04 12:34 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Cool smile I had forgotten that not puting the comma would make it evaluate the variable. Thanks for the tip wink


"All we are saying is give peace a chance" -- John Lennon
#99583 03/10/04 12:39 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
No problem. Maybe now you could help me on a repeat protection script? wink


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99584 03/10/04 12:50 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
I can try smile It goes by the same basis as the flood one, but it stores the line previously said by the person and compares to the one being said now. I suggest using a hash table to store those because, if you're on a big chan, you can get a lot of vars.
Code:
on @*:text:*:#channel: {
 if ($nick isop #) { halt }
 if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) { hadd -m Repeat $+($nick,$chan) $v1 }
 elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
  hinc -u[color:blue]N[/color] Repeat $+($nick,$chan,.count)
  if ($hget(Repeat,$+($nick,$chan,.count)) &gt;= [color:red]N[/color]) { commands here }
 }
}
This is not tested, but in theory should work. It stores 2 items in the hash table Repeat: one is the line previously said and one with the counting. As before, the blue N is the amount of time that they can repeat, while the red N is the amount of lines they can repeat in N seconds.

I hope this can help smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
#99585 03/10/04 01:20 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
aaah i understand. Thank you smile Just what i needed.


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99586 03/10/04 01:31 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Great smile


"All we are saying is give peace a chance" -- John Lennon
#99587 03/10/04 01:40 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
just one note. It doesn't work :tongue: It doesn't give me a error line so i can't se where it is.


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99588 03/10/04 02:13 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Hmm.. it works here smirk Have you changed the #channel in the ON Text event?


"All we are saying is give peace a chance" -- John Lennon
#99589 03/10/04 02:15 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
hehe. Ofcause wink


My script looks like this:

Code:
on @*:text:*:#my_channel: {
  if ($nick isop #) { halt }
  if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) { hadd -m Repeat $+($nick,$chan) $v1 }
  elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
    hinc -u60 Repeat $+($nick,$chan,.count)
    if ($hget(Repeat,$+($nick,$chan,.count)) &gt;= 2) {
      kick $chan $nick out
    }
  }
}


if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
Page 1 of 2 1 2

Link Copied to Clipboard