| 
	
		|  |  
		| Murdlih Beginner
 
 
 Joined: 17 Dec 2001
 Posts: 24
 Location: USA
 
 | 
			
			  |  Posted: Tue Jul 13, 2004 7:38 pm 
 Inventory Maintenance
 
 |  
				| I desire to create a trigger that will automatically clean up my inventory.  I am not quite sure how to go about this.  I want to save certain items, and toss others.  Some of this is really easy, even if my solution may be crude.  but other stuff I can't get. 
 Sample Output:
 
 Carrying 8 items and 296 gold (5% of your capacity) Bank: 1524145
 1. a pure Ring
 2. a steel Ring
 3. a pure Ring
 4. a Staff of strength
 5. a Bag o' gems
 6. a Bag o' gems
 7. some light Chainmail (1 +0)
 8. some light Chainmail (1 +0)
 9. an orcish leather Armor (11 +0) (worn)
 10. a silver Rapier (7 +0) (right)
 
 I can address objects by their inventory number, or by their capitalized keyword.  obviously, when I drop and toss item 2, that makes all the following numbers change.  This makes it difficult since two items with the keyword "ring" may not be the same, and I would have to drop them based on their number, not the keyword, whereas Staff I can trigger on and drop.
 
 Ideally I would want to get rid of everything but pure ring, worn stuff (worn), and wielded stuff (right) or (left).  Practically I can keep worn and wielded stuff safe by always having those in certain numbers, or whatever.
 
 Another problem I have discovered with my matching is that
 9. Bag has a space before it and
 10. bag has no space.  I thought I could correct this with %s vut it doesn't seem to work
 
 Match - %s(%d). a Bag o' gems
 do -    drop Bag;toss Bag
 
 Thanks a lot.
 Murdlih
 |  |  
	  |  |  
		|  |  
		| LightBulb MASTER
 
 
 Joined: 28 Nov 2000
 Posts: 4817
 Location: USA
 
 | 
			
			  |  Posted: Wed Jul 14, 2004 2:52 am 
 |  
				| Toss the high-numbers first. #TR {Carrying %d ite%w and %d gold} {#VAR toss {}}
 #TR {^(%d).(*)} {#IF (("%2" =~ "a pure ring") OR ("%2" =~ "~(worn~)") OR ("%2" =~ "~(right~)") OR ("%2" =~ "~(left~)")) {} {#ADDI toss %1}}
 #TR {%w} {#LOOP %numitems( @toss),1 {toss %item( @toss, %i}}
 |  |  
	  |  |  
		|  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |  |