The idea is the same, but you can't just use $gettok the same, because you have more than one information per level.
In this case you can associate the triggers (I hate that people call it a command) with the level, using multiple variable and counting on the fact that level N has access to all triggers between 10 and N:
Since I don't know exactly how to associate (I guess it's one trigger per level), I'll show you an example with several triggers per level, also, it's always a better idea to use a space as the seperator in your list, in any case, using comma is a bad idea because comma delimit the parameters of $identifier: $identifier(param1,param2), even if you have to put the comma back for display purpose
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 %sounds10 !chicken !elementalcohesion
var %sounds11 !nonono !igottheboons !bane !moo
var %sound12 !pewpew !elephant
var %sound13 !monkey !toot !doom !babyfart !matingcall
;you have to keep this if statement because 9 and others level don't share the same code, also i think you want to use <=, otherwise level 9 wouldn't get an answer.
if ($ulevel <= 9 ) {
msg $chan you are $ulevel and have no sound commands.
}
else {
;so if it's greater than 9, we are going to 'keep' (this is the while loop) looking for a variable that is %sound<level>, starting at level $ulevel:
var %level $ulevel
while ($eval($+(%,sounds,%level),2) != $null) {
; no need to escape : with $chr(58) here
msg $chan $nick $+ : $v1
inc %level
}
}
}
So let's say %level start at 10, $+(%,sounds,%level) is the litteral text %sounds10, $eval(,2) will evaluate one more time to produce the value of the variable.
$v1 refers to the last 'first operand' used in a conditional statement, here, it refers to the value of that while ().
Of course, this is actually sending one message 'per' level that the user can access, if you want one message for all, you just keep adding the triggers to a variable and you send that at the end:
else {
var %level $ulevel,%result
while ($eval($+(%,sounds,%level),2) != $null) {
; no need to escape : with $chr(58) here
%result = %result $v1
inc %level
}
msg $chan $nick $+ : %result
}