Doesn't the use of "ialmark" here conflict with your realname script ?
I use ialmark a lot in my personal scripts and I've found it much easier to manage storing items in their own field using a delimiter. ie. realname=fred | access=friend | nicknames=fred joe ted bill | etc.
Here is a basic alias that checks for an item= and edits or creates it using =value. This uses ascii 01 as a delimiter, but this is just an example.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Usage /ialmark_ nickname item value(s) go here.
;Or $ialmark_(nickname, item) <--Will return the value of item if it exists.
alias ialmark_ {
var %item $2
if ($isid) {
if ($regex($ial($1).mark,/ $+ %item $+ =([^\x01]*)/i)) return $regml(1)
}
else {
var %value $3-
if (!$regex($ial($1).mark,/ $+ %item $+ =[^\x01]*/i)) {
.ialmark $1 $addtok($ial($1).mark,$+(%item,=,%value),1)
}
else {
.ialmark $1 $regsubex($ial($1).mark,/( $+ %item $+ =[^\x01]*)/i,$+(%item,=,%value))
}
}
}
I find it much easier to manage this way. I'm sure there are many other ways to manage ialmark so it can be used by multiple scripts.