- Joined
- Apr 9, 2015
- Messages
- 67
- Reaction score
- 8
- First Language
- English
- Primarily Uses
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?
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?

