| 赞 | 10  | 
 
| VIP | 40 | 
 
| 好人卡 | 0 | 
 
| 积分 | 4 | 
 
| 经验 | 6245 | 
 
| 最后登录 | 2023-7-11 | 
 
| 在线时间 | 235 小时 | 
 
 
 
 
 
Lv2.观梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 382 
 
        - 在线时间
 - 235 小时
 
        - 注册时间
 - 2009-2-13
 
        - 帖子
 - 470
 
 
 
 | 
	
最近忙着帮人做游戏……偶尔看看这个工程,新开了一个,结果发现SLG后竟然出现“脚本已经被备份”……如原作中有此问题 
请用以下代码解决:- $__jmp_here.call if $__jmp_here
 
  
- #==========================================================================
 
 - OpenThread = Win32API.new("kernel32", "OpenThread", "LIL", "L")
 
 - CloseHandle = Win32API.new("kernel32", "CloseHandle", "L", "I")
 
 - Thread32Next = Win32API.new("kernel32", "Thread32Next", "LP", "I")
 
 - ResumeThread = Win32API.new("kernel32", "ResumeThread", "L", "L")
 
 - SuspendThread = Win32API.new("kernel32", "SuspendThread", "L", "L")
 
 - Thread32First = Win32API.new("kernel32", "Thread32First", "LP", "I")
 
 - GetCurrentProcessId = Win32API.new("kernel32",
 
 -   "GetCurrentProcessId", "V", "L")
 
 - CreateToolhelp32Snapshot = Win32API.new("kernel32",
 
 -   "CreateToolhelp32Snapshot", "LL", "L")
 
 - #GetLastError = Win32API.new("kernel32", "GetLastError", "V", "L")
 
 - #FormatMessage = Win32API.new("kernel32", "FormatMessage", "LLLLPLP", "L")
 
 - #==========================================================================
 
  
- #def get_sys_err_msg(err_code)    
 
 - #  buff = " " * 128
 
 - #  FormatMessage.call(0x00001000, 0x00000800, err_code, 0x0409, buff,
 
 - #                     256, 0x00002000)
 
 - #  return buff.strip!
 
 - #end
 
  
- # 通过系统快照获取系统线程信息
 
 - hSnapShot = CreateToolhelp32Snapshot.call(4, 0)
 
 - threadEntry = [28, 0, 0, 0, 0, 0, 0].pack("L*")
 
  
- # 需要的RM 线程 ID
 
 - threadID = 0
 
 - # 枚举所有线程
 
 - found = Thread32First.call(hSnapShot, threadEntry)
 
 - while found != 0
 
 -   arrThreadEntry = threadEntry.unpack("L*")
 
 -   if arrThreadEntry[3] == GetCurrentProcessId.call
 
 -     threadID = arrThreadEntry[2]
 
 -   end
 
 -   found = Thread32Next.call(hSnapShot, threadEntry)
 
 - end
 
  
- # 通过线程标识获取线程句柄
 
 - # 2: 暂停和恢复线程访问权限
 
 - # 2097151: 所有可能的访问权限(Windows XP 下无效)
 
 - $hCriticalThread = OpenThread.call(2, 0, threadID)
 
 - #$hCriticalThread = OpenThread.call(2097151, 0, threadID)
 
 - # 暂停 RM 的最后一个线程
 
 - SuspendThread.call($hCriticalThread)
 
 - # 关闭系统快照句柄
 
 - CloseHandle.call(hSnapShot)
 
  
- #==========================================================================
 
 - # 清除不需要的 Win32API 对象
 
 - OpenThread = Thread32Next = Thread32First = SuspendThread =
 
 - GetCurrentProcessId = CreateToolhelp32Snapshot = nil
 
 - #==========================================================================
 
  
- def resume_critical_thread
 
 -   # 恢复 RM 的最后一个线程
 
 -   while ResumeThread.call($hCriticalThread) > 1; end
 
 -   # 关闭线程句柄
 
 -   CloseHandle.call($hCriticalThread)    
 
 - end
 
  
- # F12 后的跳转标记
 
 - callcc{ |$__jmp_here| }
 
  
- #==========================================================================
 
 - # 脚本执行主过程
 
 - for subscript in 1...$RGSS_SCRIPTS.size
 
 -   begin
 
 -     eval(Zlib::Inflate.inflate($RGSS_SCRIPTS[subscript][2]))
 
 -   rescue Exception => ex
 
 -     # 异常发生并抛出给解释器时恢复线程
 
 -     resume_critical_thread unless defined?(Reset) && ex.class == Reset
 
 -     raise ex
 
 -   end
 
 - end
 
 - #==========================================================================
 
  
- resume_critical_thread
 
 - exit
 
  复制代码 |   
 
 
 
 |