|
myddrun Wanderer
Joined: 31 Mar 2005 Posts: 58
|
Posted: Wed Feb 10, 2010 1:57 pm
Selecting a variable which has the same name as a value in another variable. |
I think I've found a problem I can't solve on my own. *grins*
I have string list variables for each online player that holds both their race and guild.
eg Myddrun = Elf|Wizard (but this could be any combination of race and guild)
I also have lists of names contained in variables for each race and guild.
eg
Elf: name1|name2|name3|Myddrun
Wizard: name4|name5|Myddrun|name6
What I'm trying to do is delete a player that logs out from their coresponding race and guild lists.
In psuedo code speak
Code: |
Trigger ~[Myddrun leaves the Realms of the Dragon~]
Delete the name "Myddrun" from the 2 different lists who's names are stored as values in the variable called "Myddrun". |
I've tried various combo of #var, #delitem, %pop, %delitem but nothing seems to work.
In short I'm stuck. Any body have any ideas? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Wed Feb 10, 2010 2:48 pm |
make another string list containing all the varnames for race/guild
#TR { (%w) leaves the Realms of the Dragon} {#FORALL @varNameList {#DELITEM %i %1}} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
myddrun Wanderer
Joined: 31 Mar 2005 Posts: 58
|
Posted: Wed Feb 10, 2010 5:08 pm |
Hehe, trust me to make life complicated. That's a far more elegant solution!
Thanks Shalimar!
*tips hat and sends the virtual beer round* |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Wed Feb 10, 2010 10:08 pm |
Actually, now that i see you have a var for each player as well you could change that to:
#FORALL @{%1} {#DELITEM %i %1} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
myddrun Wanderer
Joined: 31 Mar 2005 Posts: 58
|
Posted: Thu Feb 11, 2010 3:45 pm |
It's a moot point now as I've already changed my code :)
I'll continue tol use your first suggestion as it ultimately cuts down the number of variables I have to store. Thanks any way though. |
|
|
|
|
|