Topic:   Open and Quit an Application?   (Read 9202 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Open and Quit an Application?
« on: January 29, 2011, 09:57:24 PM »
What's the Sc code to quit or open an outside application?
I remember there must have been some code that did it...

Thanks.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Open and Quit an Application?
« Reply #1 on: January 30, 2011, 08:09:45 AM »
I think "GOTOCARD appName" does it in GM, so maybe the equivalent is somewhat similar in SC.
I survived the spammage of 2007

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Open and Quit an Application?
« Reply #2 on: February 03, 2011, 02:05:52 PM »
LAUNCH opens a program. There is no way to quit a program. Wait for shell commands.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Open and Quit an Application?
« Reply #3 on: February 03, 2011, 08:59:31 PM »
So it can open the plugin automatically which is great.
But I suppose the thing will sit there acting suspicious until it's 5 minutes is up. Oh well. XD
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

GMG Mike


  • Administrator

  • GMG-er

  • *****

  • no avatar

  • Posts: 536
    • mikerichardson.name
Re: Open and Quit an Application?
« Reply #4 on: February 07, 2011, 07:24:04 PM »
GMOnline would read a text file every second to check for commands and data. You could write QUIT to cause GMOnline to quit.

However, a much more clever way (possible with SC games) to have an external plugin communicate with your game is to use a socket. Open a socket and have it listen on a unique port such as 56237 (don't use that one, make up your own 5 digit port for the plugin). Then you LAUNCH the plugin, which will attempt to connect to localhost (127.0.0.1) on the same port.

When you want to quit the plugin then you can just send a quit command somehow (you could implement EZProtocol into the plugin if you wanted to, so it would be as easy as sending commands with an easy socket).