PiaCRT
Orange Dev
- 958
- Posts
- 14
- Years
- Age 29
- Mikan Island
- Seen May 11, 2025
Hello there. I've been trying to figure out how to use ruby to no avail. I have a script for a game developing software in which I need to compile this .rb script into an .exe
This is the script:
I am using the Ocra standalone from here: https://rubyforge.org/frs/?group_id=8185
If anyone could compile it for me I would be so thankful, I just can't get my laptop to co-operate with me.
Thanks for looking,
Pia Carrot
This is the script:
Spoiler:
Code:
require 'win32api'
Smallest_Float = 0.00000000000000001
Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', 'pppplp', 'l')
Findwindow = Win32API.new('user32', 'FindWindowA', 'pp', 'l')
def get_rgss_handel(ini = ".\\Game.ini")
if !FileTest.exist?(ini)
exit
end
game_name = "\0" * 256
Readini.call('Game', 'Title', '', game_name, 255, ini)
game_name.delete!("\0")
return Findwindow.call('RGSS Player', game_name)
end
GetAct = Win32API.new('user32.dll', 'GetActiveWindow', '', 'i')
SetAct = Win32API.new('user32.dll', 'SetActiveWindow', 'i', 'i')
SetFor = Win32API.new('user32.dll', 'SetForegroundWindow', 'i', 'i')
IsWnd = Win32API.new('user32.dll', 'IsWindow', 'i', 'i')
$handel = get_rgss_handel
cores = ENV['NUMBER_OF_PROCESSORS'].to_i
sleeptime = ARGV[0].to_f
loop do
is_window = IsWnd.call($handel)
if is_window == 0
exit
end
act = GetAct.call
if act != $handel
# SetAct.call($handel)
SetFor.call($handel)
end
sleep(sleeptime)
end
I am using the Ocra standalone from here: https://rubyforge.org/frs/?group_id=8185
If anyone could compile it for me I would be so thankful, I just can't get my laptop to co-operate with me.
Thanks for looking,
Pia Carrot