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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Jan 11, 2007 2:05 am   

works in commandline but..
 
Code:
#if (@{%char~aq}.status = active) {gt active, but...}


or what i really want to do:
Code:
#switch (@{%char~aq}.status = waiting) {gt I must wait @{%char~aq}.time}
   (@{%char~aq}.status = ready) {gt I can start a quest now!}
   (@{%char~aq}.status = active) {gt active, but...}


both the above works in the command line, but put into an alias, it wont do anything..


If I try..
Code:
say @{%char~aq}.status
in the command line it outputs the correct item to the mud..

but if it put
Code:
say @{%char~aq}.status
#switch (@{%char~aq}.status = waiting) {gt I must wait @{%char~aq}.time}
   (@{%char~aq}.status = ready) {gt I can start a quest now!}
   (@{%char~aq}.status = active) {gt active, but...}
as the alias, my character says nothing.

please help :)
granted database vars are new to me.. perhaps there is a function i should be using instead.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Jan 11, 2007 2:19 pm   
 
It's possible that ~ is being used to quote out the a character in one situation but not the other - I assume you're trying to use it as a break between the %char variable and the aq on the end. That's not the proper way to do that, so it might be causing problems. Try using %concat(%char,"aq") or %concat(%char,"~aq"), whichever you were trying to do.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Jan 11, 2007 6:33 pm   
 
thanks for your response fang. you are correct i was trying to concat %char and aq into "@bobaq.status" for example.

#if (@{%concat(%char,"aq")}.status = active) {gt active, but...}

or

#if (@{%concat(%char,"~aq")}.status = active) {gt active, but...}

gives unmatched parenthesis error and does not work through the commandline
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Jan 11, 2007 8:27 pm   
 
To test this, I created a test session called Test with a character name Test. #say %char confirmed that this had worked. I created a variable called @testaq with a key, status, containing the value "active". #say @testaq.status gave the expected response.

#say @{%concat(%char,"aq")}.status gave this output

statusactive.status

but I believe this is due to incorrect usage of the @{} syntax - the whole variable, including the keyname, has to be enclosed in the brackets. So then I tried:

#say @{%concat(%char,"aq").status} and
#say @{%concat(%char,"aq.status")}

both gave no response with no error feedback. This might be due to var.key syntax and @{} interacting buggily since @{testaq.status} also gave no feedback - anyone else have a problem with it?

I was going to suggest %db as an alternative, but even

#say %db(testaq,status)

gave no feedback as well.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 12, 2007 1:28 am   
 
Try #SAY %db(@{%{char}aq},"status")

It should be totally correct syntax, but I can't quite test it right now.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Fri Jan 12, 2007 2:16 am   
 
Thanks for the reply.

#SAY %db(@{%{char}aq},"status")

Does not work, no feedback again.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jan 12, 2007 6:19 am   
 
#say %db(@testaq,status) works, but

#say %db(@{%{char}aq},status)
#say %db(@{%concat(%char,"aq")},status)

both don't. Quotes around "status" make no difference.
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Fri Jan 12, 2007 7:02 am   
 
So I know you said @{%char~aq}.status would be wrong... this alias solves all my problems from above..

Code:
#switch (%db(@{%char~aq},status)="ready") {gt I am ready for a quest!!}
   (%db(@{%char~aq},status)="waiting") {gt I must wait @{%char~aq}.time ~ticks!!}
   (%db(@{%char~aq},status)="active") {gt active quest}
   (%db(@{%char~aq},status)="complete") {gt I have a complete quest!!}
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jan 12, 2007 10:31 am   
 
That does actually work. That's very bizarre indeed. I definitely think there's a bug here, anyway.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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