Hum maybe I wasn't clear but the method I used was meant to allow you not to repeat the triggers: a level N (that is > 9) already access all the triggers of the levels 10 to N
mIRC doesn't have array, but this is actually our way of creating arrays, it's exactly the same and for the level N, we access all the next element in the array, N, N + 1 etc, until there is no more element in the array.
mIRC doesn't have switch either, it was requested but we don't need that, if / elseif already does the job fine.
on *:text:!sounds:#:{
;if ((%floodsounds) || ($($+(%,floodsounds.,$nick),2))) { return }
;set -u10 %floodsounds On
;set -u30 %floodsounds. $+ $nick On
;Update as more sound commands are added.
;Need to work on shortening this one.
var %sound10 !chicken
var %sound11 !elementalcohesion
var %sound12 !nonono
var %sound13 !igottheboons
var %sound14 !bane
var %sound15 !moo
;etc...
;Go all the way to rank 50 for the maximum just incase. (correspond this with the ranks that you actually gain the audio commands.)
;don't you want <= 9 here instead of < 9)? see my previous post!
if ($ulevel < 9 ) {
msg $chan you are $ulevel and have no sound commands.
}
else {
;msg $chan $nick $+ $chr(58) $gettok(%sounds,1-13,44)
var %level $ulevel,%result
while ($eval($+(%,sound,%level),2) != $null) {
; no need to escape : with $chr(58) here
%result = %result $v1
inc %level
}
msg $chan $nick $+ : %result
}
}
That being said, if each new level means strictly one more trigger, then you can use the $gettok method, which is also basically reproducing an array access.