|
kent Beginner
Joined: 03 Apr 2006 Posts: 29
|
Posted: Sat Jul 13, 2013 6:17 pm
Aliase and database |
Hello again,
What I am trying to do is create a weapons repair database using an aliase called, "weapon_repair"
#VAR weapons {sword|dagger|knife|axe|battleaxe|spear|lance|bow|longsword|Eldmarian} <- this is the database
#AL weapon_repair {locker remove forge;remove "repair" <- This is what is what is causing problems ;put @RepairWeapons forge;close forge}
#CLASS {MM_Weapon}
#VAR RepairWeapons {} {}
#TRIGGER "repair" {^({@weapons})$} {
RepairWeapons=%additem( %db( @weapons, "%1"), @RepairWeapons)
#SUB {%1 %ansi(gray)(queued: %db( @weapons, "%1"))}
}
#CLASS 0
these are the lines from the game:
You get Vandemaar's Magic Forge from your locker.
You do not have that item. <--- not reading the database or the #class {MM_Weapon}
Put what where?
Type 'HELP PUT' for more information.
Vandemaar's Magic Forge: It's already closed. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jul 13, 2013 7:07 pm |
Your code works as intended. The error in your logic is in the use of %db(), which in ZMud is used only for datarecord variables and the database (this is because the separator in a datarecord is not the pipe character). It cannot be used on stringlists. You need to use %item() and %ismember() instead.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|