Hello, what you need is called genericity, you can't just write all condition for $2 going from 1 to N litterally or your code would be very long very quickly!
In your code, you have some part which are repeating a lot.
A simple example is:

Code:
alias test {
if ($1 == 1) dosomething 1
elseif ($1 == 2) dosomething 2
..
elseif ($1 == 8) dosomething 8
}

Well why not just calling /dosomething $1 as long as $1 is between 1 and 8?
that would give:

Code:
alias test {
if ($1 isnum 1-8) dosomething $1
}
And you get one line of code handling a various numbers of situations.




Code:
if ($2 == 1) {
  var %qr1 $rand(1,2)
  if (%qr1 == 1) {
     splay %soundquotes $+ q1-1.mp3
  }
  else {
    splay %soundquotes $+ q1-2.mp3
  }
}
elseif ($2 == 2) {
  var %qr2 $rand(1,4)
  if (%qr2 == 1) {
    splay %soundquotes $+ q2-1.mp3
  }
  elseif (%qr2 == 2) {
    splay %soundquotes $+ q2-2.mp3
  }
  elseif (%qr2 == 3) {
    splay %soundquotes $+ q2-3.mp3
  }
  else {
    splay %soundquotes $+ q2-4.mp3
  }
}
...
Here, no matter what is the value of $2 (you are checking that $2 is 'alnum', but you probably want it to be 'isnum', since you are only expecting numbers), you're always going to call $rand with 1 as the first parameter, and no matter what's the value of that $rand, you will always call /splay, were the parameters of /splay are passed according to that number $2 (predictable)
So we need to predict the second parameter of $rand based on $2, this is pretty simple: $2 goes from 1 to N, so we can make a list of number for $rand and access the $2th element in that list, when $2 is 1, your second parameter for $rand is 2, so first element is 2, for $2 == 2, you have $rand = 4, so second element is 4, and so on.
The parameter for /splay is %soundquotes $+ q1-1.mp3 for $2 == 1 and $rand == 1, so clearly we can create the parameter based on $2 and $rand: %soundquotes $+ q $+ $2 $+ - $+ $rand() $+ .mp3

Code:
if ($2 isnum 1-LIMIT) {
var %listforrand 1 2 3 2
var %qr1 $rand(1,$gettok(%listforrand,$2,32))
splay %soundquotes $+ q $+ $2 $+ - $+ %qr1 $+ .mp3
much shorter right? and now the only thing you need to do to add more cases for $2, is to define the number in %listforrand


#mircscripting @ irc.swiftirc.net == the best mIRC help channel