Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kent
Beginner


Joined: 03 Apr 2006
Posts: 29

PostPosted: 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.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net