Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Perlscript
➜ How to open up a DOS window?
How to open up a DOS window?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Purbam
(8 posts) Bio
|
Date
| Mon 26 Jan 2015 09:51 AM (UTC) |
Message
| I am trying to pop up a DOS window to mimic #mess function in zMUD.
It works well in LUA, with os.execute("echo something &pause"). But in Perl, either system() or exec() doesn't work.
If I use system(), the child process is created, but it doesn't pop-up the DOS window and therefore halts mushclient.
If I use exec(), the DOS window pops-up as expected, but mushclient exits when the DOS windows is closed, because exec() in Perl replaces the original process.
I also tried fork(), but unfortunately it is not supported in Perlscript on Windows.
Any suggestions?
Or, is there an easier way to mimic zMud's #mess function? What exactly I need is a window (or dialog box or whatever) to be pop-up to the top of my desktop when mushclient is minimized.
Thanks in advance! | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #1 on Mon 26 Jan 2015 10:29 AM (UTC) |
Message
| I don't know what zMud's #mess does exactly, but this might do it for you:
assert (utils.shellexecute ("cmd", "/C dir"))
Replace "dir" with "something" and see how you go. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Purbam
(8 posts) Bio
|
Date
| Reply #2 on Mon 26 Jan 2015 02:17 PM (UTC) |
Message
|
Nick Gammon said:
I don't know what zMud's #mess does exactly, but this might do it for you:
assert (utils.shellexecute ("cmd", "/C dir"))
Replace "dir" with "something" and see how you go.
Thanks a lot for the prompt reply!
If I understand correctly, the utils.* functions work in Lua only. But now I am using Perlscript as the script language. Can it also be used in Perl?
#mess in zMud is something like utils.msgbox. The different is, it can pop-up whatever the mud window is on the top or not. | Top |
|
Posted by
| Nick Gammon
Australia (23,102 posts) Bio
Forum Administrator |
Date
| Reply #3 on Mon 26 Jan 2015 08:10 PM (UTC) |
Message
| No it can't be used in Perl (doesn't Perl have something similar?).
You can always make a small Lua plugin, whose life is dedicated to simply putting up the message box and communicate with this plugin. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Purbam
(8 posts) Bio
|
Date
| Reply #4 on Tue 27 Jan 2015 01:12 AM (UTC) |
Message
| Yes, Perl do have some functions for system calls. But as I mentioned in my original post, they don't work well in mushclient.
Making a LUA plugin is a good idea, I will have a try. Thanks! | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
16,724 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top