mIRC Home    About    Download    Register    News    Help

Print Thread
#91442 22/07/04 02:32 PM
Joined: Jan 2004
Posts: 7
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2004
Posts: 7
Hi,

Not sure if i posted this before, but I cant find it.

I am looking for a way to tell how many channels a user is on at a particular time. I know i could do a /whois on each user but when we have over 300 on 7 different channels this is really time straining.

I would like to be able to have a script where if someone joins more the x chans a popup will tell a certain person - or one where we can scan all users at a time and output a list of users on more then x chans (i think the second option would be easier as we would need to track nick changes if we were going to try the first way.

Thanks in advance for any help I can get.

Alex

#91443 22/07/04 03:04 PM
Joined: May 2004
Posts: 95
W
Babel fish
Offline
Babel fish
W
Joined: May 2004
Posts: 95
this sounds rather strange, surely the user can decide how many channels to join? confused

#91444 22/07/04 08:51 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
If you're only interested in channels your are also in: use $comchan($nick,0), it gives you the number of channels both you and $nick are in. You can even loop all channels with $comchan($nick,[color:red]N)[/color] with N going from 1 to the number of common channels.

If you really want to include all channels in the count, so also channels you haven't joined: it's impossible. /whois nick will not only be very bandwith expensive for multiple users, it will also be incomplete: private or secret channels will not be shown in the /whois info...
(And as said before: why would you even want to do this?)

#91445 22/07/04 09:03 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
I know of people that wish to do this to keep drones out of channels as, on networks such as EFnet which usually allow a lot of channels to be joined, drones are often in excess of 25-30 channels. The best thing to do though is to /whois them on join and detect if the number of channels is > 25.

For example:

Code:
on @*:join:#channel:{ whois $nick }

raw 319:*:{
  set %nochannels $3-
  if ($numtok(%nochannels,32) > 25) {
    var %i = $chan(0) | while (%i) {
    if ($2 ison $chan(%i)) { kick $chan(%i) $2 Kick message here | ban $chan(%i) $2 3 } | dec %i }
    unset %nochannels
  }
}


$3- is all the channels which is then set in the variable %nochannels. $numtok then checks if the number of channels is greater than 25, and if it is, to kick ban the user. Change #channel for the channel name.

The points above do apply though, however, I would say this is much less intensive than /whois'ing every user in a channel with lots of users every X minutes.

Regards,


Mentality/Chris
#91446 22/07/04 10:46 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Here's another thought:

Code:
raw 319:*: {
  if ($28) { kick #channel $2 Kick message here | ban #channel $2 3 }
}
OR:

raw 319:*: {
  if ((#chan1 isin $3-) || (#chan2 isin $3-) && ($28)) { kick #channel $2 Kick message here | ban #channel $2 3 }
}


Correct me if Im wrong, but if $27 is valid (meaning has a value) then $3 - $27 (total of 25 channels) would qualify as being on 25 channels and anything over that ($28) would be more and you wouldnt need the loop. PLEASE correct me if Im wrong tho.


Those who fail history are doomed to repeat it
#91447 22/07/04 11:06 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Newp, that'd work fine and is much shorter, didn't think of it that way. The above is something that I put together ages ago and I just keep it in remotes for times of need (it's something which is requested a bit).

Just to clear up any confusion you would still need the on @*:join:#channel:{ whois $nick } bit smile

Regards,


Mentality/Chris
#91448 23/07/04 01:06 AM
Joined: Jan 2004
Posts: 7
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2004
Posts: 7
Thanks,

The reason I want to do this is because we are holding a world-wide event on our servers. We have rules against idling in channels and find that idlers tend to slow down our bots, and sometiems crash them. We also set channel limits and due to a limit of channels we dont want people sitting on a channel taking up a space somone else could have been using.

Thanks again
Alex


Link Copied to Clipboard