Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: Daniel Arcade on September 08, 2021, 08:14:16 PM

Title: You can write to a .txt or .ini file ?
Post by: Daniel Arcade on September 08, 2021, 08:14:16 PM
You can write to an .ini or .txt file via layout.nut example: hide_desktop=1 hide_desktop=0 (attract.ini)
Title: Re: You can write to a .txt or .ini file ?
Post by: Daimon on September 09, 2021, 10:38:13 AM
Please be more specific, what do you want to accomplish?
Yes you can read- or write to files.
Use the functions 'ReadTextFile(fn)' or 'WriteTextFile(fn)' from the 'file.nut' module.
alternatively you can experiment with fe.nv

https://github.com/mickelson/attract/blob/master/Layouts.md#nv

https://github.com/mickelson/attract/blob/master/Layouts.md#overview
Title: Re: You can write to a .txt or .ini file ?
Post by: Daniel Arcade on September 10, 2021, 01:23:59 PM
I want to put an option on the layout for it to write 1 or 0 on this line "hide_desktop=1" which is in a file called attract.ini