|
heidi Newbie
Joined: 04 May 2002 Posts: 1
|
Posted: Tue Apr 02, 2002 8:42 pm
Problem using #Sub with a blank line |
Hello:
Coming back to MUDs (been playing EverCrack for awhile) so I'm a bit rusty. I've been having a hell of a time trying to get #Sub to work with blank lines and was hoping for some help.
Basically, on MUME I need to improvise a "look" command that will include the exits. When you enter a room the room name, description and exits are all shown. When you "look" only the room name and description are given.
So, I wrote a trigger to capture the exits and then tried to write an alias that would tack this on the first blank line after sending a "look" command. e.g.:
#alias {zlook} {look;#temp {$} {#sub @Exits}}
But, this doesn't work. I verify that the trigger does get activated (Show Triggers does show "[$-> #sub @Exits]").
FYI, I don't have any scripts gagging blank lines or the like. For giggles I tested this without any other settings and it still failed.
I did a lot of tests, pulled a lot of hair out and eventually gave up. Thought I would throw the question out here just in case anyone has a way around this.
Following are some of my favorite aliases that also didn't work:
#alias {zlook} {look;#temp {(*)$$} {#sub %1%{cr}@Exits%{cr}}}
--> This never triggered
#alias {zlook} {look;#temp {${(o|*)}%2>} {#sub @Exits%{cr}%1%2>}}
--> Forget exact syntax, but never came out right and could rarely get to trigger
#alias {zlook} {look;#temp {$} {#send @Exits}
--> Worked, but #Send queues up the text after everything else in the buffer so there was no telling where it would end up.
Thanks,
El_Dickman |
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Tue Apr 02, 2002 10:04 pm |
Don't have zMud in front of me to play with, but have you looked at #echo or #show?
-Tarn |
|
|
|
heidi Newbie
Joined: 04 May 2002 Posts: 1
|
Posted: Tue Apr 02, 2002 11:44 pm |
Oops! My bad. The last example of a failed trigger should have said #Show instead of #Send. #Echo won't work for me since I want the text to go to the window it originated in.
The problem with #Show is that it tacks the text at the end of the buffer and not on or after the line it is processing. So, the zLook command would include at least a prompt and possibly a bit more before the exits were shown.
Naturally I can use #Nomap to remove common items like blank lines, prompts, narrates, etc. It just seems to me that doing #Sub on a blank line should work and would be a much cleaner solution.
Thanks,
El_Dickman |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Apr 03, 2002 1:09 am |
Just for giggles try:
#AL zlook {look;#TEMP {^$} {#SUB {@Exits}}} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Apr 03, 2002 1:44 am |
Try this:
#TR {$} {#SUB @exits;#T- zlook} {zlook}
#AL zlook {#T+ zlook;look}
LightBulb
All scripts untested unless otherwise noted |
|
|
|
heidi Newbie
Joined: 04 May 2002 Posts: 1
|
Posted: Wed Apr 03, 2002 6:57 pm |
Thanks Tarn, Vijilante and LightBulb. None of the suggestions worked in my tests. After extensive testing of the #Sub command I believe that it is flakey and I'll avoid it wherever possible.
In this case I'll focus on a solution with the #Show command and will #Gag as much as I can so little extraneous information gets into the room description.
Thanks again,
El_Dickman |
|
|
|
|
|