[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Perlscript
. . -> [Subject]  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] Refresh page


Posted by Purbam   (8 posts)  [Biography] 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!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Purbam   (8 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] 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
[Go to top] top

Posted by Purbam   (8 posts)  [Biography] 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!
[Go to top] 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.


15,291 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]