mIRC Home    About    Download    Register    News    Help

Print Thread
Join random channel #109841
02/02/05 02:54 AM
02/02/05 02:54 AM
Joined: Mar 2004
Posts: 96
G
Gremel Offline OP
Babel fish
Gremel  Offline OP
Babel fish
G

Joined: Mar 2004
Posts: 96
How would one join a random channel? What I am thinking is doing the /list command and then pulling a random channel from there, whoo's members are greater than 1.

Is this possible?

Re: Join random channel #109842
02/02/05 03:09 AM
02/02/05 03:09 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
tidy_trax  Offline
Hoopy frood
T

Joined: Nov 2003
Posts: 2,327
Code:
alias joinrandom {
  var %min = $$2, %max = $3
  inc %jr
  scon -at1 if ($network == $1) { .list -min % $+ min $iif(%max != $null,-max % $+ max) }
}
raw 321:*:{
  if (%jr) {
    window -h "channels list"
    if ($fopen(jr_channels)) { .fclose jr_channels }
    .fopen -n jr_channels jr_channels.txt
  }
}
raw 322:*:{
  if (%jr) && ($fopen(jr_channels)) { .fwrite -n jr_channels $2 }
}
raw 323:*:{
  if (%jr) {
    window -c "channels list"
    if ($fopen(jr_channels)) { .fclose jr_channels }
    if ($lines(jr_channels.txt)) {
      join $read(jr_channels.txt,n)
      .remove jr_channels.txt
    }
    unset %jr
  }
}


/joinrandom <network you're connected to> <minimum users> [maximum users]

Examples:

Code:
;Joins a channel with at least 3 users on undernet.
/joinrandom Undernet 3


Code:
;Joins a channel with at least 3 users and at most 20 users on Dalnet.
/joinrandom Dalnet 3 20

Re: Join random channel #109843
02/02/05 01:03 PM
02/02/05 01:03 PM
Joined: Mar 2004
Posts: 96
G
Gremel Offline OP
Babel fish
Gremel  Offline OP
Babel fish
G

Joined: Mar 2004
Posts: 96
thanks smile