Author Topic: script request  (Read 2301 times)

michel almeida

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
script request
« 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?
« Last Edit: May 01, 2015, 10:53:48 PM by michel almeida »

omegaman

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 880
    • View Profile
Re: script request
« Reply #1 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?

michel almeida

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: script request
« Reply #2 on: May 15, 2015, 03:39:15 PM »
Yes that's right

read and write

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 391
    • View Profile
Re: script request
« Reply #3 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


michel almeida

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: script request
« Reply #4 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