Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Sun Jul 08, 2007 1:04 am
[1.34] Trigger not clearing vars before next trigger fills them |
I have not been able to reproduce this in a shorter, contrived script. This is an old script of mine.. I think I've been using it since zmud 5.55 days. These days I would probably write something like this differently, but the old adage about not fixing unbroken things takes precedent. I was surprised though, when it wouldn't work in CMUD.
Quote: |
#TR {{A|An} (%w) tattoo on the (%w) (%w).} {#ADDITEM %2%3tatts %1}
#TR {{A|An} (%w) tattoo on the (%w).} {#ADDITEM %2tatts %1
#CO 12 //this is just for purpose of testing
#sh head: @headtatts torso: @torsotatts //also for testing}
#AL tatl {#SAY %cr
#SAY You have these tattoos:
#SAY Head: %replace(@headtatts, "|", " & ")
#SAY Torso: %replace(@torsotatts,"|"," & ")
#SAY Left Arm: %replace(@leftarmtatts, "|", " & ")
#SAY Right Arm: %replace(@rightarmtatts, "|", " & ")
#SAY Left Leg: %replace(@leftlegtatts, "|", " & ")
#SAY Right Leg: %replace(@rightlegtatts, "|", " & ")}
#TR {You have the following tattoos:} {#SH --- Clearing Tatts ---
headtatts=%null
torsotatts=%null
leftarmtatts=%null
rightarmtatts=%null
leftlegtatts=%null
rightlegtatts=%null} |
I type "tattoos", the stringlist should be populated by the triggers, and "tatl" shows me a summary of what I have.
Quote: |
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]tattoos
You have the following tattoos:
A brazier tattoo on the head. (50 uses left)
A tentacle tattoo on the right arm. (24 uses left)
A prism tattoo on the right arm. (5 uses left)
A web tattoo on the right leg. (44 uses left)
A moss tattoo on the left leg.
A tree tattoo on the torso. (35 uses left)
A bell tattoo on the head. (37 uses left)
A boar tattoo on the left arm.
A cloak tattoo on the torso. (29 uses left)
A shield tattoo on the left arm. (45 uses left)
A moon tattoo on the left leg.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]
--- Clearing Tatts ---
head: brazier torso:
head: brazier torso: tree
head: brazier|bell torso: tree
head: brazier|bell torso: tree|cloak
The deepening dusk yields to impenetrable darkness as night claims the land.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]
You have these tattoos:
Head:
Torso:
Left Arm:
Right Arm:
Left Leg:
Right Leg:
|
You can see above that the trigs are all firing, and even the string lists being systematically filled correctly. Yet they are apparently also being cleared afterwards.
If I modify one of the triggers slightly, to:
Quote: |
#TR {You have the following tattoos:} {headtatts=%null
torsotatts=%null
leftarmtatts=%null
rightarmtatts=%null
leftlegtatts=%null
rightlegtatts=%null
#SH --- Clearing Tatts ---} |
Just to make the change clear, I moved the #show command from line 1 to the bottom. Now, the output changes when I enter "tattoos" and then "tatl".
Quote: |
tattoos
You have the following tattoos:
A brazier tattoo on the head. (50 uses left)
A tentacle tattoo on the right arm. (24 uses left)
A prism tattoo on the right arm. (5 uses left)
A web tattoo on the right leg. (44 uses left)
A moss tattoo on the left leg.
A tree tattoo on the torso. (35 uses left)
A bell tattoo on the head. (37 uses left)
A boar tattoo on the left arm.
A cloak tattoo on the torso. (29 uses left)
A shield tattoo on the left arm. (45 uses left)
A moon tattoo on the left leg.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]
--- Clearing Tatts ---
head: brazier torso:
head: brazier torso: tree
head: brazier|bell torso: tree
head: brazier|bell torso: tree|cloak
You have these tattoos:
Head: brazier & bell
Torso: tree & cloak
Left Arm: boar & shield
Right Arm: tentacle & prism
Left Leg: moss & moon
Right Leg: web |
I'm not sure why, but placing a #sh command at the end of the trig forces it to be completed, almost like the old #priority? I have tried to duplicate this with a contrived and simplistic script, but cannot. Thoughts? |
|