|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Sun Mar 23, 2003 1:53 pm
Trigger test works, trigger doesn't |
I've got a trigger with two pattern states that, to my confusion, executes inconsistently. I have #SHOW commands for each stage to confirm they have executed. I initiate the MUD output that will match the patterns for each state, everything works, I get the confirmation #SHOWs. I do it again, without changing anything, getting the exact same output from the MUD (exactly the same, verbatim), and the first state executes, but the second doesn't. The same output a third time will execute both states.
This rhythm repeats- Works, Fails, Works. Here's the trigger and the output:
#TRIGGER {^**Creating List of Player Character Names**} {#SHOW Stage 1 fired};#COND {%d Creators~:(*)} {#SHOW Stage 2 fired}
**Creating List of Player Character Names**
10 Creators: Nate(C)(l) Bankshot(C) Kana(C) Miv(C) Sini(C) Sojan(T) Starr(S) Tizer(C) Una(D) Wirble(S)
There's another thing that has me completely lost. Changing the second pattern in the trigger above to {%d Creators~:%s(*)} and trying to match on the same output as above yields no match. Just the addition of %s where there is a space in the output , and the command won't execute. Now if I leave the pattern in this non-working form and generate the output again even the first command won't execute, presumably because only one state can be active at a time, and the trigger is on the second state, still looking for the second pattern. If I delete the offending %s and generate the output again, the second state executes.
Now, in the first trigger I listed, without the %s, that executes in the works, fails, works rhythm, if the second state isn't executing (which I believe because the '#SHOW Stage 2 fired' doesn't appear on the screen), why would the first state execute when I generate the output again? Shouldn't the second state be active, waiting to match the second pattern? This leads me to think that the second state is executing, but then why doesn't the #SHOW, uh, show?
I hope I've been clear. Can anyone help me understand what's happening?
edit: The subject isn't quite accurate; I forgot to change it after I altered my post, but I did test the patterns that failed, with the %s, using pastes from the MUD output. The test indicates "Pattern Matches", but the state doesn't execute, as I said. |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun Mar 23, 2003 6:54 pm |
The way I read this is that the first part fires but the #cond does not.
First lets start with that you have some typo's in you script here
that you may not have in your real one.
#COND {%d Creators~:(*)}
Should be {(%d) Creators:(*)}
brackets for the %d () and you do not need ~:
Zmud will reconize it anyways unless you have changed it.
Later you go on to say that if you do this
{%d Creators~:%s(*)} it won't work again this should be fixed
{(%d) Creators:(%s)(*)} or you could actually put the space in if it is a fixed space like this
{(%d) Creators: (*)} this will trigger too.
Also remember this since #cond is a Trigger make it A real #trig first to test it.
The incorperate it into your other #trig when you know it works.
Hope this helps.
megamog75
Keeper of the only printable help files for Zmud. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Mar 23, 2003 7:25 pm |
The patterns are fine as is.
: is treated as a normal character in a trigger pattern, so it doesn't actually need a ~ before it. However, since ~ just instructs the parser to treat the next character as a normal character, the pattern will work equally well with or without the ~. NO TYPO
() aren't needed around %d unless you have a use for the number. %d is a wildcard and works equally well with or without ()'s. NO TYPO
----------
I tested your trigger by cut-and-paste to an offline blank window. I then cut-and-paste the sample MUD output you provided. Both states of the trigger fired every time I tested it. This was true with the original trigger/condition and also after I modified the #COND to use %s. However, if %s isn't working with actual MUD output, there's probably not a space before the first name.
The only conclusion I can reach is that you have another trigger which gags the "#SHOW Stage 2 fired" every other time.
LightBulb
Advanced Member |
|
|
|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Mon Mar 24, 2003 12:02 am |
I'm not trying to capture the %d, so no parentheses needed, and my original trigger didn't have a ~ before the colon; I didn't think a colon was a special character. I added it when I was grasping at straws to make the trigger work. After reading your replies I knew I must have been missing something, since I have no #gags except my password, which isn't a real word, and the space is there before the first name - I cut and pasted the output line in my post. I tested the trigger unchanged, generating similar output from the MUD and saw a new, but consistent rhythm of failures and successes. My mind boggled. Then I remembered the point of the exercise was to see if I was missing something, and the trigger must be fine, so I scrutinized the output. The lines that the trigger matches were fine, but I saw that "Stage 2 fired" was sometimes buried in a long output paragraph following these lines, sometimes even colored with a color code from the output text preceding it, making it difficult to see. It had been there all along - whenever I didn't use the %s. Well, one problem solved.
I'm reminded of Sherlock Holmes, "Eliminate the impossible, and what remains, however improbable, must be your solution." Also, the merits of leaving an apparently intractable problem and reapproaching it fresh, later. Thanks to megamog and LightBulb for the help.
Incidentally, from now on I'll #color any confirmation #shows I use to see them more easily.
I'll make another post about the %s issue, the plot has thickened. |
|
|
|
Palmer Novice
Joined: 21 Mar 2003 Posts: 38 Location: USA
|
Posted: Mon Mar 24, 2003 12:04 am |
The %s oddity seems to be part of a larger problem. First of all, here's the MUD output:
11 Creators: Keil(C)(l) Mellandrin(C)(l) Ceres(T) Danbala(D) Elera(C)
Emphyrio(C) Mollow(C) Panin(C) Pure(C) Revol(C) Sightblinder(C)
8 Playtesters: Flamore Ibblek Mimer Sarux Shinobi Tarzan Woom Yalpf
205 Players: Aahz Adzel Alaric AlbertRoss Aldous AliX Anais Arcane Argoth
Ashaman Ashyamandra Aximus Baines Beagle Beowolf Berek Blinkinhek Blitt
This trigger:
#TRIGGER {%d Playtesters:%s(*)} {#VARIABLE namelist %replace( %1, " ", |); #SHOW @namelist;}
yields this:
Flamore|Ibblek|Mimer|Sarux|Shinobi|Tarzan|Woom|Yalpf
Works great. But trying to do the same to the list of Creators doesn't work.
(%d Creators:%s(*)} won't match.
(%d Creators: (*)} won't match.
(%d Creators:(*)} will match.
Assuming there must not be a space there is logical, but there is. I pasted the output above straight from the MUD. Maybe the following helps explain it, but it only raises more questions for me.
#TRIGGER (%d Creators:(*)} {#SHOW fired 2;#SHOW %1}
yields:
fired 2
So the pattern matches, but the list of names isn't stored in %1. I suspect the parentheses in the list of Creator names is a factor, but #SHOW %quote(%1) doesn't work either, and this wouldn't explain why the space before the first name can't be matched with a %s or " ". I tried other commands, too, and anything after any command that takes %1 as an argument doesn't execute. %1 just shuts it down. So I'm thinking, can the MUD output this line with special tags or formatting that can't be seen, can't be cut and pasted, and that's why I can't match on them? These are names of administrator types, after all, maybe they do this to prevent, I don't know, some kind of malicious trigger or alias or something more obscure.
Anyone have some knowledge in this area, or ideas?
Edited by Ton Diening by accident, Don't watch oscars and click.
Edited by - tondiening on 03/23/2003 20:48:42 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Mar 24, 2003 3:49 am |
11 Creators: Keil(C)(l) Mellandrin(C)(l) Ceres(T) Danbala(D) Elera(C)
Emphyrio(C) Mollow(C) Panin(C) Pure(C) Revol(C) Sightblinder(C)
8 Playtesters: Flamore Ibblek Mimer Sarux Shinobi Tarzan Woom Yalpf
205 Players: Aahz Adzel Alaric AlbertRoss Aldous AliX Anais Arcane Argoth
Ashaman Ashyamandra Aximus Baines Beagle Beowolf Berek Blinkinhek Blitt
You need to wrap the %1 with brackets to ensure it all gets considered as one piece. Important when you have () and , in your captured variable:
#TRIGGER {^%d Creators:%s(*)$} {#SHOW %replace({%1}," ","|")}
#SHOW 11 Creators: Keil(C)(l) Mellandrin(C)(l) Ceres(T) Danbala(D) Elera(C) Emphyrio(C) Mollow(C) Panin(C) Pure(C) Revol(C) Sightblinder(C)
Keil(C)(l)|Mellandrin(C)(l)|Ceres(T)|Danbala(D)|Elera(C)|Emphyrio(C)|Mollow(C)|Panin(C)|Pure(C)|Revol(C)|Sightblinder(C)
Ton Diening |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Mon Mar 24, 2003 8:34 pm |
Thanks Lightbulb,I was un aware of the %d and things being useable without
the ().It was very interesting to know it will still work.
megamog75
Keeper of the only printable help files for Zmud. |
|
|
|
|
|
|
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
|
|