Err, actually, its a couple aliases... the first is
#VAR loot.coins 0
#VAR loot.box 0
#VAR loot.coffer 0
#VAR loot.chest 0
#VAR loot.pouch 0
#VAR loot.bag 0
#VAR loot.sack 0
#VAR contents %replace( @contents, " ", "|")
#VAR contents %replace( @contents, ",", "")
#FORALL @contents {
#IF (%i="coin") {#ADD loot.coins 1}
#IF (%i="coins") {#ADD loot.coins 1}
#IF (%i="box") {#ADD loot.box 1}
#IF (%i="coffer") {#ADD loot.coffer 1}
#IF (%i="chest") {#ADD loot.chest 1}
#IF (%i="pouch") {#ADD loot.pouch 1}
#IF (%i="sack") {#ADD loot.sack 1}
#IF (%i="bag") {#ADD loot.bag 1}
}
grab
Where contents is a string of random junk that is on the floor that I broke up into a string list:
#VAR contents {.||||A|gold|coin|a|bronze|bastard-sword|a|platinum|cutlass|and|a|silver|corkscrew|are|here.}
Now, for some reason, the trigger that is supposed to count how many of each item there is, isn't working... when it goes through that string, it says there's like 3 of each container and 7 coins.
When it works properly, it'd just show 2 coins.
The grab in the first alias is this one:
#VAR stuff {}
#IF (@loot.box) {#LOOP @loot.box {#VAR stuff {%addItem( "box", @stuff)}}}
#IF (@loot.chest) {#LOOP @loot.chest {#VAR stuff {%addItem( "chest", @stuff)}}}
#IF (@loot.coffer) {#LOOP @loot.coffer {#VAR stuff {%addItem( "coffer", @stuff)}}}
#IF (@loot.pouch) {#LOOP @loot.pouch {#VAR stuff {%addItem( "pouch", @stuff)}}}
#IF (@loot.bag) {#LOOP @loot.bag {#VAR stuff {%addItem( "bag", @stuff)}}}
#IF (@loot.sack) {#LOOP @loot.sack {#VAR stuff {%addItem( "sack", @stuff)}}}
#IF (@loot.coins) {#LOOP @loot.coins {#VAR stuff {%addItem( "coin", @stuff)}}}
#delitem 0 stuff
#IF @stuff {
#T+ Getting
#VAR loot.active 1
}
yeah, its messy... but wasn't sure how else to do it, heh. Basically just adds them all to a string list, so that another trigger and go through and grab each one in turn and remove it from the list before going onto the next.
When it all works properly, it'd take the treasure, break it up into a string list, then count how many occurences of coins, boxes, etc and store it all in the Loot variable... the grab alias would then assemble a string list of items to pick up. It all worked in 6.4, but none of it is now :-/
Thanks in advance... I know those triggers are really messy, heh.
Dan
The unstained tower breaks and bends knee to the forgotten sign. The seas rage, and storm clouds gather unseen. What was exalted is cast down; what was cast down is raised up. Order burns to clear his path.