 |
Evilhunter Newbie
Joined: 01 Dec 2007 Posts: 7
|
Posted: Sun Dec 02, 2007 1:32 am
[Pro 2.14a beta] Problem with <send>/alias(may be) and two windows |
Probably this is the bug (may be not and I did something wrong).
Simple explanation of the problem:
I have two windows, let it be "window1" and "window2".
And I have two aliases:
1. alias1
window2: #clr
#window window2 Output from alias1
#window window2 <send "alias2">link</send>
2. alias2
window2: #clr
#window window2 Output from alias2
I type being in "window1": alias1
And I have window2 cleared and "Output from alias1" and link described before - so, that's ok.
After I click the link I'll have "Output from alias2"... BUT without clearing the window...
The same story if we'll replace the source into the <send "alias1">link</send>
The output will be a bit different but there will not be clear screen after we click the link..
What is the problem with that, who can answer?
Is that a bug or a feature? :)
Thanks.
Mike. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 03, 2007 5:52 pm |
That's because the link you are clicking on is in the "window2" window, and the "alias2" alias is defined within your "window1" window. Settings within a window are *private* and cannot be seen by other windows. You need to move your "alias2" alias into a global module. Then both windows will be able to see it.
|
|
|
|
 |
Evilhunter Newbie
Joined: 01 Dec 2007 Posts: 7
|
Posted: Mon Dec 03, 2007 6:57 pm |
Thank you for the reply!
But.. :) The problem is not in that :(
Through I'm a programmer already about 15 years (I used zMUD for 3 years before also), of course, I did some research around this problem before
posting this topic.
I can extend the description of the problem:
I did even 2 tests more.
1. I tried to write <sent "window1:alias2">link</sent> (while my alias was defined in window1) - that was to access private (for window1) alias2
2. Actually my first post of this topic was about the code as you advice. It was external module (should be *public* for both windows I have). So alias1 and alias2 were defined in this public module.
And in both situations there is the problem that I noticed before. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 03, 2007 8:07 pm |
If the module is marked as "External", then it is only available to *other* packages and not to it's own package. The module should be marked as "Global".
In any case, you should copy/paste the XML for the module that contains the alias2 so that we can see it. I just tried the following code and it worked fine:
| Code: |
| #module global;#alias alias1 {window2: #clr;#window window2 Output from alias1;#window window2 {<send "alias2">link</send>}};#alias alias2 {window2: #clr;#window window2 Output from alias2} |
Notice that both aliases are within the "global" module. When I type "alias1" in the main window1, it properly sends the text to window2 and when I click on the link in window2, it properly executes alias2. So it's working fine here. |
|
|
|
 |
Evilhunter Newbie
Joined: 01 Dec 2007 Posts: 7
|
Posted: Mon Dec 03, 2007 9:13 pm |
I did absolutely the same from the beginning (I mean "external" module in case that aliases defined in it but not in windows; module preference was set as "global").
And "alias2" executed properly from the beginning... EXCEPT.. command #clr in "alias2" (if it called by click).
If it called by hands form main "window1" - #clr is executed properly. But if by link click - only output without #clr.
Everything you explained here is absolutely clear for me (and I did like this from the beginning, again) - thank you for that very much anyway.
The problem only in command #clr in "alias2" when alias called from link click.
Sorry for my long annoying.. :(
P.S. I can send you screens from my script editor to let you be assured that I have all I'm talking here about :) |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 03, 2007 10:47 pm |
OK, sorry it took me so long to understand what you were saying.
When a CMUD command is executed from within an MXP menu, CMUD restricts certain commands. This prevents the MUD from creating a dangerous menu that might do something bad to your computer if you click on it. So CMUD has a list of which commands will work from within a MXP SEND tag.
For some reason, #CLR was in this list. So it was working just like it should and was not executing #CLR from within an MXP menu (from within alias2 in this example).
I don't know why #CLR was in this list. Maybe I didn't want the MUD able to clear your entire scrollback. But I can see where this command is useful in your example. So in 2.15 I have removed #CLR from the "dangerous" list so that you can use it in your SEND tag.
But everyone should keep in mind this restriction. At some point I'll publish the list of restricted commands, but this is why something in a SEND tag might not work as expected. |
|
|
|
 |
Evilhunter Newbie
Joined: 01 Dec 2007 Posts: 7
|
Posted: Mon Dec 03, 2007 10:58 pm |
Thank you very much, Zugg! That's I call GREAT support!
Sorry, that it took so much of your time. |
|
|
|
 |
|
|
|