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 3:17 pm   

More on the same project_ Do I need a function?
 
#if (@BestValue1<@vBananas) {BestValue5=@BestValue4 ;BestValue4=@BestValue3 ;BestValue3=@BestValue2
;BestValue2=@BestValue1 ;BestValue1=@Bananas ;BestLocation5=@BestLocation4 ;BestLocation4=@BestLocation3
;BestLocation3=@BestLocation2 ;BestLocation2=@BestLocation1 ;BestLocation1=Gdangus ;BestTRGood5=@BestTRGood4
;BestTRGood4=@BestTRGood3 ;BestTRGood3=@BestTRGood2 ;BestTRGood2=@BestTRGood1 ;BestTRGood1=Bananas}

I basicly want to keep the Top 5 Best trade options, but what a mess to have to repeat on every occation I value an item. Can someone help me with simplifying this?

Thanks...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Aug 26, 2002 5:39 pm   
 
Convert to stringlists
#VAR BestValues {@BestValue1|@BestValue2|@BestValue3|@BestValue4|@BestValue5}
#VAR BestLocations {@BestLocation1|@BestLocation2|@BestLocation3|@BestLocation4|@BestLocation5}
#VAR BestTRGoods {@BestTRGood1|@BestTRGood2|@BestTRGood3|@BestTRGood4|@BestTRGood5}

Then just insert the new values at the appropriate points in the lists, dropping the last item. Since you used specific values (Gdangus and Bananas) instead of variables for BestLocation1 and BestTRGood1, you'll have to change those to the appropriate variable yourself.
#IF (@vBananas > %item( @BestValues, 1}) {#VAR BestValues {@Bananas|%item( @BestValues, 1)|%item( @BestValues, 2)|%item( @BestValues, 3)|%item( @BestValues, 4)};#VAR BestLocations {Gdangus|%item( @BestLocations, 2)|%item( @BestLocations, 3)|%item( @BestLocations, 4)};#VAR BestTRGoods {Bananas|%item( @BestTRGoods, 2)|%item( @BestTRGoods, 3)|%item( @BestTRGoods, 4)}}
#IF ((@vBananas <= %item( @BestValues, 1)) AND (@vBananas > %item( @BestValues, 2))) {#VAR BestValues {%item( @BestValues, 1)|@Bananas|%item( @BestValues, 2)|%item( @BestValues, 3)|%item( @BestValues, 4)}


LightBulb
Senior Member
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