查看: 2855|回复: 4

[已经解决] 有跳过缺失素材并且生成TXT目录的脚本吗

[复制链接]
梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
回帖
76
发表于 2017-8-18 18:33:14 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
之前我找到一个,竟然删掉了,话说这个功能超级好用啊,测试游戏必备
有谁能发一个吗,谢谢!

点评

http://rm.66rpg.com/forum.php?mod=viewthread&tid=249998 善用搜索:容错脚本  发表于 2017-8-18 18:58
已经在做游戏了~~~愉悦的做游戏体验
梦石
0
星屑
19426
在线时间
3082 小时
注册时间
2013-1-11
回帖
1207
发表于 2017-8-18 18:57:41 | 显示全部楼层
  1. #==============================================================================
  2. # ■ 容错脚本第3版(070816修订)                                   BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #------------------------------------------------------------------------------
  7. #  07.08.16
  8. #     修正了按下F12重启后的错误
  9. #     附,出错原因:重启后RMXP封装的类没有重置
  10. #==============================================================================

  11. $丢失提示 = true #丢失文件后是否信息框提示

  12. begin
  13.   result = Graphics::Transition.nil?
  14. rescue
  15.   result = true
  16. end

  17. if result
  18.   
  19.   $need_file_bitmap = []
  20.   if FileTest.exist?("log_bitmap.txt")
  21.     f = File.open("./log_bitmap.txt","r")
  22.     $need_file_bitmap = f.read.split(/\n/)
  23.     f.close
  24.   end

  25.   module Graphics
  26.     Transition = method("transition")
  27.     def self.transition(*arg)
  28.       begin
  29.         Transition.call(*arg)
  30.       rescue Errno::ENOENT
  31.         ary=[*arg]
  32.         filename=ary[1]
  33.         unless $need_file_bitmap.include?(filename)
  34.           $need_file_bitmap.push(filename)
  35.           f = File.open("./log_bitmap.txt","a")
  36.           f.write(filename + "\n")
  37.           f.close
  38.           msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
  39.         end
  40.         Transition.call(ary[0])
  41.       end
  42.     end
  43.   end

  44.   class Bitmap < Object
  45.     alias ini_Fx initialize
  46.      
  47.     def initialize(*args)
  48.       begin
  49.         ini_Fx(*args)
  50.         return
  51.       rescue Errno::ENOENT
  52.         filename=[*args][0]
  53.         unless $need_file_bitmap.include?(filename)
  54.           $need_file_bitmap.push(filename)
  55.           f = File.open("./log_bitmap.txt","a")
  56.           f.write(filename + "\n")
  57.           f.close
  58.           msgbox "弱弱的提示一下,您有图像文件(#{filename})丢失了..." if $丢失提示
  59.         end
  60.         ini_Fx(32,32)
  61.       end
  62.     end
  63.   end

  64.   $need_file_audio = []
  65.   if FileTest.exist?("log_audio.txt")
  66.     f = File.open("./log_audio.txt","r")
  67.     $need_file_audio = f.read.split(/\n/)
  68.     f.close
  69.   end
  70.   
  71.   module Audio
  72.     Me_play = method("me_play")
  73.     def self.me_play(*arg)
  74.       begin
  75.         Me_play.call(*arg)
  76.       rescue Errno::ENOENT
  77.         filename=[*arg][0]
  78.         unless $need_file_audio.include?(filename)
  79.           $need_file_audio.push(filename)
  80.           f = File.open("./log_audio.txt","a")
  81.           f.write(filename + "\n")
  82.           f.close
  83.           msgbox "弱弱的提示一下,您有ME文件(#{filename})丢失了..." if $丢失提示
  84.         end
  85.         me_stop
  86.       end
  87.     end
  88.     Bgm_play = method("bgm_play")
  89.     def self.bgm_play(*arg)
  90.       begin
  91.         Bgm_play.call(*arg)
  92.       rescue Errno::ENOENT
  93.         filename=[*arg][0]
  94.         unless $need_file_audio.include?(filename)
  95.           $need_file_audio.push(filename)
  96.           f = File.open("./log_audio.txt","a")
  97.           f.write(filename + "\n")
  98.           f.close
  99.           msgbox "弱弱的提示一下,您有BGM文件(#{filename})丢失了..." if $丢失提示
  100.         end
  101.         bgm_stop
  102.       end
  103.     end
  104.     Se_play = method("se_play")
  105.     def self.se_play(*arg)
  106.       begin
  107.         Se_play.call(*arg)
  108.       rescue Errno::ENOENT
  109.         filename=[*arg][0]
  110.         unless $need_file_audio.include?(filename)
  111.           $need_file_audio.push(filename)
  112.           f = File.open("./log_audio.txt","a")
  113.           f.write(filename + "\n")
  114.           f.close
  115.           msgbox "弱弱的提示一下,您有SE文件(#{filename})丢失了..." if $丢失提示
  116.         end
  117.         se_stop
  118.       end
  119.     end
  120.     Bgs_play = method("bgs_play")
  121.     def self.bgs_play(*arg)
  122.       begin
  123.         Bgs_play.call(*arg)
  124.       rescue Errno::ENOENT
  125.         filename=[*arg][0]
  126.         unless $need_file_audio.include?(filename)
  127.           $need_file_audio.push(filename)
  128.           f = File.open("./log_audio.txt","a")
  129.           f.write(filename + "\n")
  130.           f.close
  131.           msgbox "弱弱的提示一下,您有BGS文件(#{filename})丢失了..." if $丢失提示
  132.         end
  133.         bgs_stop
  134.       end
  135.     end
  136.   end
  137. end
复制代码

点评

十分感谢!!  发表于 2017-8-20 22:51
回复 2 0

使用道具 举报

梦石
0
星屑
50
在线时间
68 小时
注册时间
2011-11-12
回帖
76
 楼主| 发表于 2017-8-19 13:22:43 | 显示全部楼层
本帖最后由 Nil2011 于 2017-8-19 13:26 编辑
张咚咚 发表于 2017-8-18 18:57
#==============================================================================
# ■ 容错脚本第3版( ...


十分感谢!!!!
为什么我点击评分,认可答案,打不了数值。。没办法认可啊
已经在做游戏了~~~愉悦的做游戏体验
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部