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


Joined: 20 Oct 2005
Posts: 2

PostPosted: Thu Oct 20, 2005 12:54 pm   

Trigger to Compare Variable Lists
 
I want to be able to compare the items I have with a complete list of 200 items

If I need to collect ItemONE through ItemTWOHUNDRED

Basically I want to be able to look in a container and see which items I am missing.

Any suggestions?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 20, 2005 1:43 pm   
 
Since you didn't post actual mud output the best I can do is give you some pseudo code and a rough place to start.

Code:

#TR { Your container contents start line } { Declare templist  to hold CurItems}
#COND {Each line of container content } {add each to CurItems}
#COND {Done container} {#FORALL @200ItemList  {#IF (%ismember( %i, @CurItems) == 0) {#SHOW %i}}}


This is very rough code off the top of my head, but basically you are trigger off the container... adding each item in this container to your CurItems list. Once you've built CurItems you print out every item one of the 200 item list that you don't have. If you don't need to save the original 200item list or for performance reason you can copy the original 200 item list and remove all CurItems from it and display the copy.
Code:
#COND {Done container} {#FORALL @CurItems { %delitem (%i, @Copy200ItemList) } ; #SHOW @Copy200ItemList}
_________________
Asati di tempari!
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