mIRC Home    About    Download    Register    News    Help

Print Thread
Channel Limit script #123069 19/06/05 07:44 PM
Joined: Nov 2003
Posts: 82
F
Felpipe Offline OP
Babel fish
OP Offline
Babel fish
F
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 !!

Re: Channel Limit script #123070 19/06/05 10:28 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
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!
Re: Channel Limit script #123071 19/06/05 11:05 PM
Joined: Nov 2003
Posts: 82
F
Felpipe Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Nov 2003
Posts: 82
its incredible how small this world is :P I downloaded ur scripts like 30 mins ago heheehheh

Thank you smile

Re: Channel Limit script #123072 20/06/05 01:53 PM
Joined: Apr 2005
Posts: 53
A
Abuser__ Offline
Babel fish
Offline
Babel fish
A
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 smile

Re: Channel Limit script #123073 20/06/05 03:32 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
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:

Code:
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
Re: Channel Limit script #123074 20/06/05 07:41 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
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.

Code:
 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!
Re: Channel Limit script #123075 20/06/05 07:42 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Interesting... I've never seen that used before. That could be very handy. laugh


Invision Support
#Invision on irc.irchighway.net
Re: Channel Limit script #123076 21/06/05 06:12 AM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Quote:
I think it's better to use "//" so if the value of the variable is a multiple of 3 then perform the limit commands.

Code:
 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.



Code:
 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!
Re: Channel Limit script #123077 21/06/05 07:32 AM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Quote:
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 "//".

Quote:
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.

Quote:
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!
Re: Channel Limit script #123078 21/06/05 12:12 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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)

Code:
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 }

Re: Channel Limit script #123079 21/06/05 01:16 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
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:

Code:
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