mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
I have a script that sets the limit of the channel by watching the joines and parts. it works great when the servers are stable, but during a netsplit and the nicks rejoin the channel, it sets the limit every time 4 nicks joins and it takes forever to get the limit back up to the right number:

-=> Joins cute-char < ~jhjkh@202.133.75.129 >
-=> Joins faraaz < ~farharayu@202.179.144.2 >
-=> Joins handkerch < ~fjzbp@62.29.49.8 >
-=> Joins _didem- < ~java@D576C8B5.kabel.telenet.be >
-=> Joins HAKAN^_^ < ~lamud@62.248.88.179 >
-=> Joins satal < ~Satal@Ottawa-HSE-ppp261079.sympatico.ca >
-
* Dingo` sets mode: +l 148
* Dingo` sets mode: +l 152
* Dingo` sets mode: +l 156
* Dingo` sets mode: +l 160

is there anything i can use to hold the script untill everyone has stop rejoining, and THEN set the limit ?

my code so far is:

Code:

#limitscript off
on *:JOIN:#beginner: {  
  if ( $network == Undernet ) &amp;&amp; ( $me isop #beginner ) {
    if (%join.count == $null) set %join.count 1      
    if (%join.count &lt; 4) { inc %join.count | halt }      
    if (%join.count == 4) { set %chan.limit $calc($nick(#,0) + 7) | mode # +l %chan.limit | unset %join.count } 
  }
}
on *:PART:#beginner: {
  if ( $network == Undernet )  &amp;&amp; ( $me isop #beginner ) {
    if (%part.count == $null) set %part.count 1
    if (%part.count &lt; 8) { inc %part.count | halt }
    if (%part.count == 8) { set %chan.limit $calc($nick(#,0) + 7) | mode # +l %chan.limit | unset %part.count }  
  }
}
#limitscript End

Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
You would also need to consider QUIT and KICK as people do leave the channel by these methods (and they are not included in PART)

[edit]

Wouldn't it also be better to combine the variables?
something like %chan.limit and %chan.count

that way, when someone 8 people part and 2 people join, you wouldn't want it to set the chan limit straight away, because there's still room in the channel for people to join...

Just a suggestion!

[/edit]

Last edited by Aubs; 06/02/03 05:13 PM.

Aubs.
cool

Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
heh yeah - good point smile

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
You could always use a simple timer. Something like this:

on *:join:#channel://timerLIMIT 1 10 //mode # +l $calc($nick(#,0) +4)

This way, if a bunch of people join, the timer will reset and the limit will only be placed when the timer is allowed to finish and set the limit of # of nicknames plus 4 people. Just a thought


Those who fail history are doomed to repeat it
Joined: Feb 2003
Posts: 4
I
Self-satisified door
Offline
Self-satisified door
I
Joined: Feb 2003
Posts: 4
This is what I did yesterday, adding a timer, so far its been working pretty well smile, btw Dingo, ur script looks so much like mine :tongue: *lol*

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
I would suggest that you simply start a timer to update the limit of the channel when you get opped on the channel. Have the timer call an alias using the channel name as a parameter and have that alias check the number of nicks in the channel and add 10 to it. You would increase the limit by 10 - say every 10 or 15 minutes - regardless of how many nicks were in the channel at the time. You might even provide a way to detect a netsplit on your network and NOT reset the limit if you have detected a netsplit condition, but just unset the netsplit variable so that the next time you go to reset the limit, the alias will go ahead and set the limit. This is not necessarily all that simple to do, since networks vary so much in how they present a netsplit.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
Ohhhh Ivette01 i know that :P but I wanted to see how other people would go about doing the same thing :tongue:

Hammer i like that ides - i'll check it out smile thanks

Joined: Dec 2002
Posts: 51
D
Dingo Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 51
there is one thing i'd like to know - how do i get the value of the current +L number from the channel mode ? smile

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$chan($chan).limit


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard