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
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Fri Mar 26, 2004 3:21 am   

DB Script Memo Style
 
Ok so I was toying around with the example scripts everyone has posted and they all work really well, I have it set up with triggers that capture name, type, damage, saves, blah blah blah. The problem is, my database just has too many darn fields...what I'd like to have is 3 fields 1)Name 2)ID 3)Zone. Is it possible to capture the whole block of text from the ID and store that into a memo field?

Here is a sample ID:
Object 'shield crested' is type armor, material steel.
Extra flags: none.
Weight is 20, value is 10, level is 25.
Armor class is 8 pierce, 8 bash, 8 slash, and 3 vs. magic.
Affects savingmaled by -1.
Affects savingaffl by -4.
Affects con by 1.
Rare item.

And This is How I want the Database:
Name: shield crested
ID: Object 'shield crested' is type armor, material steel.
Extra flags: none.
Weight is 20, value is 10, level is 25.
Armor class is 8 pierce, 8 bash, 8 slash, and 3 vs. magic.
Affects savingmaled by -1.
Affects savingaffl by -4.
Affects con by 1.
Rare item.
Zone: Dragon Tower

The name is captured from the ID, and the zone would be inputed manually. Is there a way to keep the variable storing data, which would be turned off by #trigger ^$, at the end of the ID?

Any help is appreciated
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Mar 26, 2004 5:37 am   
 
#TR {Object '(*)' is type} {#VAR dbase2 {};#T+ Database;#ADDK dbase1 Name {%1}}
#CLASS {Database} {disable}
#TR {Zone: (*)} {#ADDK dbase1 Zone {%1}}
#TR {(*)} {#IF %len( @dbase2) {#VAR dbase2 {@dbase2%{crlf}%1}} {#VAR dbase2 {%1}}}
#TR {^$} {#T- Database;#ADDK dbase1 ID {@dbase2};#IF %query( &Name = @dbase1.Name) {} {#NEW All @dbase2}}
#CLASS 0

Don't forget that the database must be open already.
Reply with quote
Darkspawn
Beginner


Joined: 18 Sep 2002
Posts: 15

PostPosted: Fri Mar 26, 2004 5:58 am   
 
That is exactly what I needed, works great!
As always LightBulb, YOU DA MAN!!
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