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


Joined: 12 Jan 2003
Posts: 33
Location: Netherlands

PostPosted: Sat Aug 23, 2003 9:24 pm   

looping problem
 
i made a few script to automatically bless all the items im wearing. For some reason the script doesn't terminate properly. Can anyone tell me what's wrong with it.

- activate trigger to capture all items im wearing. setup temp trigger to start casting spells when all items are captured. zMud detects a trigger loop here.
#ALIAS blessall {#T+ BlessItems;#TEMP {^$} {#T- BlessItems;blessall2};#VAR equip "";equipment}

- capture the equipmentlist and take the last word from the description and add it to a string list. This works
#TRIGGER "BlessItems" {<*> *} {} "" {disable}
#COND {(*)} {#ADDITEM equip %word( %1, %numwords( %1))} {reparse|disable}

- start removing, blessing and wearing every item. For some reason this script keeps on running again and again.
#ALIAS blessall2 {#VAR equip %dups( @equip);#FORALL @equip {remove %i;#WA;c bless %i;#WA;wear %i;#WA}}
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Aug 24, 2003 3:43 am   
 
#FORALL @equip {remove [blue]%i[blue];#WA;c bless [blue]%i[blue];#WA;wear [blue]%i[blue];#WA}

take out the last #wa

however in my test of this script I found many problems.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Aug 24, 2003 4:02 am   
 
The alias, blessall2, is part of your #TEMP trigger. Your #TEMP doesn't delete itself until it has finished processing ALL its commands, including the ones in blessall2, which includes 3 #WAIT commands.

Since the #TEMP trigger is still active, any blank line received while you are in the process of blessing your equipment will retrigger it and cause you to start again at the first item.

The easiest way to fix this is to replace the #TEMP trigger with a permanent one, and toggle it on/off with #T+/#T-.
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