|
Ruderion Novice
Joined: 12 Jan 2003 Posts: 33 Location: Netherlands
|
Posted: 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}} |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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-. |
|
|
|
|
|