 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Mon Jun 21, 2010 11:51 pm
3.20 mxp triggers on prompt with ansi codes |
the mxp triggers don't seem to handle the %ansi(default) code well ...
the %mxp.data data gets truncated at some point, and %0 is truncated even further usually:
create a prompt trigger:
#MXPTRIG testprompt {PROMPT} {#show ECHOING: %mxp.data}
testing with this:
#MXP 1 <prompt>%ansi(green)2520h, 2698m, 11205e, 12400w %ansi(default)mex-</prompt>
results incorrectly in:
2520h, 2698m, 11205e, 12400w mex-ECHOING: 2520h, 2698m, 11205e
notice ", 12400w mex-" got truncated
with other ansi codes besides default or with no ansi code before "mex-" it works fine:
#mxp 1 <prompt>%ansi(green)2520h, 2698m, 11205e, 12400w %ansi(yellow)mex-</prompt>
or
#mxp 1 <prompt>%ansi(green)2520h, 2698m, 11205e, 12400w mex-</prompt>
results normally in:
2520h, 2698m, 11205e, 12400w mex-ECHOING: 2520h, 2698m, 11205e, 12400w mex-
upon %ansi(default), it seems to truncate everything after the code and also the 9 characters before the ansi code
ie:
#mxp 1 <prompt>%ansi(green)2520h, 2698m, 11205e, 12400 abc123456789%ansi(default)</prompt>
results in:
2520h, 2698m, 11205e, 12400 abc123456789ECHOING: 2520h, 2698m, 11205e, 12400 abc |
|
Last edited by dbosst on Tue Jun 22, 2010 6:51 am; edited 1 time in total |
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jun 22, 2010 2:26 am |
What version are you using? When reporting a problem on the Beta forum, it's important to note the version, usually in the subject line. I recall a report of a bug like that before. I can't recall now whether that bug has been fixed yet.
|
|
|
|
 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Tue Jun 22, 2010 6:52 am |
I am using 3.20, I have fixed the title to reflect that
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jun 22, 2010 5:27 pm |
If you are talking about enabling the "Trigger on Prompt" option for your MXP trigger, the %mxp.data is not defined at that point. A "Prompt" MXP trigger fires immediately on the initial MXP tag and the text following the tag has not yet been parsed at that point, so all you have is the parameters.
However, if your MXP trigger is a normal trigger (Trigger on Newline) then I was able to reproduce your problem. I've added it to the bug list.
(btw, for others testing this in a blank session, you need to do a:
#MXP <!ELEMENT PROMPT>
to define the Prompt tag before the trigger will work, and also turn on the Force Remote MXP option.) |
|
|
|
 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Thu Jun 24, 2010 3:28 am |
Yes it was just a "trigger on newline" mxp trigger (not trigger on prompt)
This trigger was actually just my master prompt trigger, which I tried to convert to a much simpler mxp prompt trigger (which I assume is much faster than a complicated regular expression) |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jun 24, 2010 12:50 pm |
Possibly a digression, but I am confused how it can be your "master prompt trigger" and not be trigger on prompt. Unless you mean something different than most of us by "master prompt trigger".
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jun 24, 2010 5:19 pm |
Terminology is a bit confusing with MXP triggers. A "trigger on newline" MXP trigger means to fire the trigger when the closing </tag> is given. It doesn't really wait for a newline. A "trigger on prompt" MXP trigger fires the trigger on the initial opening <tag>. So even his "trigger on newline" MXP trigger is firing on the "MUD Prompt" before the newline is received.
|
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 25, 2010 12:49 am |
Ah! Good to know.
|
|
|
|
 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Mon Jun 28, 2010 1:20 am |
Zugg, this bug is fixed in 3.21 as far as I can tell! Thanks!
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jun 29, 2010 4:36 pm |
Hmm, that's very interesting because I didn't think I changed anything related to this ;)
|
|
|
|
 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Wed Jun 30, 2010 2:14 pm |
I changed my mind, it is broken, but for some reason it breaks in different cases? I don't know what happened after I get rid of my old package, but the bug is still there so ignore what I said about it being fixed :(!
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 30, 2010 4:22 pm |
OK :) It's still on my bug list
|
|
|
|
 |
|
|
|