Modding, Mission Design, and Coding > The Scripting Workshop

Execute EXE file on computer while playing

(1/4) > >>

coffeesoft:

 Hi, i wanted to ask if someone knows if is possible to execute a EXE file stored on the computer while playing, for example when a enemy arrives or whatever.

Thanks.

The E:
Before I answer this, let me ask: What do you want to do?

coffeesoft:

 I want to use AutoHotKey and run some scripts to turn on lights, display messages... for example.

I learned to program this tool a little and wanted to do some testing if possible  :)

The E:
Ah. That seems much more reasonable than what I feared you wanted to do :)

The answer is simple. Just use

--- Code: ---os.execute("Your command here")
--- End code ---

coffeesoft:

 Thanks   :p

Questions.

- Where i put the EXE file, inside mod folder ?

- Wich OS command i must use to launch the file ?


Something like that would work ?


--- Code: ---#Conditional Hooks
$Version: 3.7
$On Game Init:

Graphics.setColor(255, 255, 255)
Graphics.drawString("Running EXE !", 5, 10)

os.execute("Script1.exe")

]
+Override: YES
#End
--- End code ---


Navigation

[0] Message Index

[#] Next page

Go to full version