|
lenaris Newbie
Joined: 12 Dec 2005 Posts: 7
|
Posted: Mon Dec 12, 2005 1:45 am
DB Scripting Help Request |
Hi all. I'm having a little trouble getting my head around the scripting process, mainly because I'm inexperienced with the syntax.
Here is the output when I recite identify an item:
You feel informed:
Object 'dwarven ring', Item type: ARMOR
Item is: ANTI-NEUTRAL NOBARD
Weight: 1, Value: 10000, Minimum Level: 0
This piece of armor will improve your AC by 2 points.
Can affect you as :
Affects: HITROLL By 1
Affects: DAMROLL By 1
At first I just wanted to see if I could capture the item name and item type
(ring, shield, weapon, etc.)
Here's the code I tried based on the following tutorial: http://www.silverbridge.org/~varmel/zmud/tutorials/zmuddb.htm
#CLASS {identify}
#TRIGGER {You feel informed:
Object: &{item.name}, Item type: &{item.ItemType} {}
#TRIGGER {$} {
#if (%find( @item.name) = "") {#new "" @item}
item = ""
#t- identify
}
#CLASS 0
#ALIAS identify {
#t+ identify
rec identify %1
}
Would someone be so kind as to tell me how I'm messing up? I think part of it has to do with me not including the appropriate line break in the trigger. If you could post an example code from start to finish (including creating the identify class, that would be a huge help. Thank you very much! |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
|
|
|
Nikodemus Newbie
Joined: 29 Jul 2004 Posts: 2
|
Posted: Thu Dec 15, 2005 10:33 pm |
I'm just going to rudely hijack this thread for my own question. :)
Have I understood correctly that it's not possible to do anything at all with the DB unless you've clicked it open from the menu window? Is there a way to open it or check whether it's open from the command line or a script? |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
|
|
|
Nikodemus Newbie
Joined: 29 Jul 2004 Posts: 2
|
Posted: Fri Dec 16, 2005 5:30 pm |
Thanks you so much, this seems to be exactly what I was looking for. :)
|
|
|
|
|
|