|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: Fri Jan 12, 2007 2:16 am |
Thanks for the reply.
#SAY %db(@{%{char}aq},"status")
Does not work, no feedback again. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: 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!!} |
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
|
|