 |
darmir Sorcerer

Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Fri Dec 07, 2007 9:32 pm
Accessing Database Questions |
I was looking around and I am going to use a database variable for a new script, but how do you access them correctly.
Okay I created this:
#ADDKEY mood excited 1
#ADDKEY mood calm 2
#ADDKEY mood normal 3
Now in my script I am going to have a alias the checks for the name field "excited, calm , normal". How do I find out what number is associated with the name? |
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Fri Dec 07, 2007 10:00 pm |
Generally you would use %db(@Mood,something) to look into the record variable. I might be able to suggest a few alternative methods, based on the currently underlying beta format. I would have to know more about what your are really looking to do with with the data to suggest a "best use" method.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Tech GURU

Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Dec 07, 2007 10:16 pm |
Or you can do something like this as well.
#show @mood.normal
You can also check out Database Variables. |
|
_________________ Asati di tempari! |
|
|
 |
darmir Sorcerer

Joined: 10 Oct 2000 Posts: 706 Location: USA
|
Posted: Sat Dec 08, 2007 3:12 am |
| Vijilante wrote: |
| Generally you would use %db(@Mood,something) to look into the record variable. I might be able to suggest a few alternative methods, based on the currently underlying beta format. I would have to know more about what your are really looking to do with with the data to suggest a "best use" method. |
What I am trying to do is give another variable on the stutter script for moods.
If the mood is calm then it will use a 1. I need to check for the value associated with the name.\
Example: stutter excited say Blah Blah Blah.
So in the stutter script I want to change
| Code: |
#IF (%random( 1, 3)=1) {
|
to
| Code: |
#IF (%random( 1, @moods.@currentmood)=1) {
|
|
|
_________________ Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian) |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 08, 2007 3:29 am |
The format you're looking for is this: @{moods.@currentmood} or this: %db(@moods,@currentmood)
|
|
|
|
 |
|
|
|