mIRC Home    About    Download    Register    News    Help

Print Thread
#90210 12/07/04 02:20 PM
Joined: Jan 2004
Posts: 7
A
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2004
Posts: 7
Hi,

I am trying to make a simple bot which will tell a user to join a different channel when they join the channel the bot is on.

Basically i have channels #index and #chan1, #chan2, #chan3 etc.. When #chan1 is full, i want to redirect any users who join #index to #chan2 etc. but if there are openings in #chan 1, to redirect them there.

Im not sure how to check how many users are in a room to tell whether it is full or not.

Can anyone help out please.

Thanks,
Alex

#90211 12/07/04 05:44 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
$chan().limit is what you are after:

On !*:join:#index:{
  • var %i = 1
    while $chan(%i) {
    var %c = $ifmatch
    if %c != # {
    var %l = $chan(%c).limit
    if !%l || %l > $nick(%c,0) {
    msg # $nick $+ , you can join %c
    return
    }
    }
    inc %i
    }
    msg # I'm sorry $nick $+ , all channels are full.
}


#90212 13/07/04 07:06 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Depending on the network and the server software you might be able to achieve this with channel modes. Worth a look before committing to a script.


Link Copied to Clipboard