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
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Tue Aug 13, 2002 1:58 am   

Database issue (round 2)
 
I've been banging my head against this for the longest, so I'm really hoping you guys can help me on this one. It's been very frustrating to me.

Basically this is a trigger to allow other players to query my 'armour' database, and pull up the AC values (Edged,Blunt,Fire,Ice etc). This is my script exactly:

TRIGGER: (%w) tells you: qdb (*)

#VARIABLE qrequestor %1
#VARIABLE qitem "%2"
#VARIABLE qresults %find( "%2", armour, type)
#VARIABLE qitems %numitems( %find( "%2", armour, type))
#IF (@qitems) {} {tell @qrequestor ERROR: @qitem was not found. ant to help me add it?}
#IF (@qitems>1) {tell @qrequestor ERROR: Too many items returned. Narrow search.}
#IF (@qitems=1) {reveal %expand( @qresults) tell %expand( @qrequestor)}

reveal (in the last line) is an alias. Here's it's script:

#EXECUTE {%2 %3 @%1.Name - Ed:@%1.Edged Bl:@%1.Blunt Fi:@%1.Fire Ic:@%1.Ice Ac:@%1.Acid Mi:@%1.Mind Po:@%1.Poison - Last Updated:@%1.Date}

Now everything works correctly EXCEPT the date (which is weird, because i only added the date AFTER i got the rest of the script working) and the date ONLY falters when the trigger calls it. example would be:

reveal 10ar tell noah
DOES:
tell noah Crimson Gloves - Ed:12 Bl:12 Fi:0 Ic:12 Ac:0 Mi:0 Po:0 - Last Updated:2002.08.12

However, when the trigger above calls it, I get the following:

tell noah Crimson Gloves - Ed:12 Bl:12 Fi:0 Ic:12 Ac:0 Mi:0 Po:0 - Last Updated:@10ar.Date

Notice the Last Updated :(
Please help me .. I can't figure out what's wrong. Maybe there is a better way to do this whole thing?

Father Horks
The only problem with computer security, is when you think it exists.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Aug 13, 2002 3:54 am   
 
Simple list of changes, I am sure you can figure where they belong.

#IF (@qitems=1) {#DBGET @qresults;reveal}

#AL reveal {tell @qrequestor %rec.Name - Ed:%rec.Edged Bl:%rec.Blunt Fi:%rec.Fire Ic:%rec.Ice Ac:%rec.Acid Mi:%rec.Mind Po:%rec.Poison - Last Updated:%rec.Date}

Explicit expansion is not required as it is automatically implied.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Aug 13, 2002 7:13 pm   
 
Perhaps if you add a space at the end? I notice that the same syntax works for the rest of the line and that's the only difference I can see.
#EXECUTE {%2 %3 @%1.Name - Ed:@%1.Edged Bl:@%1.Blunt Fi:@%1.Fire Ic:@%1.Ice Ac:@%1.Acid Mi:@%1.Mind Po:@%1.Poison - Last Updated:@%1.Date }

LightBulb
Senior Member
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