|
pitcarn Newbie
Joined: 31 Jan 2008 Posts: 4
|
Posted: Wed Mar 05, 2008 7:25 pm
Newbie help--script repeating when it should not |
Greetings all
Hopefully this is a simple issue. The following script should get the name of the item to identify, equip the proper spellbook, cast the spell, and try again if the spell fails.
Code: |
#TEMP {concentration} {cast identify @idwhat}
idwhat = ""
idwhat = %prompt("","Identify What?")
#IF (@whatheld != "White") {hold white;whatheld = "White"}
cast identify @idwhat |
The name check occurs, the equip occurs, but the re-fire triggers six times even before a reply is received. Can anyone tell me what stupid mistake I have made?
Thanks
David |
|
|
|
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: Wed Mar 05, 2008 8:00 pm |
I pasted the script above into an alias in a blank, offline session, and it performs exactly as expected (asks for item, equips White, casts identify), then stops. If I then '#say concentration', it casts again. If I '#say concentration' again, nothing happens.
So, the script looks right. Could be a bug in some other alias/trigger of yours, or in CMUD. Can you paste a log from your MUD session, showing the input & output when the failure occurs? You may also want to open the Script Debugging window before you invoke the alias, to see what is actually getting called/triggered, and when. |
|
_________________ Come visit Mozart Mud...and tell an imm that Aerith sent you! |
|
|
|
pitcarn Newbie
Joined: 31 Jan 2008 Posts: 4
|
Posted: Wed Mar 05, 2008 8:32 pm |
I adjusted the initial script so the #TEMP fires on "You lose you concentration", but that did not seem to help.
The script does not "refire" on a successful cast, but does "refire" on failure.
Code: |
<240hp 167sp 334st> cast identify bag
You begin to speak the words of the spell...
<240hp 167sp 334st>
You have completed your casting.
Item 'a small canvas bag' is type container, alignment 0, made of leather,
has keywords 'bag canvas'.
This item weighs 0 stones and 2 pebbles, and is valued at 75 gp.
This level 5 item has the attributes: identified
A small canvas bag is in excellent condition.
Capacity: 15 items. Maximum weight: 3 st, 50 pb. Flags: closeable
When you look inside, you see:
( 2) a sterling silver scroll (new)
( 2) a gold-leafed papyrus scroll (new)
a navy blue scroll (new)
<240hp 135sp 334st> cast identify bag
You begin to speak the words of the spell...
<240hp 135sp 334st>
You have completed your casting.
You lose your concentration.
cast identify bag
cast identify bag
cast identify bag
cast identify bag
<240hp 127sp 334st> You begin to speak the words of the spell...
<240hp 127sp 334st> You can't do that while casting a spell!
<240hp 127sp 334st> You can't do that while casting a spell!
<240hp 127sp 334st>
You have completed your casting.
You lose your concentration.
<240hp 119sp 334st> You begin to speak the words of the spell...
<240hp 119sp 334st>
<240hp 124sp 334st>
You have completed your casting.
Item 'a small canvas bag' is type container, alignment 0, made of leather,
has keywords 'bag canvas'.
This item weighs 0 stones and 2 pebbles, and is valued at 75 gp.
This level 5 item has the attributes: identified
A small canvas bag is in excellent condition.
Capacity: 15 items. Maximum weight: 3 st, 50 pb. Flags: closeable
When you look inside, you see:
( 2) a sterling silver scroll (new)
( 2) a gold-leafed papyrus scroll (new)
a navy blue scroll (new) |
|
|
|
|
pitcarn Newbie
Joined: 31 Jan 2008 Posts: 4
|
Posted: Wed Mar 05, 2008 8:33 pm |
As an additional note, this script is tied to a button--I don't think that it should matter, but...
|
|
|
|
pitcarn Newbie
Joined: 31 Jan 2008 Posts: 4
|
Posted: Wed Mar 05, 2008 9:01 pm |
Got it!
I was not removing the #TEMP on a success. If I cast five successful Identify, I would have five residual #TEMP. To combat this problem, I have changed the script to include an #UNTRIGGER
Code: |
#UNTRIGGER id1
#TEMP id1 {concentration} {cast identify @idwhat}
idwhat = ""
idwhat = %prompt("","Identify What?")
#IF (@whatheld != "White") {hold white;whatheld = "White"}
cast identify @idwhat |
I would welcome any suggestions on how I might clean this up further.
Thanks JQuilici for your initial help.
David |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Mar 05, 2008 9:50 pm |
Personally, I prefer to enable/disable permanent triggers rather than using the #TEMP approach. You'd make a trigger in the same class folder as your alias/button/macro and just use the ID (i.e., id1) to control it with #T+/-. You won't see that "trigger removed" message any more, and you won't be creating a new trigger to be compiled each time this code is executed.
|
|
|
|
|
|
|
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
|
|