|
Joined: Nov 2003
Posts: 82
Babel fish
|
OP
Babel fish
Joined: Nov 2003
Posts: 82 |
Hello Im trying to make a channel limit script this is what I've done so far
on 1:JOIN:#chan: /MODE #chan +l $calc($nick(#chan,0) +2) on 1:quit: /MODE #chan +l $calc($nick(#chan,0) +1) on 1:part:#chan: /MODE #chan +l $calc($nick(#chan,0) +1)
but I need some sort of delay between them so it would actually work properly...
I mean I need it to set a limit when a nick joins but I dont want the script to change the limit right away I need it to wait a couple of secods to change the limit so u would not end up having a "funny" guy flooding with nicks or something like that.
Thank you very much any suggestiong or help of anykind would be greatly appreciated !!
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
You can try this addon that I made for a bot. Click here
If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
|
|
|
|
Joined: Nov 2003
Posts: 82
Babel fish
|
OP
Babel fish
Joined: Nov 2003
Posts: 82 |
its incredible how small this world is :P I downloaded ur scripts like 30 mins ago heheehheh Thank you
|
|
|
|
Joined: Apr 2005
Posts: 53
Babel fish
|
Babel fish
Joined: Apr 2005
Posts: 53 |
I will ask here: How to make a script for limit wich sets margin/offset(+5 users) every 3 joins,parts,quits not every join,part,quit (because it can be anoying). Thanks
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Well, you can take any script that does it on every join and do something like this:
on *:start: set %join.cnt 1
on *:join:#chan: {
if ($calc(%join.cnt / 3) == $int($calc(%join.cnt / 3))) {
[run your limit script here]
}
inc %join.cnt
}
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
I think it's better to use "//" so if the value of the variable is a multiple of 3 then perform the limit commands. on *:start: set %join.cnt 1
on @!*:JOIN:#Channel: {
inc %join.cnt
if (3 // %join.cnt) {
if ( $chan(#).limit != $calc($nick(#,0) + 5) ) mode # +l $v2
}
}
**Change #Channel & the limit number (5)
If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Interesting... I've never seen that used before. That could be very handy.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Feb 2004
Posts: 206
Fjord artisan
|
Fjord artisan
Joined: Feb 2004
Posts: 206 |
I think it's better to use "//" so if the value of the variable is a multiple of 3 then perform the limit commands. on *:start: set %join.cnt 1
on @!*:JOIN:#Channel: {
inc %join.cnt
if (3 // %join.cnt) {
if ( $chan(#).limit != $calc($nick(#,0) + 5) ) mode # +l $v2
}
}
**Change #Channel & the limit number (5) I assume this need to "reset" the channel limit is to avoid flooding. If this is so, then resetting the limit to "+5" everytime (or every third time) some joins will defeat the purpose, as there will always be room for more to join, which will further increase the room limit. on *:start: set %join.cnt 1
on @!*:JOIN:#Channel: {
inc %join.count
if ((3 // %join.count) && !join.timedelay) {
mode # +l $calc($nick([color:red]$chan[/color] ,0) + 5)
set [color:green]-u5[/color] %join.timdelay 1
}
}
Changed "#" to $chan, after all - the associated join may not happen on the active channel! And you don't want to change the limits of other channels. Removed the confusing "if" (if the current limit does not equal the new limit, then just change the limit??? - why not just change it anyway and then you know it will be true!) Added the %join.timedelay variable - which will prevent any changes to the limit happening in the next [5] seconds. This way, if too many ppl try to join at once, your limit actually works instead of being raised again. obviously change the "5" to whatever you want. Not tested. Cheers, DK
Darwin_Koala
Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
I assume this need to "reset" the channel limit is to avoid flooding. If this is so, then resetting the limit to "+5" everytime (or every third time) some joins will defeat the purpose, as there will always be room for more to join, which will further increase the room limit. That is why I made an addon which uses a timer. Look at the first post that I made. Also I was just showing Riamus2 regarding the "//". Changed "#" to $chan, after all - the associated join may not happen on the active channel! And you don't want to change the limits of other channels. Changing "#" to "$chan" inside the event will not change the limits of other channels if you specify a Channel name in the event "on @!*:JOIN:#Channel: {". If you did not specify a channel name, then it would affect all your channels where you or the bot is opped. Removed the confusing "if" (if the current limit does not equal the new limit, then just change the limit??? - why not just change it anyway and then you know it will be true!) That is to make sure that the channel has already the correct limit & you don't have to set it again.
If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Im no expert on channel Ops stuff, but this would seem a good solution. It simply sets off a timer that if the channel limit is not channel nicks + 3 then it sets it to that. The timer does not go off for 5 seconds so, if there is a join flood, only 3 nicks get in, the timer updates to 3 more than that but wont trigger for 5 seconds. * Well still have a problem on a netsplit rejoin, if the channel limit is to low, unless netsplits are aspecially dealt with to avoid this. (i dont know)
on @!*:JOIN:#channel:{ control.channel $chan }
on @!*:PART:#channel:{ control.channel $chan }
on @!*:KICK:#channel:{ control.channel $chan }
on @!*:QUIT:{ if ($nick ison #channel) { control.channel $v2 } }
;
alias -l control.channel { $+(.timer.set.channel.limit.on.,$network,.,$1) 1 5 if ( $!calc( $!nick( $1 ,0) + 3) != $!chan( $1 ).limit ) mode $chan +l $!v1 }
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Netsplits can be an issue depending on the script. No matter the script, if you have this problem, you can usually manage to fix it by using something like:
on *:join:#yourchan: {
if ($nick($chan,0) > %limit) {
.timerlimit 1 1 mode $chan +l $calc(%limit + 5)
}
}
Notes:* This will get your limit set right away so people are not left waiting right after a netsplit. * Set %limit to whatever number your limit is set to whenever it's changed * I'm unsure if there is a way to see your channel's limit at any given time with a script. If so, use that instead of a %limit variable. Something like $mode($chan).limit --- though, I'm sure that doesn't work. * When a rejoin from a netsplit happens after a limit was changed to a lower number (from lower people in the channel), then you usually end up with having more people in the channel than the limit would allow. People can rejoin automatically from a netsplit regardless of limit. So, this would just check to see if more people are in the channel than the limit would allow and, if so, resets the limit. The only other ways I can think of for having more people than the limit is 1) Someone lowers it to less than the number of people in the channel, or 2) Someone uses invites. * The only thing this will not help with is when a netsplit rejoin happens which puts the number of people in the channel equal to the limit. You can avoid this by putting in a timer that will reset the limit after a specific time period. .... Now that I'm done writing this, I'm thinking that this is probably only useful to people who just want a limit to change every X seconds/minutes rather than whenever people join.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|