|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sat Jan 27, 2007 3:29 pm
Newline Issues |
I've searched the forums for my issue and didn't find anything that helps with my issue. I'm not quite sure what's going wrong, I only know that when I use ZMud with my MUD of choice (I've used MUSHClient for quite some time without any problem on the same MUD), my text is sometimes displayed a bit screwy. Specifically, my prompt doesn't end with a linebreak, which leads to the next line I receive from the MUD spilling onto the prompt line, leading to some very ugly displays.
blink
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0You blink in utter disbelief.
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0
hm
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0You Hmmmm out loud.
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0
This leads to a few annoying issues, the chief of which being I can't #GAG my prompt without potentially hiding legitimately important unique messages. I've tried messing with the GA/EOR checkbox and adding %cr, %lf, and/or %crlf to my prompt trigger. Adding the carriage return variables do result in adding a newline to my display, but also send an empty line to my MUD, resulting in yet another prompt display, which rapidly turns into a pretty unfortunate (and spammy) loop.
Has anyone else had this issue? Is there a way I can pipe the newline character to MY display only without having to send it to the MUD itself? Any other recommendations on how to resolve this?
I've only had ZMud for a little while, and this is the only issue I've had with it so far. Unfortunately it's a fairly big one, seeing as how it's stopping me from taking full advantage of triggers and such. I appreciate any help you guys can give me with this. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Jan 27, 2007 3:34 pm |
Try this:
#trig {[Health]: (%d)/(%d) [Move]: (%d)/(%d) [Credits]: (%d)} {#sub {~[Health~]: %1/%2 ~[Move~]: %3/%4 ~[Credits~]: %5 %cr}} |
|
|
|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sat Jan 27, 2007 3:45 pm |
I'm afraid that just prints a duplicate of my prompt. Now the duplicate is on the same line as the next line that's displayed.
: 514/51/4 [Move: 1070/1070 [Credits]: 0You say in Pirate, 'Yar!'
: 514/51/4 [Move: 1070/1070 [Credits]: 0
: 514/51/4 [Move: 1070/1070 [Credits]: 0You ask in Pirate, 'Ahoy?'
: 514/51/4 [Move: 1070/1070 [Credits]: 0 |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Jan 27, 2007 4:22 pm |
This is closer to what you asked for...
Code: |
#TRIGGER {~[Health~]: (%d)/(%d) ~[Move~]: (%d)/(%d) ~[Credits~]: (%d)} {#say ""} |
You also will want to have GA/EOR checked.
Finally you may want to add a conditional trigger to #gag completely blank lines.
Something similar to this
Code: |
#TRIGGER {~[Health~]: (%d)/(%d) ~[Move~]: (%d)/(%d) ~[Credits~]: (%d)} {#say ""}
#COND {^$} {#gag} {within|param=1} |
Basically this puts a blank line at the end of every prompt if there isn't one; then gags the result if the blank line is visible to you.
This does NOT send the blank lines to the mud so it will not cause any extra prompts to be sent. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sat Jan 27, 2007 4:46 pm |
I reconfigured my prompt within the MUD so it's more trigger friendly (no more brackets and whatnot). Now it reads
Health - 514/514 Movement - 1070/1070 Credits - 0
I took your advice, Arminas, and tried both sets of code. Neither of them seemed to do the trick (I changed the pattern to accommodate the new prompt and tested it using the Test Tab on the Trigger Configuration screen and everything matched up alright, so I know that the thing's firing. However, I did find something that seems to work out alright.
Pattern:
Health - %1/%1 Movement - %1/%1 Credits - %1
Value:
#SUBSTITUTE {Health - %1/%2 Movement - %3/%4 Credits - %5}
#SAY {""}
I used %1 instead of %d so I can retrieve the variables again later for the substitution (and eventually just add them to global @ variables for use in my status bar so I can gag the prompt completely). No more run-on line issues. I haven't tested it extensively, yet, but it looks like it's going to work out alright. Are there any glaring flaws with this method? Do I risk GAGging potential non-prompt related data by adding a #GAG in there? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Jan 27, 2007 7:58 pm |
Stupid me I forgot to anchor the trigger.
#TRIGGER {^~[Health~]: (%d)/(%d) ~[Move~]: (%d)/(%d) ~[Credits~]: (%d)$} {#say ""}
#COND {^$} {#gag} {within|param=1}
Yes I know you changed it so that will no longer work. But you could still test it with your new trigger pattern.
The substitute thing is not required so you could just remove it, anchor the trigger with the ^ and $ and leave the #say.
As long as you are using the #say "", and know it works because you have seen that Things no longer show up after the prompt gagging the prompt will not hurt you. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sat Jan 27, 2007 10:52 pm |
I copied your trigger directly, making only changes to the pattern to ensure it would execute and it still isn't working, despite having the anchors. Even without the gag conditional (making it as simple as I can to pinpoint the problem), the newline isn't sent. Adding the conditional isn't hiding the newlines, either.
Unfortunately, upon further testing, I've found that the #SUBSTITUTE I was adding to "make it work" was actually just replacing the newest line before the next prompt, effectively hiding all single-line MUD texts. Logically speaking, I have no clue why this isn't working. I've copied and pasted things directly, changing only the patterns so that it fires proper.
I've checked to make sure I don't have any other triggers or functions that might be interfering with the process, but this one's the only one I have enabled at the moment. Any other ideas? I really appreciate the help. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Jan 27, 2007 11:22 pm |
Ok, First start with your trigger that you are fairly certain is firing because it was substituting.
Take out or comment out whatever else is there and put
#say Fired
To make sure that it is firing each time you get the prompt. IF it is then is it putting the word FIRED on the next line or after the prompt?
Is it like this?
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0Fired
Or like this?
[Health]: 514/514 [Move]: 1070/1070 [Credits]: 0
Fired
Ok, Start there and tell me how it goes? |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sun Jan 28, 2007 8:35 am |
Health - 514/514 Movement - 1000/1070 Credits - 0
Fired
It posts it on the next line with nothing but the pattern ( Health - %1/%1 Movement - %1/%1 Credits - %1 ) and the value #say Fired in the trigger.
If you'd like to logon to the MUD and try it yourself, the connection information is mud.infolaunch.com : 8060. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sun Jan 28, 2007 3:57 pm |
OK, after playing a few moments on your Mud... Why don't you just use the %N to configure your prompt?
I added %N-#gagme
to the end of my prompt and then made this trigger.
Code: |
#TRIGGER {^-#gagme$} {#gag} "" {nocr|prompt} |
After that I could create another trigger that matched my prompt and gag it if I needed to with no worries that I was going to gag text that I wanted. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Evre Newbie
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sun Jan 28, 2007 6:32 pm |
I had a very vague notion of just that thing in my head, though with much less concrete methods of implementing it. I was thinking of using aliases or... something, I don't even know.
So I just need to configure my prompt to say a keyword like "-gagme" and the #GAG trigger should just gag that line, instead of the one before or after it?
I'll try it and see. Thank you very much for your help. |
|
|
|
|
|