|
Joined: Sep 2004
Posts: 200
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 5,024 |
An example that used to be on the #Helpdesk website: [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.netwww.mircscripts.orgwww.mircscripts.comwww.hawkee.comwww.scriptheaven.netwww.google.com (Search) Hope this helps! Regards,
Mentality/Chris
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
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  The code, in this case, devoices the person. To voice them as the join, use this: on @!*:join:#channel: mode # +v $nickYou can use the same code for the ON Action event.. works exactly the same (just gotta change the event, of course). Hope this helps  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
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
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
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
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
|
|
|
|
Joined: Sep 2004
Posts: 200
Fjord artisan
|
OP
Fjord artisan
Joined: Sep 2004
Posts: 200 |
is there a way so it will still kick ops? because some of the ops sorta like to flood
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
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
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Jun 2003
Posts: 5,024
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Sep 2004
Posts: 200
Fjord artisan
|
OP
Fjord artisan
Joined: Sep 2004
Posts: 200 |
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
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
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
jep it works fine now
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Cool  I had forgotten that not puting the comma would make it evaluate the variable. Thanks for the tip
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
No problem. Maybe now you could help me on a repeat protection script?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
I can try  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. 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)) >= [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  Zyzzyx.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
aaah i understand. Thank you  Just what i needed.
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Great
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
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
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Hmm.. it works here  Have you changed the #channel in the ON Text event?
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
hehe. Ofcause My script looks like this:
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)) >= 2) {
kick $chan $nick out
}
}
}
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
|