|
Josiah.Bruns Apprentice
Joined: 04 Mar 2007 Posts: 103
|
Posted: Mon Mar 12, 2007 3:10 am
quick one i hope. #IF Expression .=. is evaluating to False |
[-> #IF (%rightback( "%t1", 1) = ".") <----- this is the zmud debug code ... thats evaluating to false
#IF (%rightback( "%t1", 1) = ".") <----- Code from my trigger
From all the debugging and testing i have done it looks like .=. is what the part in the brackets evaluates to, i am trying to figure out how to make .=. be true.
%t1 = north, south and west.
The reason i had to put quotes around the %t1 is because the "," is the %t1 string was messing up the rightback function and i was getting and h=. before i did that.
h is the rightback letter in north.
Thanks for any help.
i put a ton of more info below that is not nessessary if you already see what i am doing wrong.
This is my whole multistate trigger... i used the #window command to put more debugger info into another window so i could try and figure out whats going on.
Code: |
#TRIGGER "CaptureLines" {-- There [is|are] %w obvious [exit|exits]:(*)} {
#CLR exits
RoomExits= %t1
#WINDOW Exits %ansi( yellow, bold) Debug State 0 ~%t1= %t1
#SET CaptureLines 1 1
} "" {notrig}
#CONDITION {} {
#IF (%rightback( "%t1", 1) = ".") {
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=True Expression = %rightback( %t1, 1)="."
#WINDOW Exits %ansi( yellow, bold) Debug State 1 t1= %t1
#SET CaptureLines 2 1
} {
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False t1= %t1
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False Expression = %rightback( "%t1", 1)="."
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False Sets RoomExits = %concat( @RoomExits, " ", %line)
RoomExits=%concat( @RoomExits, " ", %line)
#SET CaptureLines 2 1
}
} {nocr|notrig}
#CONDITION {} {#WINDOW Exits @RoomExits} {nocr|notrig} |
Here is the results from my own debbuger code that was created from the #win commands in my trigger.
Code: |
Debug State 0 %t1= north, south and west.
Debug State 1 If=False t1= north, south and west.
Debug State 1 If=False Expression = .=.
Debug State 1 If=False Sets RoomExits = north, south and west. -- There are three obvious exits: north, south and west. |
Here is the total Zmud debugger code.
Code: |
[-- There [is|are] %w obvious [exit|exits]:(*)-> #CLR exits
RoomExits= north, south and west.
#WINDOW Exits %ansi( yellow, bold) Debug State 0 ~%t1= north, south and west.
#SET CaptureLines 1 1]
[-> #IF (%rightback( "%t1", 1) = ".") {
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=True Expression = %rightback( %t1, 1)="."
#WINDOW Exits %ansi( yellow, bold) Debug State 1 t1= %t1
#SET CaptureLines 2 1
} {
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False t1= %t1
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False Expression = %rightback( "%t1", 1)="."
#WINDOW Exits %ansi( yellow, bold) Debug State 1 If=False Sets RoomExits = %concat( @RoomExits, " ", %line)
RoomExits=%concat( @RoomExits, " ", %line)
#SET CaptureLines 2 1
}]
[-> #WINDOW Exits @RoomExits] |
Thanks for any help.... i hope you didn't have to make it this far down to figure out my problem. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Mar 12, 2007 4:20 am |
Why not just use a simple %remove() to get rid of the period? Or, if you know that this one line will always end in a period just include it in the pattern as a literal character (which will force the (*) to not include it in whatever it matches).
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Mar 12, 2007 4:48 am |
The #IF works correctly and in zmud you do need the ""'s around your %1/%t1 refrences in most cases.
The problem is the way the code is written, sorry I don't have anything available atm to help you but here is something that should work written off the top of my head adjust patterns/variables to match yours assuming exit line will never be more then 2 lines long.
Code: |
#TRIGGER "CaptureLines" {Exit line: (*)} {RoomExits="%1"}
#COND {} {#IF (%rightback("%t1",1)=".") {#WIN Exits @RoomExits} {
RoomExits=%concat(@RoomExits, " ", %line)
#WIN Exits @RoomExits
}
} {within|param=1} |
|
|
|
|
|
|
|
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
|
|