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
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Wed Aug 04, 2004 1:58 am   

General Multi-line capturing/Inventory Capturing
 
Okay, to start out, this is for Achaea, but maybe someone who doesn't play can still help.

The format for the main way of checking inventories is such:

You are wielding a bard's harp in your left hand and an ornate steel rapier in
your right hand.
You are holding:
a simple fishing pole, 2 keys, 3 cherry wood vials, 3 elegant diamond vials, a
black-walnut vial, a cedarwood vial, 6 hazelwood vials, a flame-shaped sigil, 5
brown potatos, a fine leather backpack, a red rose, a small grey mouse.
You are wearing:
a beautiful silver ring, a delicate coral bracelet, a canvas backpack, a
hunter's belt, a wedding band of platinum and moonstone, a sturdy pair of black
trousers, plain grey boxer shorts, a pair of eagle's wings.
You have 20 types of items in the Rift.
You possess 36 items and are carrying no gold.

I want to capture this into some sort of structure(database,etc) so that it takes down each item(including the one's wielded), separates them between being wielded, held, or worn, and gets how much gold I am carrying. This is just the beginning of what I wish to accomplish, but its a start. Any help is appreciated.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Aug 04, 2004 5:00 pm   
 
#TR {You are wielding (*) in your left hand and (*) in your right hand.} {#ADDK Inventory LWield {%1};#ADDK Inventory RWield {%2}}
#TR {You are wielding (*) in your left hand.} {#ADDK Inventory LWield {%1}}
#TR {You are wielding (*) in your right hand.} {#IF (%pos( in your left hand, "%1") = 0) {#ADDK Inventory RWield {%1}}}
#TR {You are holding:} {}
#COND {(*).} {#ADDK Inventory Hold {%replace( "%1", ", ", "|")}}
#TR wear1 {You are wearing:} {#VAR wear2 {}}
#COND {(*)} {#VAR wear2 {@wear2 %1};#IF %ends( "%1", ".") {#STATE wear1 0;#ADDK Inventory Wear {%trim( %replace( "@wear2", ", ", "|"))}}} {LoopLines|Param=99}
#TR {You * are carrying (*) gold.} {#IF %isnumber( %1) {#ADDK Inventory Gold %1} {#ADDK Inventory Gold 0}}

Select/modify triggers as appropriate.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu Aug 05, 2004 12:31 am   
 
Hmm, just to make sure I am not missing something, is wear2 supposed to be a data record like Inventory? If so, it isn't working like that, it is only putting the list straight into a the variable as text.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Aug 05, 2004 5:17 am   
 
No, it's supposed to be a string variable. It sounds like it's working correctly.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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