I have a variable of all my character names for this particular name.
I'm lazy. I'd rather sit here and spend 5 hours trying to figure out how to make one alias do all the work for me. Simply because that's the way I am, than just remove the name from the variable by hand.
I have the alias name *
I can successfully compare a new name to the namelist(I.E. A mushclient variable, that is also an array) If i type name <name> that is not in the list, it does nothing. Otherwise, it changes the variable "name" to the new selected name. This lets me switch characters easily, I don't need 5-6 different worlds customized to each character(Note: All characters hold most skills in common. Just the specialized skills vary depending on race). I can then only use 1 world, and just script in various "if" statements to keep things flowing easily.
I can also successfuly add a new name into the NameList variable(I.E. the array).
What I am currently working on is working on removing a name in the Variable NameList.
When I was testing the name removal script, I was using an alias "test" and manually setting up the remove name, just to see if it worked. That's how I did it to get name add <name> working.
The output you are seeing there is just a Note to the output buffer, It is the contents of the namelist array. I intentionally used a name that was not in the array.
This is the code for the script, Basically, what will happen is I'll have an elseif statement that matches on the LBound for remove, then it'll run this scriptnamelist = split(GetVariable("NameList"))
remname = "Jodah"
for i = LBound(namelist) to UBound(namelist)
if remname <> namelist(i) then
newlist = namelist(i) & " " & newlist
end if
next
Note newlist
First trigger of alias:
Relafen Frostonius Demonica
This is the second triggering of the alias(immediately afterwards):
Relafen Frostonius Demonica Relafen Frostonius Demonica
The third:
Relafen Frostonius Demonica Relafen Frostonius Demonica Relafen Frostonius Demonica
I was under the impression that every time an alias goes off it resets itself. Obviously, my impression is wrong.
Edit: Looking at the results, and thinking about it, The part that I'm missing is what to do in the loop if the remname = namelist(i)
Edit 2: The problem is at no point do I exit the for, so it'll keep running the for no matter how many times I run the alias. It looks to me, that I'm going to need to run a double loop!
One to build the new array, and one to set the new array and exit the for loop. because right now, it's just running in the for loop each time I trigger the alias. |