|
Panpardus Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Fri Feb 16, 2007 1:02 pm
Help with a db command |
Ok i have an alias lets call it 'away' and it needs to work in reference with a DB var and another variable
Firstly the databases are all names of people with a few stats in them
eg Bob is the name of the database and it has class and number keys
for bob class =monk and number = 1234 for the database Jim class= mage and number =9876
This is the tricky part for me
Now if i have Bob as my target (@tar=bob) and i type 'away' i want the alias to go "put @bob.number in pack", if i have Jim targeted then i wan't it to go "put @jim.number in pack"
how do i get it to do this besides from having an IF for every possible name
like i dont want to go #if (@tar= "bob") {put @bob.number in pack} as there could be 2000 names. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Feb 16, 2007 1:31 pm |
Either of these will work:
#alias away {put @{@tar}.number in pack}
#alias away {put %db(@{@tar},number) in pack} |
|
|
|
Panpardus Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Fri Feb 16, 2007 2:53 pm |
Thanks
|
|
|
|
|
|