Cant get os.execute to work in game. - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 06-11-2018, 02:56 AM   #1
A Hamburgler
Junior Member
 
Join Date: Mar 2018
Posts: 66
Default Cant get os.execute to work in game.

To start off I did edit the MissionScripting.lua file but anyway Im having trouble getting os.execute to work. In game I use a trigger with do script file to call a script with
Code:
os.execute[[Test2]] or os.execute[[Test2.bat]]
I see the bat file pop up for a second but nothing happens. When I double click on the bat file it runs and executes my code perfecty. Im just having trouble executing it from within the game.


My bat code is
Code:
start "Generate First Mission" cmd /k "..\..\..\..\bin\luae.exe Init_Next_Mission.lua & exit"

And the Init_Next_Mission.lua code is
Code:
Data_Side1 = 1
Data_Side2 = 0	
Data_Side3 = 0	
Data_Side4 = 0	
Data_Side_String = string.format("AlphaZone1_Side11 = %s AlphaZone2_Side11 = %s AlphaZone3_Side11 = %s AlphaZone4_Side11 = %s ",Data_Side1,Data_Side2,Data_Side3,Data_Side4)
local file = io.open("Var_Carryed_Over.lua", "w")
file:write(Data_Side_String)
file:close()
Again every works as it should when I run it straight from the bat file but nothing happens when I run the same file from in game. Basically my goal here is to transfer some mission variables to a newly create lua file at which point my next mission will run that newly created file with those updated variables. So if anyone knows a better way please point me in the right direction. Thanks
__________________
ASRock Z370 Killer SLI/ac, I5 8600k @4.5 GHz, Evga Gtx 1080TI SC2, G.SKILL Sniper X Series 32GB DDR4 3200, WD 2TB Performance HDD, Win10, Thrustmaster Warthog, Samsung Odyssey.

Last edited by A Hamburgler; 06-11-2018 at 02:59 AM.
A Hamburgler is offline   Reply With Quote
Old 06-11-2018, 07:17 AM   #2
Ciribob
ED Testers Team
 
Join Date: Mar 2015
Location: Brighton, UK
Posts: 1,704
Default

If it opens and immediately closes, I'd put the full path in the bat file and also cd to the right directory to be sure it's not a working directory issue.

Sent from my ONEPLUS A3003 using Tapatalk
__________________
Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD
CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup
Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script

Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required!
DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord
Ciribob is offline   Reply With Quote
Old 06-13-2018, 03:40 PM   #3
A Hamburgler
Junior Member
 
Join Date: Mar 2018
Posts: 66
Default

Quote:
Originally Posted by Ciribob View Post
If it opens and immediately closes, I'd put the full path in the bat file and also cd to the right directory to be sure it's not a working directory issue.

Sent from my ONEPLUS A3003 using Tapatalk
Thanks for the reply I have not tried it yet I will on the weekend and report back. But I forgot to mention I tried to run the main script ( Init_Next_Mission.lua ) directly from dcs too and nothing happened that’s the only reasons why I was using the batch method. I am curious as to why when it’s called from the game nothing happens but when called externally it works.
__________________
ASRock Z370 Killer SLI/ac, I5 8600k @4.5 GHz, Evga Gtx 1080TI SC2, G.SKILL Sniper X Series 32GB DDR4 3200, WD 2TB Performance HDD, Win10, Thrustmaster Warthog, Samsung Odyssey.
A Hamburgler is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:12 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.