Read and Writing to a INI

I am trying to use Zeriab's ini example to read and right to the Game ini for now

module INI READ_INI = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l') WRITE_INI = Win32API.new('kernel32', 'WritePrivateProfileStringA', %w(p p p p), 'l') def self.Read(key_name, app_name = 'Game', filename = 'Game.ini', buffer_size = 256, default = '') buffer = "\0" * buffer_size READ_INI.call(app_name, key_name, default, buffer, buffer_size - 1, ".\\" + filename) return buffer.delete("\0") end def self.Write(key_name, value, app_name = 'Game', filename = 'Game.ini') return WRITE_INI.call(app_name, key_name, value.to_s, ".\\" + filename) endendThen I call it:

if !GCL.include?("BootLoader_0395") if GCL.include?("test") or GCL.include?("debug") msgbox(INI.Read("DTitle")) else exit endendGame.ini for now

[Game]RTP=Library=System\RGSS301.dllScripts=Data\Scripts.rvdata2Title=Launcher, Game, Maker testDescription=Custom Launcher what supports test/debugging test.CreationDate=[Launcher]DTitle=James BondI am not getting any errors but the message box that is prompted is blank no message in it saying James Bond, also how would I move the save's and get the ini to read from the documents folder of that logged in user.

I really don't get ruby at all, I am a Lua man myself and I just can't get my head around these calls at times, could you give us a hand.

Also another question how do I set the title of the message box or would I have to call a message box via the winapi to be able to set the message box title?
Because the script doesn't do any kind of error checking. The default section is Game, but DTitle's section is Launcher:

msgbox(INI.Read("DTitle", 'Launcher')) 
would I have to call a message box via the winapi to be able to set the message box title?
Yes. Buttons, icons, caption, and so on can't be changed with Kernel#msgbox and Kernel#msgbox_p.
Because the script doesn't do any kind of error checking. The default section is Game, but DTitle's section is Launcher:

msgbox(INI.Read("DTitle", 'Launcher')) Yes. Buttons, icons, caption, and so on can't be changed with Kernel#msgbox and Kernel#msgbox_p.
 Or ya now reading the arguments again on here about you put that it makes sense lol

And OK its not two hard to make a windows call can RPG Maker call other files does it have a IO for running exe's if anyone knows? as I can do advansted dialog calls from my launcher so I could just add a command listener to it to call custom styled dialogs.

?

Edit:

Also how would I make it save to the docs folder and how would I drop the save options in to a ini file?

Edit 2:

OK I found out how to send arguments back to my Launcher using the system command, so I can now create custom dialog box's on my own tool, What I need to know now is there a way to call my first script before the window is drawn as I don't want the dirty black window before it does it's checks?

Original thread: https://forums.rpgmakerweb.com/threads/read-and-writing-to-a-ini.39027/