RGSSDLL = Win32API.new('kernel32', 'GetModuleHandleA', 'p', 'i').call("System/RGSS300.dll")
RVM = Win32API.new('load.dll', "Initialize", 'l', 'v')
RVM.call(RGSSDLL)
# 脚本编译为 YARV 字节码
code = $RGSS_SCRIPTS[1..-1].map{|v| v[3].force_encoding('UTF-8') }.join("\n")
arr = RubyVM::InstructionSequence.new(code).to_a
# 加载字节码并执行
RubyVM::InstructionSequence.load(arr).eval
msgbox 11 # 此行不会被执行
RGSSDLL = Win32API.new('kernel32', 'GetModuleHandleA', 'p', 'i').call("System/RGSS300.dll")
RVM = Win32API.new('load.dll', "Initialize", 'l', 'v')
RVM.call(RGSSDLL)
# 脚本编译为 YARV 字节码
code = $RGSS_SCRIPTS[1..-1].map{|v| v[3].force_encoding('UTF-8') }.join("\n")
arr = RubyVM::InstructionSequence.new(code).to_a
# 加载字节码并执行
RubyVM::InstructionSequence.load(arr).eval
msgbox 11 # 此行不会被执行