It's ColourNote not colournote.
Something like this should do it. Using a Lua table is easily the easiest.
<aliases>
<alias
match="^addname( \w+)?$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
require "serialize" -- needed to serialize table to string
local name = Trim ("%1")
if name == "" then
ColourNote ("orange", "", "Usage: addname (name)")
return
end -- if no name
name = string.lower (name) -- case-insensitive
-- get friends variable (de-serialize the client variable)
assert (loadstring (GetVariable ("friends") or "")) ()
friends = friends or {} -- make sure table exists
-- check already in list
if friends [name] then
ColourNote ("orange", "", "Name " .. name .. " is already in list of friends")
return
end -- if already known
-- add to table
friends [name] = true -- now in list
-- serialize the table so it will be saved with the world file
SetVariable ("friends", "friends = " .. serialize.save_simple (friends))
-- tell the user it worked
ColourNote ("orange", "", "Name " .. name .. " added to list of friends")
</send>
</alias>
</aliases>
What this does is look for "addname" followed by a word (letters, numbers or underscore). You might need to amend that if names have spaces or other stuff in them.
Then it de-serializes the "friends" variable (which is saved along with the world file) and adds the name to it, if it isn't there already. Then it re-serializes the variables.
This way friends will persist across MUSHclient sessions.
Now for the trigger:
<triggers>
<trigger
enabled="y"
match="* tells you *"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>
local name = Trim ("%1")
name = string.lower (name) -- case-insensitive
-- get friends variable
assert (loadstring (GetVariable ("friends") or "")) ()
friends = friends or {} -- make sure table exists
if friends [name] then
ColourNote ("white", "", "From %1 - %2")
else
ColourNote ("red", "", "%1 tells you %2")
end -- in table
</send>
</trigger>
</triggers>
Once again the variable is de-serialized into a table, and then it is compared to %1 in the trigger. By using string.lower the friend names are not case-sensitive. The trigger omits from output so you don't see the tell twice.