About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Sun Jan 11, 2009 6:39 am   

MXP question
 
I have an alias that makes use of the #read command to execute a script from a file. This alias works fine when called directly from the command line. I then tried to make use of this alias by executing it from an MXP <send> menu that I built. The alias still executes fine, but the #read command will no longer function.

I understand from the MXP documentation that I read that you can't use #read, #write, or #file from the #MXP command for security reasons. The documentation gave me the impression however, that as long as the use of those commands was inside a locally defined alias, that the functionality should still be usable in this scenario. Am I misunderstanding what is being said here? This is the section from the MXP documentation that gave me this impression:
Quote:
Not all zScript commands can be used in this way. Some commands are protected because they can be used to create and remove files, run applications, and so on. If you find that a script isn't working from an MXP tag, or if your script is complex, first create an alias for that command and then use the <send> tag to run the alias:
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jan 13, 2009 4:32 am   
 
Can you post the code you are running?
_________________
Asati di tempari!
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Tue Jan 13, 2009 5:23 am   
 
I don't have the old code since I ended up abandoning the use of files since I couldn't get this working. Here is an example that is the same as what I was attempting though. I created a file test.txt with a single line in it saying
Code:
#show This is the line from the file

I saved this file in the same directory as the main session package file. I then created an alias
Code:
#alias test {#show Reading file;#read test.txt}

This alias works fine from the command line (you see the show from the alias and from the file displayed as output). I then made an MXP line
Code:
#mxp Click <send 'test' 'test'>this</send>

Executing the alias from this MXP tag you get the show from the alias but not the show from the file.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Jan 13, 2009 6:50 am   
 
I'm sorry, writing on the run...

May be it is stupid suggestion, but have you tried
Code:
#MXP 1 Click <send 'test' 'test'>this</send>
?
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Tue Jan 13, 2009 12:32 pm   
 
Yeah, I tried that with the same results. Secure mode is supposed to default to on anyway according to the #MXP command documentation, and I believe it is since if I do
Code:
#MXP 0 Click <send 'test' 'test'>this</send>

I get the following output where the MXP doesn't even create the link
Code:
Reading file
Click <send 'test' 'test'>this</send>
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net