Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: michel almeida on May 01, 2015, 10:50:38 PM

Title: script request
Post by: michel almeida on May 01, 2015, 10:50:38 PM
@omegaman their layouts are a maximum I'm open-mouthed and drooling
I had not seen the other
congratulations
how and the script cool.nut
You can insert messages in layout
how can I create a function has the posibility
making the read function to read an .ini file
with settings for me to call the function?
Title: Re: script request
Post by: omegaman on May 09, 2015, 06:18:52 AM
Michel-

Moved your post to scripting, to help with your question. I guess you're asking if there is a class to handle reading/writing to .ini files?
Title: Re: script request
Post by: michel almeida on May 15, 2015, 03:39:15 PM
Yes that's right

read and write
Title: Re: script request
Post by: raygun on May 15, 2015, 11:22:30 PM
Hi Michel,

There is a file module that you can use to open and write text files such as an ini file.

To use it in a layout or plugin script, you could do something like this:

Code: [Select]
fe.load_module( "file");

local ini_file = ReadTextFile( "file_i_want.ini" );

while ( !ini_file.eos() ) // keep going through the file until the end
{
   local line = ini_file.read_line(); // gets the next line of the file
}


It can also write out a file using the WriteTextFile() class...

see: https://github.com/mickelson/attract/blob/master/config/modules/file.nut

Title: Re: script request
Post by: michel almeida on May 16, 2015, 10:29:37 PM
thank you @raygun
I just do not intendi how to use the module
to get the result of the .ini file
to print the layout screen in pasicao x, y I want to position the result of the ini file