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


Joined: 23 Jul 2001
Posts: 47
Location: USA

PostPosted: Sat Jun 14, 2003 12:30 am   

6.62 Problems
 
I just recently, against my better judgement, upgraded to 6.62 when I was perfectly happy with 6.40

Now that I've converted, a few of my triggers aren't working, since 6.62 doesn't seem to like nested #FORALLs.. grr, heh.

So anyways... this is the trigger I have:


#TRIGGER {^Inside the open large (*) backpack you see &itemlist$}
{
#SUB {Inside the open large %1 backpack you see~:}
#VAR itemlist %replace( @itemlist, ", and ", "|")
#VAR itemlist %replace( @itemlist, ", ", '|')
#VAR itemlist %replace( @itemlist, ".", "")
#VAR singlist %dups( @itemlist)
#FORALL @singlist {
#VAR count 0
#VAR check %i
#FORALL @itemlist {#IF (%i = @check) {
#ADD count 1
#VAR itemlist %delitem( @check, @itemlist)
}}
#VAR check %replace( @check, "a ", "")
#VAR check %replace( @check, "an ", "")
#VAR check %replace( @check, "some ", "")
#SHOW @count @check
}
#IF @Loot.Active {#SHOW End of Inventory list.}
#SHOW ~>}


The output I get from the mud is:

Inside the open large leather backpack you see a silver-trimmed hammered shield, an open black leather web fluid case, a battered blood-stained steelwood shield, a battered blood-stained steelwood shield, an eye, a glistening black orb of Taath, a flowing black spidersilk fighter's cape, a crystal battle lantern, a silver Spurian Gladiator Ring, some titanium tipped bloodstained foreclaws, a glistening black orb of Taath, a vulture etched obsidian amulet, a white cotton rag, a gleaming white platinum helm, a closed pitch black leather alchemy kit, a malevolent obsidian Arachnian fighter doll, a gleaming white platinum helm, a gleaming white platinum helm, a gleaming white platinum helm, a gleaming white platinum helm, a gleaming white platinum helm, a hollow Penthanian skull, and a beaten old deer skin hide drum.

It used to do something like the following..
Inside the open leather backpack you see:
1 ItemOne
1 ItemTwo
5 ItemThree
2 ItemFour
etc.

Any help would be greatly appreciated.

Thanks!

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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jun 14, 2003 12:36 am   
 
Nested loops changed a bit in a recent version. To refer to the current item in the innermost loop, use %j. The one in the outermost would be %i and it is accessible from within the inner loop. So, you no longer need this line:
#VAR check %i

This:
#IF (%i = @check)

becomes:
#IF (%j = %i)

and all other references of @check would be replaced by %i.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jun 14, 2003 12:53 am   
 
You might want to try something similar to this routine from the topic:Trigger help for version 6.62 public
Eliminating the loops should speed things up considerably.
#TR {Inside the open (*) you see (*).} {#VAR container {%1};#VAR contents {%2};#VAR contents %replace( {@contents}, ", ", "|");#VAR contents %countlist( @contents);ContentsSummary}
#AL ContentsSummary {#SAY Inside the open @container you see;#LOOPDB @contents {#SAY %val %key}}

LightBulb
Advanced Member
Reply with quote
Taishar
Novice


Joined: 23 Jul 2001
Posts: 47
Location: USA

PostPosted: Wed Jun 18, 2003 1:30 am   
 
That worked great, thanks!

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.
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