|
Mostly Harmless Newbie
Joined: 28 May 2004 Posts: 2 Location: USA
|
Posted: Tue Feb 07, 2006 8:59 pm
Multistate trigger and file output issue... |
This is driving me crazy, and I'm sure it's something very silly I'm missing...it's what I get for staring at code too long. Anywho, as a disclaimer, I HAVE searced the forums, so, you know.
I want to catch a particular output from the mud (from, you guessed it, identify). So, if the mud sends me the following:
This item, a large sword, is a 'very big sword'.
It is worth 200 gold, and is of the 61st level of power.
It is made of gold and weighs 64 pounds 7 ounces.
It gleams with brilliance.
This line should not be included.
What should happen is that the first four lines get saved to a file, the blank line ends the trigger, and the last line has nothing to do with any of it at all. What I've got is the following:
Code: |
#ALIAS ident {
identify %1
#T+ IdentCap
}
#CLASS {IdentifyCapture} {enable}
#TRIGGER "IdentCap" {(This object,*~.)} {
#FILE 2 identify.txt
#WRITE 2 {%1}
} "IdentifyCapture" {disable}
#COND {(%a%p)} {#IF ((%line =~ "$")|(%concat(%line,"$")="$")) {#SET "IdentCap" 2 1} {#WRITE 2 {%1}}} {looplines|param=99|notrig|disable}
#COND {} {
#STATE IdentCap 0
#RESET IdentifyCapture
#T- IdentCap
#CLOSE 2
} {manual|disable}
#CLASS 0 |
It's that first condition that's giving me a headache. For some reason, it's not recognizing the blank line. Therefore, everything done after is matching, only the first line is getting written to the file, the file is never closed, and the trigger is never disabled. Any words of wisdom? You may just save me some hair for this one... |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Feb 08, 2006 10:53 pm |
#COND {(%a%p)} {#IF ((%line =~ "$")|(%concat(%line,"$")="$")) {#SET "IdentCap" 2 1} {#WRITE 2 {%1}}} {looplines|param=99|notrig|disable}
Should be:
#COND {} {#IF ((%line =~ "$")|(%concat(%line,"$")="$")) {#STATE IdentCap 2;#SET "IdentCap" 2 1} {#WRITE 2 {%1}}} {looplines|param=99|notrig|disable} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|
|
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
|
|