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
Thunderbuster
Novice


Joined: 07 Nov 2001
Posts: 45
Location: USA

PostPosted: Mon Aug 26, 2002 8:06 am   

Sequential Patterns got me stumped.
 
--Ok, I am at a trade shop and I need to value these items.
Value Bananas
Value Seed
Value Beans
Value Rice
Value Tobacco
--After each Item I get this report back:
We will pay you 5552 gold for each sack.
We will pay you 4392 gold for each sack.
We will pay you 4624 gold for each sack.
We will pay you 6016 gold for each crate.

--Ok, so not every item has a unique container. So how can I set this up where the first item valued places the value returned into a varable called Bananas?
--I know that I can do this:
#trigger {We will pay you &%dBananas gold for each sack.}
--But if I do that, then when I value the next item and it's container is a sack, it will replace the Bananas value. This is unacceptable.

--I have upgraded to the latest beta version and have been playing with the #COND statement. I am not getting this to trigger as a secondary trigger for some reason.

Any ideas on how I might code this?

2nd place just means your a 1st place loser.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Aug 26, 2002 8:43 am   
 
Can you do one at a time?

Trigger off the commodities and add them:
#ALIAS AddValueList {#ADDITEM V_Value_List %lower(%1)}

#VAR V_Value_List "bananas|seed|beans|rice|tobacco"

Trigger off the location name to remember where you are:
#TRIGGER {Welcome to cesspool commodity market.} {#VAR V_Value_Location cesspool}

Start the value process:
#ALIAS DoValue {#IF (%numitems(@V_To_Value) >0) {value %item(@V_To_Value,1)}

#TRIGGER {^We will pay you (%d) gold for each {sack|crate}.$} {#VAR V_Value_[%item(@V_Value_List,1)]_[@V_Value_Location] %1;#DELITEM V_Value_List %item(@V_Value_List,1);#IF (%numitems(@V_Value_List) >0) {value %item(@V_Value_List,1)}

Would create something like:
#VAR V_Value_bananas_cesspool 12345
#VAR V_Value_seed_cesspool 12345
#VAR V_Value_beans_cesspool 12345
#VAR V_Value_rice_cesspool 12345
#VAR V_Value_tobacco_cesspool 12345

Probably better tracked with a database variable but I like seeing things.

Note that this will not enter nicely through the command line due to my use of the [].

Ton Diening
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