|
Treant99 Newbie
Joined: 27 Jul 2002 Posts: 7 Location: USA
|
Posted: Wed Feb 18, 2004 9:15 am
Database Scripting |
Hi, I've never done a database script or any script for that matter just yet. I'm using the new zMUD V 7.01 and I was hoping someone may be able to point me in the right direction (help me with a starting point) on making a database script so when I identify something it automatically puts the items into the database.
Here are some sample identifies from Mystic-adventure the mud I intend to use it for.
Object 'eyes emperor' is type armor, extra flags glow magic anti-good anti-neutral.
Weight is 2, value is 0, level is 91.
Armor class is 19.
Worn:Takeable Eyes
Affects detect invis by 19.
Affects detect hidden by 44.
Affects mana by 150.
Affects hp by 150.
Affects strength by -2.
Affects dexterity by -2.
Affects constitution by -2.
Object 'blind man's staff' is type weapon, extra flags dark magic.
Weight is 4, value is 350000, level is 93.
Damage is 24 to 74 (average 49).
Proficiency needed for the weapon is: normal
Type of damage: crush
Affects mana by 150.
Affects damage roll by 15.
Affects hit roll by 20.
Affects save vs paralysis by -10.
Affects save vs rod by -10.
Affects save vs poison by -10.
Affects save vs breath by -10.
Affects save vs spell by -10.
Object 'dark spellbook scroll' is type scroll, extra flags dark magic nodrop.
Weight is 3, value is 2000, level is 65.
Level 98 spells of: 'Wall of bones' 'stone skin' 'Combat mind'
Object 'stone path finder pathfinder' is type staff, extra flags glow hum evil magic anti-good.
Weight is 5, value is 500000, level is 64.
Has 9(9) charges of level 81 'Sphere of translucidity'
I tried reading the help files but they get confusing after a point.
Thanks in advance.
Treant |
|
|
|
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Thu Feb 19, 2004 5:58 pm |
quote: Originally posted by Treant99
Hi, I've never done a database script or any script for that matter just yet. I'm using the new zMUD V 7.01 and I was hoping someone may be able to point me in the right direction (help me with a starting point) on making a database script so when I identify something it automatically puts the items into the database.
Here are some sample identifies from Mystic-adventure the mud I intend to use it for.
Object 'eyes emperor' is type armor, extra flags glow magic anti-good anti-neutral.
Weight is 2, value is 0, level is 91.
Armor class is 19.
Worn:Takeable Eyes
Affects detect invis by 19.
Affects detect hidden by 44.
Affects mana by 150.
Affects hp by 150.
Affects strength by -2.
Affects dexterity by -2.
Affects constitution by -2.
Object 'blind man's staff' is type weapon, extra flags dark magic.
Weight is 4, value is 350000, level is 93.
Damage is 24 to 74 (average 49).
Proficiency needed for the weapon is: normal
Type of damage: crush
Affects mana by 150.
Affects damage roll by 15.
Affects hit roll by 20.
Affects save vs paralysis by -10.
Affects save vs rod by -10.
Affects save vs poison by -10.
Affects save vs breath by -10.
Affects save vs spell by -10.
Object 'dark spellbook scroll' is type scroll, extra flags dark magic nodrop.
Weight is 3, value is 2000, level is 65.
Level 98 spells of: 'Wall of bones' 'stone skin' 'Combat mind'
Object 'stone path finder pathfinder' is type staff, extra flags glow hum evil magic anti-good.
Weight is 5, value is 500000, level is 64.
Has 9(9) charges of level 81 'Sphere of translucidity'
I tried reading the help files but they get confusing after a point.
Thanks in advance.
Treant
This is pretty icky to explain in a post. Please take a look at http://www.zuggsoft.com/zmud/help6/Crea0193.htm and then ask questions about stuff you don't understand there. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Feb 19, 2004 9:46 pm |
The first step isn't making the script, it's making the database structure.
You should start by getting a wide variety of identify's so that you can see what information is available from them. You must then decide what information you want recorded in the database and how to organize it. For instance, some people might prefer to have all the affects listed in a single field, of type memo or text, while others might want to have an individual field for each possible affect which means they have to know first what all the possible affects are. Still other people might only be interested in selling the equipment to raise money and only need to know its name and value, and possibly its weight. Obviously, nobody else can know what information will be of use to you or what would be the most useful way for you to organize it, and therefore you are the one who must design your own database.
Database scripts actually involve somewhat advanced triggers. It would probably be better to start with simpler triggers, such as something to eat automatically when you get hungry or to pick up your weapon and wield it when you get disarmed. Once you have a fair understanding of how triggers work, you can start creating your own database script. You will need your own script, rather than a ready-made one, because the script needs to use the same fieldnames that you used in your database and needs to record the information in the same format that you chose for each field. You can't put a string into a numeric field, for instance.
A database script uses triggers (#TRIGGER) to do the data-entry automatically. They usually use #ADDKEY to store the information to a record-variable and #NEW to store the variable's information to the database. You can find many database scripts on this forum and in the Finished Scripts forum to use as examples in making your own. There is also an entire section of the zMUD helpfiles dedicated to databases. You can find it by going to the help's Contents page, then opening the Getting Started booklet. Near the bottom of the expanded section you'll find the Introduction to the Database booklet. |
|
|
|
|
|
|
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
|
|