Hey! I think that this script would work exactly as you want it but i cant test it now cause im not on PC.
The coincedence is that i recently wrote a small alias that returns random letters of the English alphabet
alias ralph {
set %alphabet a b c d e f g h i j k l m n o p q r s t u v w x y z
return $gettok(%alphabet,$rand(1,$numtok(%alphabet,32)),32)
}
In case you havent tried token identifiers before ill try explaining what i did
So.. we have %alphabet , the letters are seperated with a $null . To use token identifiers you need to find the ascii number of the char that devides your tokens.
In our case $null is 32.
So let's suppose you want to get the 5th letter in %alphabet .
$gettok(%alphabet,5,32)
The first parameter is always the text you want to edit/use.
In our case this is %alphabet .
The second parameter is the Nth token or Nth-Nth . That means you can also get the tokens 5 to 6 this way: $gettok(%alphabet,5-6,32)
The third parameter is the ascii number.
So.. now that we explained $gettok . Let's go to $numtok .
$numtok format goes like this: $numtok(%alphabet,32) .2 parameters only.
The 1st parameter is again the text we want to edit/use.. and the 2nd one is the ascii number. It returns the total number of tokens in %alphabet that are seperated by $null which is 32 in ascii numbers.
Now that we have seen both of the identifiers i used. Let's see how i used them to get what we want. A random letter.
$gettok(%alphabet,$rand(1,$numtok(%alphabet,32)),32)
So basically it's pretty simple now ha?
$rand(1,$numtok(%alphabet,32)) will return a random number between 1 and he total number of tokens seperated with $null (32) .
$gettok does the rest of the work.
I hope this was a nice tutorial!
Tokens are awesome. Take advantage of them.
Other token identifiers: $remtok , $deltok , $wildtok , $addtok , $instok , $istok
Try learning them through mIRC Help Files.
Good Luck!!
-OrFeAsGr-