Jump to content


Photo

GMac-Terminal


  • Please log in to reply
20 replies to this topic

#1 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 02 December 2010 - 07:37 AM

-GMac-Terminal-


GMac-Terminal is an extension for Game Maker for Mac, that lets you run shell (Terminal) commands, right from Game Maker.

It consists of only one function, run_terminal(command), from which you have access to Mac OS X via the terminal.

Features:

  • Run terminal commands, right from Game Maker!
  • Spawn new processes of your app, or other apps! (all of this impossible within GM4Mac).
  • Disable or enable operating system functions!
  • Returns the status code of the terminal command you executed!
  • Use primitive networking functions, right within Game Maker! (Ping, SSH, etc).


Note: It's highly recommended that you read the 'help' pdf.

Licensing: Completely free to use for any purpose. Open Source extension

Credit: None required whatsoever. However, it would be a nice gesture of support for further extensions from me. :medieval:

Download

Source Code

Please feel free to request extensions you would like to see in the future (no promises though). Also, tell me how you like this extension!

Edited by ugriffin, 02 December 2010 - 07:39 AM.

  • 1

#2 Water Chicken

Water Chicken

    Got it memorized?

  • GMC Member
  • 1200 posts
  • Version:GM:Studio

Posted 02 December 2010 - 07:45 AM

Would this happen to fall under the
  • No applications that alter the operating system, system files, or registry settings rule?

Just wondering, someone correct me if I'm wrong.
  • 0

#3 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 02 December 2010 - 08:00 AM

This is an extension... I'm posting it here because there's no Mac extensions forum. <_<

Anyways, this has the potential to alter the operating system, and system files. But it doesn't by itself. As for the registry settings, there's no such thing on the Mac.
  • 0

#4 Water Chicken

Water Chicken

    Got it memorized?

  • GMC Member
  • 1200 posts
  • Version:GM:Studio

Posted 02 December 2010 - 06:35 PM

I know theres no registry on Macs. Just wondering if it did break that rule.
  • 0

#5 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 02 December 2010 - 08:13 PM

It doesn't modify anything.
  • 1

#6 vertex67

vertex67

    GMC Member

  • GMC Member
  • 515 posts

Posted 06 December 2010 - 06:27 PM

holy crap this is awesome.

so we can create easy GUI for any shell scripts we have laying around?

Edited by vertex67, 06 December 2010 - 06:31 PM.

  • 0

#7 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 07 December 2010 - 12:15 AM

Pretty much. ;)

Note that you'd have to execute your shell script using the 'sh' command. What I'd personally do is store the shell script inside the .app bundle, and then execute it via GM-Terminal.

However, there's hundreds of ways to use the terminal. Do what suits you best. :snitch:
  • 0

#8 vertex67

vertex67

    GMC Member

  • GMC Member
  • 515 posts

Posted 07 December 2010 - 05:04 PM

its gonna be fun using the say command
EDIT:
call me stupid, but I cant figure out what to do with the gex file, and how to add it as an extension

Edited by vertex67, 07 December 2010 - 05:05 PM.

  • 0

#9 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 07 December 2010 - 09:43 PM

You're using Game Maker 7.5.77? There's a bug in 7.5.66 that won't let you install extensions.

You can check your GM version in the top-bar, 'Game Maker for Mac'>'About Game Maker'.

You can install the gex by getting it out of the .dmg and putting it anywhere you want. On Game Maker for Mac, there's a little green plus (+) sign, in the main window. Click on it, then click on the 'Install' button on the window that pops out, another window will pop out, click on Install (again), and select the GMac-Terminal gex wherever you put it. It should appear as installed on Game Maker, and you should be back in the second 'Install' window. Click on OK, and you should be back on the first install window. On the available packages window, click on GMac-Terminal, and then click on add.

GMac-Terminal should now be enabled for your game. The run_terminal command should appear on that hint autocomplete box on the code editor, like normal GML commands.


Be sure to use the example.gmk file to see if the extension was installed properly (it will create a link to home in your desktop if it is), and read the help file!

And have fun using 'say'. :)

EDIT: I tried it myself. The following command is pretty funny:

run_terminal("say -v 'Cellos' 'Droid'");  

EDIT: I just noticed I packaged the wrong help file with the extension. I'll update it right now. Please redownload. :P

Edited by ugriffin, 07 December 2010 - 10:01 PM.

  • 0

#10 goldsonic46

goldsonic46

    GMC Member

  • GMC Member
  • 581 posts

Posted 11 December 2010 - 04:47 AM

I downloaded it today, but it doesn't seem to recognize the extension. I put under gamemaker's secret folder that contains the lib and the extension folders, but it can't recognize it.
  • 0

#11 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 11 December 2010 - 06:10 AM

You need to load it using Game Maker. This very question has already been answered in this topic... :rolleyes:

You're using Game Maker 7.5.77? There's a bug in 7.5.66 that won't let you install extensions.

You can check your GM version in the top-bar, 'Game Maker for Mac'>'About Game Maker'.

You can install the gex by getting it out of the .dmg and putting it anywhere you want. On Game Maker for Mac, there's a little green plus (+) sign, in the main window. Click on it, then click on the 'Install' button on the window that pops out, another window will pop out, click on Install (again), and select the GMac-Terminal gex wherever you put it. It should appear as installed on Game Maker, and you should be back in the second 'Install' window. Click on OK, and you should be back on the first install window. On the available packages window, click on GMac-Terminal, and then click on add.

GMac-Terminal should now be enabled for your game. The run_terminal command should appear on that hint autocomplete box on the code editor, like normal GML commands.


Be sure to use the example.gmk file to see if the extension was installed properly (it will create a link to home in your desktop if it is), and read the help file!


Edited by ugriffin, 11 December 2010 - 06:16 AM.

  • 0

#12 goldsonic46

goldsonic46

    GMC Member

  • GMC Member
  • 581 posts

Posted 11 December 2010 - 10:33 PM

How foolish of me. Well thanks. But I hate how if you put it in the .gamemaker hidden folder, you can't get to it if you try to install the extension.
  • 0

#13 vertex67

vertex67

    GMC Member

  • GMC Member
  • 515 posts

Posted 15 December 2010 - 03:00 AM

do you know if its possible to get output from a terminal script into gamemaker?
for instance something like
str=run_terminal("echo hello")

with the goal being str="hello"

does that make any sense?
I suppose it would work to output to a file and read from a file, but is there an easier way?
  • 0

#14 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 15 December 2010 - 05:42 AM

Doesn't str=run_terminal("echo hello") work? It's supposed to return whatever the terminal returns... :(

If it doesn't, I'll research a fix for you. Meanwhile, I guess loading from files will have to suffice... :/
  • 0

#15 vertex67

vertex67

    GMC Member

  • GMC Member
  • 515 posts

Posted 15 December 2010 - 06:10 PM

Doesn't str=run_terminal("echo hello") work? It's supposed to return whatever the terminal returns... :(

If it doesn't, I'll research a fix for you. Meanwhile, I guess loading from files will have to suffice... :/


no, I even tried using string() around the commands
whenever I try to draw str its just a 0
perhaps it is returning the status code of echo hello?

Edited by vertex67, 15 December 2010 - 06:15 PM.

  • 0

#16 ugriffin

ugriffin

    Idiot

  • Global Moderators
  • 1583 posts
  • Version:Mac

Posted 15 December 2010 - 06:43 PM


Doesn't str=run_terminal("echo hello") work? It's supposed to return whatever the terminal returns... :(

If it doesn't, I'll research a fix for you. Meanwhile, I guess loading from files will have to suffice... :/


no, I even tried using string() around the commands
whenever I try to draw str its just a 0
perhaps it is returning the status code of echo hello?


Yes, that's what it does. It returns the status of the command. So if the command fails, you get a -1, I think.

I'll research a way to supplement the system() command in the cases where you need some text returned to you.
  • 0

#17 BubbaMonkeyStudios

BubbaMonkeyStudios

    GMC Member

  • GMC Member
  • 129 posts

Posted 26 May 2011 - 01:11 AM

Excellent work, very useful since the "Open Webpage" command in GM4Mac does not currently work.
  • 0

#18 seeaya

seeaya

    GMC Member

  • New Member
  • 4 posts
  • Version:Unknown

Posted 03 October 2012 - 11:39 PM

The download link wont work for me. is there an alternative? Mediafire, Direct Download, etc.
  • 0

#19 Crhonos

Crhonos

    GMC Member

  • GMC Member
  • 235 posts
  • Version:GM:Studio

Posted 12 November 2012 - 11:51 PM

Download link is off, can you re-upload the project ?
  • 0

#20 cgeorge1122

cgeorge1122

    GMC Member

  • GMC Member
  • 4 posts

Posted 10 March 2013 - 04:21 AM

I've been doing a little digging, and ugriffin discontinued the project.

I was able though, to find someone's project with source, which included the .gex in the zip.
  • 0

#21 DanilaFe

DanilaFe

    Friendly Noob

  • GMC Member
  • 93 posts
  • Version:Mac

Posted 21 October 2013 - 02:40 AM

Hi ugriffin, I was just wondering... What does the command return? Would be handy if if returned the terminal output or whatever :) great extension, by the way.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users