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
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: 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)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

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


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: 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!
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: 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)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 08, 2007 3:29 am   
 
The format you're looking for is this: @{moods.@currentmood} or this: %db(@moods,@currentmood)
_________________
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