Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: BOXXMAN on July 23, 2017, 10:00:32 AM

Title: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: BOXXMAN on July 23, 2017, 10:00:32 AM
How would you go about sending variables to external AHK scripts for example. In Hyperspin, you could use "%romname%" and "%systemname%" to send variables to an AHK script. You could also use the clipboard function in AHK to capture variables and then copy them to your script. However, with AM, or I don't know how you can extract those variables to use with scripts that aren't written in squirrel. I am much more comfortable with writing AHK scripts to automate a lot of things, and would rather do that than use squirrel scripts. So is it possible to get the variables and pass them to AHK, or anything else for that matter? If squirrel had some sort of function that could just copy variables to the clipboard that would work, so they could then be copied into another application.
Title: Re: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: keilmillerjr on July 23, 2017, 12:53:41 PM
6 threads down: http://forum.attractmode.org/index.php?topic=1705.0
Title: Re: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: BOXXMAN on July 23, 2017, 04:01:47 PM
6 threads down: http://forum.attractmode.org/index.php?topic=1705.0
You directed me to a thread I also started about command line parameters. I'm not asking how you send them in a .nut script or in squirrel itself. I'm wondering how you those variables and either output them to a script written in another language. Those variables, ie-  fe_game_info(Info.Name) cannot be used as a variable  in an external AHK script. For one, it contains illegal characters and, AHK doesn't recognize it as a variable anyway. What I want to know is if it is possible to take the variables that AM outputs, and say do a copy function, so that it can be transferred with the clipboard command of AHK for example. I don't even know if taking variables from a script in squirrel and exporting them to another application can be done.This may just be an impossibility in general, mixing apples and oranges. This also applies to Windows PC BTW.
Title: Re: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: keilmillerjr on July 23, 2017, 06:31:41 PM
You can store Params and variables in autohotkey. I've done it. I never thought about illegal characters. Is it possible you can escape them?
Title: Re: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: BOXXMAN on July 23, 2017, 08:53:31 PM
You can store Params and variables in autohotkey. I've done it. I never thought about illegal characters. Is it possible you can escape them?

I know you can store variables in AHK, my problem is how do I get them from AM? Is there a way to output them from AM, so they can be used in an AHK script? I don't know how you take the variables from AM and make them something an external AHK script can use.
Title: Re: Does Anyone Know How to Use AM Variables in External Scripts?
Post by: keilmillerjr on July 24, 2017, 03:45:17 AM
You can store Params and variables in autohotkey. I've done it. I never thought about illegal characters. Is it possible you can escape them?

I know you can store variables in AHK, my problem is how do I get them from AM? Is there a way to output them from AM, so they can be used in an AHK script? I don't know how you take the variables from AM and make them something an external AHK script can use.

The same exact way as in your thread!

See the ahk docs: https://autohotkey.com/docs/Scripts.htm#cmd