|
Vaserian Newbie
Joined: 14 Dec 2003 Posts: 4 Location: USA
|
Posted: Sun Dec 14, 2003 4:42 pm
Help with database basics. |
Okay i will come out and say that i am by no means a good or experienced scripter. The majority of my learnings come from reading help files. What i am trying to do is create a database that automatically records all my character's statistics. I am not going to bore you with the details, because that's not why i'm here. I wish to learn how to do this.
At any rate i have read every help file i could find and did a pretty intensive search of the forums for info on this and can't seem to find anything. So what i really need is an example of how to input information into a database. A simple trigger. I'll even line you up with a scenario:
You look at Bob
Bob's level is 23
Say i have database xyz.db (dbd?) with the fields name and age. All i want is when my mud gives me the above text that it sticks 'Bob' in the 'name' field and '23' in the 'age' field.
Yes this is my big dilemma, i just can't seem to get the information transfer through my head and can't find out how to make it work. So sue me. I am fairly certain that once i understand the syntax of the very basics it will make sense to me. Thanks in advance! |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 14, 2003 5:29 pm |
#TR {(%w)'s level is (%d)} {#NEW "" name=%1 age=%2}
|
|
|
|
Hilton Newbie
Joined: 14 Dec 2003 Posts: 4 Location: Canada
|
Posted: Sun Dec 14, 2003 6:16 pm |
Okay, this is the FOURTH time I'm writing this, thanks to the forum repeatedly buggering up my login...
You may want to consider a conditional trigger, particularily if you have to save more than one line, as you likely do. Consider:
#TRIG {You look at (&%wnew.name)$} {#CW red}
#COND {^%w's level is (&%dnew.age)} {#CW red}
#COND {^%w is wearing (&db.clothes)} {#CW red}
#COND {^~<*hp~>} {#NEW "" @new; #VAR new {}}
Now, each piece of data is saved directly to a record variable called "new" (@new), and each matching line is colored red (just to let you know it worked).
At the end, I placed a generic trigger to match a mud prompt (change to suit your needs), which saves the variable to the DB, and resets the variable. |
|
|
|
|
|
|
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
|
|