mIRC Homepage
Posted By: Gremel Join random channel - 02/02/05 02:54 AM
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?
Posted By: tidy_trax Re: Join random channel - 02/02/05 03:09 AM
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
Posted By: Gremel Re: Join random channel - 02/02/05 01:03 PM
thanks smile
© mIRC Discussion Forums