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
rezo247
Newbie


Joined: 06 Nov 2009
Posts: 4

PostPosted: Fri Nov 06, 2009 6:01 pm   

Equipment Database help Zmud 7.21
 
I'm trying to create an equipment database for items that I identify and I am having no luck. I need to be able to retrieve the items from the database in a readable out as well
The output I need to extract from and also be able to pull from looks like the following:

You feel informed:
Object 'scalpel laser', Description: 'a laser scalpel', Item type: WEAPON
Wearable Locations: TAKE WIELD
Item is: GLOW ADVANCED ELOG
Weight: 5, Value: 10000
Condition: Perfect
Num of attacks: 3x
Type: PIERCE
Minimum Level: None.
Bane Strength: Pathetic
Damage Dice is '6D6'
Can affect you as :
Affects : HITROLL By 7
Affects : DAMROLL By 7

You feel informed:
Object 'shell turtle', Description: 'A Turtle Shell', Item type: ARMOR
Wearable Locations: TAKE BODY
Item will give you following abilities: SANCTUARY PARRY
Item is: INVISIBLE LIMITED NO-IDENT ADVANCED RESIST-PIERCE ELOG
Weight: 20, Value: 19264
Condition: Excellent
Minimum Level: None.
Bane Strength: Pathetic
AC-apply is 20
Can affect you as :
Affects : DAMROLL By 6
Affects : HIT By 100

You feel informed:
Object 'Force Power', Description: 'The Power of the Force', Item type: ARMOR
Wearable Locations: TAKE RUNE
Item will give you following abilities: DETECT-MAGIC
Item is: GLOW HUM MYSTICAL LIMITED ELOG MASTERPIECE
Weight: 1, Value: 1
Condition: Perfect
Minimum Level: 15 Advanced Class.
Bane Strength: Pathetic
AC-apply is 16
Can affect you as :
Affects : DAMROLL By 4
Affects : HITROLL By 5

You feel informed:
Object 'staff arcane druids long', Description: 'the Arcane Staff of Druids', Item type: STAFF
Wearable Locations: TAKE HOLD
Item will give you following abilities: HOLY
Item is: ARTIFACT
Weight: 1, Value: 1
Minimum Level: None.
Bane Strength: Pathetic
Has 10 charges, with 10 charges left.
Level 20 spell of:
miracle
Can affect you as :
Affects : SAVING_SPELL By -5
Affects : INT By 5

You feel informed:
Object 'tonic potion', Description: 'A Tonic', Item type: POTION
Wearable Locations: TAKE
Item is: NO-IDENT
Weight: 1, Value: 55000
Minimum Level: None.
Bane Strength: Pathetic
Level 50 spells of:
heal
heal
cure critic

-----------------------------------------------
Don't know which is the better way to do it. Put it all into a single database or multiple databases by Item Type.

Any help creating this script is greatly appreciated. If you play Northern Crossroads (toothpick.lyle.org:9000)
or even if you never haveLevel 50 character fully leveled up on this Diku mud in exchange for the creation of
this inventory system.

Thanks,
Rezo
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Fri Nov 06, 2009 7:31 pm   
 
Code:
#CLASS Database
#var eqobject {}
#var eqdesc {}
#var eqtype {}
#var eqlocs {}
#var eqitemis {}
#var eqweight {}
#var eqvalue {}
#var eqcond {}
#var eqnumattacks {}
#var eqdamtype {}
#var eqminlevel {}
#var eqdamdice {}
#var eqeffects {}
#var eqitemabilities {}
#var eqacapply {}
#TRIGGER {^You feel informed:} {#DBLOAD eq;#var eqobject {};#var eqdesc {};#var eqtype {};#var eqlocs {};#var eqitemis {};#var eqweight {};#var eqvalue {};#var eqcond {};#var eqnumattacks {};#var eqdamtype {};#var eqminlevel {};#var eqdamdice {};#var eqeffects {};#var eqitemabilities {};#var eqacapply {};#wa 500;addrecord} "Database"
#TRIGGER {^AC~-apply is (%d)} {#var eqacapply %1} "Database"
#TRIGGER {^Affects~ ~: (*)} {#var eqaffects  %additem(%1,@eqaffects)} "Database"
#TRIGGER {^Bane Strength~: (%w)} {#var eqbanestr %1} "Database"
#TRIGGER {^Condition~: (%w)} {#var eqcond %1} "Database"
#TRIGGER {^Damage Dice is ~'(*)~'} {#var eqdamdice %1} "Database"
#TRIGGER {^Item is~: (*)} {#var eqitemis %1} "Database"
#TRIGGER {^Item will give you following abilities~: (*)} {#var eqitemabilities %1} "Database"
#TRIGGER {^Minimum level~: (*).} {#var eqminlevel %1} "Database"
#TRIGGER {^Num of attacks~: (%d)x} {var eqnumattacks %1} "Database"
#TRIGGER {^Object~ ~'(*)~'~, Description~: ~'(*)~'~, Item type~:~ (%w)} {#var eqobject %1;#var eqdesc %2;#var eqtype %3} "Database"
#TRIGGER {^Type~: (%w)} {#var eqdamtype %1} "Database"
#TRIGGER {^Wearable Locations~: (*)} {#var eqlocs %1} "Database"
#TRIGGER {^Weight~: (%d)~, Value~: (%d)} {#var eqweight %1;#var eqvalue %2}
#ALIAS addrecord {#NEW eq {Object=@eqobject|Desc=@eqdesc|Type=@eqtype|Locs=@eqlocs|Itemis=@eqitemis|Weight=@eqweight|Value=@eqvalue|Cond=@eqcond|NumAttacks=@eqnumattacks|Damtype=@eqdamtype|MinLevel=@eqminlevel|Damdice=@eqdamdice|Effects=@eqeffects|Abilities=@eqitemabilities|AcApply=@eqacapply};#DBSAVE} "Database"


This should be a good start for you. Use your friends #FIND #QUERY %find %query and I'm not sure if %expanddb exists in zMUD (This was developed on CMUD) but you could use something like #SHOW %expanddb(@databasevar,%crlf,": ") to neatly display your result. Let me know if there are any compatibility issues. Other info like spells and charges you'll have to add in manually as I can't think of any EASY way to do it.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
rezo247
Newbie


Joined: 06 Nov 2009
Posts: 4

PostPosted: Sat Nov 07, 2009 1:09 pm   Eq Database
 
1. Problem is on a single word is being captured for each field.
For example:
Item is: GLOW INVISIBLE LIMITED ADVANCED ELOG ARCHMAGE DRUID MASTERPIECE WARLOCK
is only capturing GLOW.
2. How can I output this captured data or pull it from the database?
3. How come the next two lines after "Can affect you as :" aren't captured?
Additionally can I somehow how gag the two lines so instead of:

Can affect you as:
Affect : HITROLL 5
Affect : DAMROLL 6

output as

Affects: Hitroll 5, Damroll 6

There will only ever be just two affects, but those affects can be just about anything.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Sat Nov 07, 2009 2:20 pm   
 
Hmm try using an end of line match $ at the end of the triggers matching * to match all before it. And the 'Affects' might be the same issue, though should work fine, in theory.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
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