|
DuXxXieJ
|
DuXxXieJ
|
on *:JOIN:#:{
if (%join [ $+ [ $nick ] ] == $null) {
set -u10 %join [ $+ [ $nick ] ] 1
}
else {
inc %join [ $+ [ $nick ] ]
}
if (%join [ $+ [ $nick ] ] >= 3) {
if ($me isop #) {
kick $chan $nick Join Flood Protection
unset %join [ $+ [ $nick ] ]
}
unset %join [ $+ [ $nick ] ]
}
}
This script kicks peopel who join 3 times in 10 seconds. But it's set to every channel, so if I join #chan1, #chan2 and #chan3 (all three in 10 seconds, lets say I'm using perform) it'll kick me in #chan3 (last joined, where %joinMYNAME is set to 3) I'd like it to kick people who join 3 times in 10 seconds PER chan and not overall. Any help?
Last edited by DuXxXieJ; 09/06/11 03:53 PM.
|
|
|
|
mur_phy
|
mur_phy
|
on *:JOIN:#:{
inc -u10 %join. [ $+ [ $+($nick,$chan) ] ]
if ( %join. [ $+ [ $+($nick,$chan) ] ] == 3) {
if ($me isop #) { kick $chan $nick Join Flood Protection }
}
}
Last edited by mur_phy; 09/06/11 04:14 PM.
|
|
|
|
Joined: Jul 2007
Posts: 1,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
To prevent the script from kicking youself, just add the ! prefix: That will save yourself from being kicked.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Just to clean it up a little...
on !*:JOIN:#:{
inc -u10 $+(%,join.,$nick,$chan)
if ($($+(%,join.,$nick,$chan),2) >= 3) {
if ($me isop #) { kick $chan $nick Join Flood Protection }
}
}
Reasons: 1) You don't need to evaluate (using []'s) when incrementing a dynamic variable. You could use %join. $+ $+($nick,$chan) using the same style that you were using. I just combined everything into $+() rather than only half. 2) $(,2) is imo better than using []'s. []'s are for order of operations and although they usually work for dynamic variable evaluation, that really isn't what their purpose is. $(,2) (short for $eval(,2)) is meant for that type of evaluation. It won't hurt in this script regardless which way you choose, of course. 3) >= instead of == ... if the person rejoins immediately after the kick, the count will be 4 and with ==, the nick won't get kicked. 4) ! on the event line ... this prevents your script from kicking you, which I doubt you want to happen. 5) You *could* use @ on the event line instead of checking isop, but in this case, I would use the isop check where you have it because the way it is now, if you aren't op and someone joins 3 times and then you become op and they join again, you'll kick them. If you use @, the /inc won't happen and so you won't start counting rejoins until you are an op. That could mean more joins before you kick the person.
|
|
|
|
mOX
|
mOX
|
on !*@:JOIN:#:{
inc -u10 %join. [ $+ [ $+($nick,$chan) ] ]
if ( %join. [ $+ [ $+($nick,$chan) ] ] == 3) {
kick $chan $nick Join Flood Protection
}
}
on !*@:JOIN:#:{
inc -u10 %join. [ $+ [ $hash($nick $chan,32) ] ]
if ( %join. [ $+ [ $hash($nick $chan,32) ] ] == 3 ) {
kick $chan $nick Join Flood Protection
}
} mIRC.chm The @ prefix You can limit events to being executed only when you have Ops on a channel by using the @ prefix.
Last edited by mOX; 09/06/11 05:47 PM.
|
|
|
|
Joined: Jul 2007
Posts: 1,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
I've never seen people prefixed like you've done. I don't believe this is the correct form. You either use @ or ! by itself for the join event.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Yeah, without testing it, I'm not sure that it would work like that. My guess is that it won't. Even if it does, as I mentioned, @ isn't the best option for this particular script anyhow.
|
|
|
|
Joined: Dec 2002
Posts: 1,996
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,996 |
I would use @*:JOIN:#: because it won't trigger for yourself since you are NOT opped when you join the channel, and it will only trigger for others if you ARE opped.
|
|
|
|
Joined: Jul 2007
Posts: 1,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
I was told there is no difference when you use ! or @ upon your own entry. They will stop the join event from being triggered when you join a channel.
Edit - I've gaven it a little test drive and it works without triggering my own entrance by using @ or ! by itself.
Edit again - I've just found that it renders the join event unresponsive when used with @ while you don't have an OP status.
Last edited by Tomao; 09/06/11 11:01 PM.
|
|
|
|
Joined: Dec 2002
Posts: 1,996
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,996 |
Yes both will prevent triggering on your own entry. While ! stops there for the JOIN event, @ also does the job of ! in this case AND prevents triggering if you are not opped. Personally, I wouldn't want to count the joins if I wasn't opped, so using @ alone covers it all without having to use if ($me isop $chan)
|
|
|
|
mOX
|
mOX
|
Actually I did not realize I had not removed the prefix "!" The idea was to add "@" to get rid of the comparison "if ($me isop #)" The syntax "on !*@:JOIN:#:{" no is correct, but it worked the same way
|
|
|
|
Joined: Jul 2007
Posts: 1,124
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,124 |
mOX, It doesn't seem correct. This is more like it:
on !@*:JOIN:#:{
But you'll only need one of them. As RoCk has mentioned they both will work to keep the join event from triggering on your own entrance to a channel.
I don't know where you get that structure from...it looks very unorthodox.
Last edited by Tomao; 10/06/11 06:31 PM.
|
|
|
|
Joined: May 2022
Posts: 119
Vogon poet
|
Vogon poet
Joined: May 2022
Posts: 119 |
on *:JOIN:#:{
if (%join [ $+ [ $nick ] ] == $null) {
set -u10 %join [ $+ [ $nick ] ] 1
}
else {
inc %join [ $+ [ $nick ] ]
}
if (%join [ $+ [ $nick ] ] >= 3) {
if ($me isop #) {
kick $chan $nick Join Flood Protection
unset %join [ $+ [ $nick ] ]
}
unset %join [ $+ [ $nick ] ]
}
}
Does it works just on nick or does it consider the whole mask? I mean: an user may join flood with the different nicks but same host. Does it consider this option? Thanks
|
|
|
|
Joined: Nov 2021
Posts: 152
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 152 |
try this Fernet :
on !*:JOIN:#:{
if ($nick($chan,$me,~&@%)) {
if (%JoinPartFlood. [ $+ [ $wildsite ] $+ . $+ [ $chan ] $+ . $+ [ $network ] ] == $null ) { set -u10 %JoinPartFlood. [ $+ [ $wildsite ] $+ . $+ [ $chan ] $+ . $+ [ $network ] ] 1 }
else { inc %JoinPartFlood. [ $+ [ $wildsite ] $+ . $+ [ $chan ] $+ . $+ [ $network ] ] }
if (%JoinPartFlood. [ $+ [ $wildsite ] $+ . $+ [ $chan ] $+ . $+ [ $network ] ] == 3) {
if ($wildsite !isban $chan) { mode $chan +b $wildsite }
if ($nick ison $chan) { kick $chan $nick Join-Part-Flood }
unset %JoinPartFlood. [ $+ [ $wildsite ] $+ . $+ [ $chan ] $+ . $+ [ $network ] ]
}
}
}
Last edited by Simo; 05/05/25 11:21 PM.
|
|
|
|
Joined: Nov 2021
Posts: 152
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 152 |
a little bit cleaner version :
on !*:JOIN:#:{
if ($nick($chan,$me,~&@%)) {
if ($+(%,JoinPartFlood_,$site,_,$chan) == $null ) { set -u10 $+(%,JoinPartFlood_,$site,_,$chan) 1 }
else { inc $+(%,JoinPartFlood_,$site,_,$chan) }
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) {
if ($wildsite !isban $chan) { mode $chan +b $wildsite }
if ($nick ison $chan) { kick $chan $nick Join-Part-Flood }
unset $+(%,JoinPartFlood_,$site,_,$chan)
}
}
}
|
|
|
|
Joined: May 2022
Posts: 119
Vogon poet
|
Vogon poet
Joined: May 2022
Posts: 119 |
a little bit cleaner version :
on !*:JOIN:#:{
if ($nick($chan,$me,~&@%)) {
if ($+(%,JoinPartFlood_,$site,_,$chan) == $null ) { set -u10 $+(%,JoinPartFlood_,$site,_,$chan) 1 }
else { inc $+(%,JoinPartFlood_,$site,_,$chan) }
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) {
if ($wildsite !isban $chan) { mode $chan +b $wildsite }
if ($nick ison $chan) { kick $chan $nick Join-Part-Flood }
unset $+(%,JoinPartFlood_,$site,_,$chan)
}
}
}
I will try it, thanks Simo. { set -u10 $+(%,JoinPartFlood_,$site,_,$chan) 1 } Is this number of join allowed? ( I need 3 times ) And where tu set ban time? ( I need i.e. 10 hours / 36000 sec )
|
|
|
|
Joined: Nov 2021
Posts: 152
Vogon poet
|
Vogon poet
Joined: Nov 2021
Posts: 152 |
this part gets the times joined in 10 seconds : if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) { you could try this with the added timed ban for 10hours ( keep in mind you have to be actually at least 10 hours in the channel for your client to execute the set time ban if you exit irc before setting it is useless) as you wont be in channel to have your client execute it
on !*:JOIN:#:{
if ($nick($chan,$me,~&@%)) {
if ($+(%,JoinPartFlood_,$site,_,$chan) == $null ) { set -u10 $+(%,JoinPartFlood_,$site,_,$chan) 1 }
else { inc $+(%,JoinPartFlood_,$site,_,$chan) }
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) {
if ($wildsite !isban $chan) { ban -u $+ $duration(10h) $chan $nick 2 }
if ($nick ison $chan) { kick $chan $nick Join-Part-Flood }
unset $+(%,JoinPartFlood_,$site,_,$chan)
}
}
}
|
|
|
|
Joined: May 2022
Posts: 119
Vogon poet
|
Vogon poet
Joined: May 2022
Posts: 119 |
this part gets the times joined in 10 seconds : if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) { Where is 10 seconds? Is maybe here----> { set -u10 $+(%,JoinPartFlood_,$site,_,$chan) 1 } ? My rules should has to be 3 joins allowed in 30 minutes (1800 sec). So maybe I can write this?
on !*:JOIN:#:{
if ($nick($chan,$me,~&@%)) {
if ($+(%,JoinPartFlood_,$site,_,$chan) == $null ) { set -u1800 $+(%,JoinPartFlood_,$site,_,$chan) 1 }
else { inc $+(%,JoinPartFlood_,$site,_,$chan) }
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) {
if ($wildsite !isban $chan) { ban -u $+ $duration(10h) $chan $nick 2 }
if ($nick ison $chan) { kick $chan $nick Join-Part-Flood }
unset $+(%,JoinPartFlood_,$site,_,$chan)
}
}
}
|
|
|
|
Joined: May 2022
Posts: 119
Vogon poet
|
Vogon poet
Joined: May 2022
Posts: 119 |
Finally I did this: on !*:JOIN:#CHANNEL:{
if ($nick($chan,$me,~&@%)) {
if ($+(%,JoinPartFlood_,$site,_,$chan) == $null ) { set -u1800 $+(%,JoinPartFlood_,$site,_,$chan) 1 }
else { inc $+(%,JoinPartFlood_,$site,_,$chan) }
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) == 3) .timerwarn 1 3 notice $nick WARNING!!!
if ($($+(%,JoinPartFlood_,$site,_,$chan),2) > 3) {
if ($wildsite !isban $chan) { ban -u $+ $duration(10h) $chan $nick 2 | /write banemule.txt $date $time *Join_Flood* $chan $nick }
if ($nick ison $chan) { kick $chan $nick YOU BEEN WARNED (Part/Join }
unset $+(%,JoinPartFlood_,$site,_,$chan)
}
}
}
I added a warn when part/join == 3 and ban on >3 (so 4 :-P ) And added a /WRITE to have ban log in a text file Just a problem: operators ~&@%+ get banned. Maybe I have to add: if ($nick isop %chan) { halt }
??? Does isop cover all levels (~&@%+) except 0? Thanks a lot ;-)
Last edited by Fernet; 08/05/25 03:55 PM.
|
|
|
|
|