Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
lenaris
Newbie


Joined: 12 Dec 2005
Posts: 7

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


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Dec 13, 2005 1:26 am   
 
Check out
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=2164&start=10

There quite a bit of info how it all works.
Reply with quote
Nikodemus
Newbie


Joined: 29 Jul 2004
Posts: 2

PostPosted: 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?
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Fri Dec 16, 2005 4:21 am   
 
Here's one example, http://forums.zuggsoft.com/phpbb/viewtopic.php?t=13420&highlight=database+open
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
Nikodemus
Newbie


Joined: 29 Jul 2004
Posts: 2

PostPosted: Fri Dec 16, 2005 5:30 pm   
 
Thanks you so much, this seems to be exactly what I was looking for. :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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