Jump to content

io.open


Tic-Tac

Recommended Posts

I'm trying to output some data as a txt file to then read into Voice attack, as I'm not over experienced with LUA I'm trying to make sure each step of my plan is doable before jumping in, but am stuck with the export piece.

 

Everything I've learned so far has come form some very helpful posts in this forum, but it seems what others report 'works fine' I still get an error, so maybe a basic misunderstanding on my part

 

I'm saving the code below as a .lua file and then using 'do script file' to trigger the script

 

somedata = "Interesting information"

local exportFile = io.open("G:\LUA\file.txt", "w")

exportFile:write(somedata)

exportFile:close()

 

However I get an error message (attached)

 

 

 

I;m running DCS 1.5 as admin, and have created the file in the location referenced in the script

 

Any ideas/comments/suggestions gratefully received!

 

thanks

error.png.83a1eb52fa5f056b1ae2271a5e034fd5.png

Link to comment
Share on other sites

AFAIK these libs are protected in DCS. In this file : <DCS main directory>/Scripts/MissionScripting.lua there are calls to a SanitizeModule function which prohibits the use of these libs. You need to comment out the corresponding line to be able to use the lib.

  • Like 2

Whisper of old OFP & C6 forums, now Kalbuth.

Specs : i7 6700K / MSI 1070 / 32G RAM / SSD / Rift S / Virpil MongooseT50 / Virpil T50 CM2 Throttle / MFG Crosswind.

All but Viggen, Yak52 & F16

Link to comment
Share on other sites

  • 5 years later...
On 10/10/2016 at 10:03 AM, Whisper said:

AFAIK these libs are protected in DCS. In this file : <DCS main directory>/Scripts/MissionScripting.lua there are calls to a SanitizeModule function which prohibits the use of these libs. You need to comment out the corresponding line to be able to use the lib.

 

Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...