Maybe this will help you with "dynamically numbering" variable's names. The first part here shall demonstrate what method I used...
Code:
alias incvarname.demo {
set %ban.5 bnick5 bmask5
set %ban.3 bnick3 bmask3
set %ban.1 bnick1 bmask1
set %ban.2 bnick2 bmask2
; how many vars matching %ban.* do I have at all?
var -s %total = $var(%ban.*,0)
; whats the name of the last variable? (mIRC sorts them: "last" means alphanumeric highest, not "last added")
var -s %last = $var(%ban.*,%total)
; now I got that var's name, what was the number at the end of that variable?
; Note: that "6" depends on the variable name's length)
var -s %num = $mid(%last,6)
; and what number do I need now?
var -s %newnum = $calc(%num +1)
; so what new varname do I need?
var -s %newvar = $+(%,ban.,%newnum) some new data
unset %ban.*
}
this uses the method demonstrated above, but shortens it a lot
Code:
; syntax: /incvarset variable-root varable-data
; e.g. /incvarset ban. $iif(($bnick,$ifmatch,-none-) $bmask
alias incvarset {
if ($1) { set $+(%,$1,$calc($mid($var($+(%,$1,*),$var($+(%,$1,*),0)),$calc($len($1) +2)) +1)) $2- }
}