设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1545|回复: 1
打印 上一主题 下一主题

[已经解决] 容错脚本怎么取消创建log_bitmap文本文档提醒?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
110 小时
注册时间
2009-7-21
帖子
73
跳转到指定楼层
1
发表于 2011-5-21 11:41:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. #==============================================================================
  2. # ■ 容错脚本第3版                                              BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #==============================================================================

  7. $need_file_bitmap = [ ]
  8. if FileTest.exist?("log_bitmap.txt")
  9. f = File.open("./log_bitmap.txt","r")
  10. $need_file_bitmap = f.read.split(/\n/)
  11. f.close
  12. end

  13. module Graphics
  14. @transition = method("transition")
  15. def self.transition(*arg)
  16.    begin
  17.      @transition.call(*arg)
  18.    rescue Errno::ENOENT
  19.      ary=[*arg]
  20.      filename=ary[1]
  21.      unless $need_file_bitmap.include?(filename)
  22.        $need_file_bitmap.push(filename)
  23.        f = File.open("./log_bitmap.txt","a")
  24.        f.write(filename + "\n")
  25.        f.close
  26.      end
  27.      @transition.call(ary[0])
  28.    end
  29. end
  30. end

  31. class Bitmap < Object
  32. alias ini initialize
  33. def initialize(*arg)
  34.    begin
  35.      ini(*arg)
  36.    rescue Errno::ENOENT
  37.      filename=[*arg][0]
  38.      unless $need_file_bitmap.include?(filename)
  39.        $need_file_bitmap.push(filename)
  40.        f = File.open("./log_bitmap.txt","a")
  41.        f.write(filename + "\n")
  42.        f.close
  43.      end
  44.      ini(32,32)
  45.    end
  46. end
  47. end

  48. $need_file_audio = []
  49. if FileTest.exist?("log_audio.txt")
  50. f = File.open("./log_audio.txt","r")
  51. $need_file_audio = f.read.split(/\n/)
  52. f.close
  53. end

  54. module Audio
  55. @me_play = method("me_play")
  56. def self.me_play(*arg)
  57.    begin
  58.      @me_play.call(*arg)
  59.    rescue Errno::ENOENT
  60.      filename=[*arg][0]
  61.      unless $need_file_audio.include?(filename)
  62.        $need_file_audio.push(filename)
  63.        f = File.open("./log_audio.txt","a")
  64.        f.write(filename + "\n")
  65.        f.close
  66.      end
  67.      me_stop
  68.    end
  69. end
  70. @bgm_play = method("bgm_play")
  71. def self.bgm_play(*arg)
  72.    begin
  73.      @bgm_play.call(*arg)
  74.    rescue Errno::ENOENT
  75.      filename=[*arg][0]
  76.      unless $need_file_audio.include?(filename)
  77.        $need_file_audio.push(filename)
  78.        f = File.open("./log_audio.txt","a")
  79.        f.write(filename + "\n")
  80.        f.close
  81.      end
  82.      bgm_stop
  83.    end
  84. end
  85. @se_play = method("se_play")
  86. def self.se_play(*arg)
  87.    begin
  88.      @se_play.call(*arg)
  89.    rescue Errno::ENOENT
  90.      filename=[*arg][0]
  91.      unless $need_file_audio.include?(filename)
  92.        $need_file_audio.push(filename)
  93.        f = File.open("./log_audio.txt","a")
  94.        f.write(filename + "\n")
  95.        f.close
  96.      end
  97.      se_stop
  98.    end
  99. end
  100. @bgs_play = method("bgs_play")
  101. def self.bgs_play(*arg)
  102.    begin
  103.      @bgs_play.call(*arg)
  104.    rescue Errno::ENOENT
  105.      filename=[*arg][0]
  106.      unless $need_file_audio.include?(filename)
  107.        $need_file_audio.push(filename)
  108.        f = File.open("./log_audio.txt","a")
  109.        f.write(filename + "\n")
  110.        f.close
  111.      end
  112.      bgs_stop
  113.    end
  114. end
  115. end
复制代码

Lv1.梦旅人

虱子

梦石
0
星屑
121
在线时间
1782 小时
注册时间
2010-6-19
帖子
3597
2
发表于 2011-5-21 11:56:38 | 只看该作者
  1. #==============================================================================
  2. # ■ 容错脚本第3版                                              BY 轮回者
  3. #------------------------------------------------------------------------------
  4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
  5. #  说明请参看星大叔的容错脚本第2版。
  6. #==============================================================================

  7. $need_file_bitmap = [ ]
  8. end

  9. module Graphics
  10. @transition = method("transition")
  11. def self.transition(*arg)
  12.    begin
  13.      @transition.call(*arg)
  14.    rescue Errno::ENOENT
  15.      ary=[*arg]
  16.      filename=ary[1]
  17.      unless $need_file_bitmap.include?(filename)
  18.        $need_file_bitmap.push(filename)
  19.      end
  20.      @transition.call(ary[0])
  21.    end
  22. end
  23. end

  24. class Bitmap < Object
  25. alias ini initialize
  26. def initialize(*arg)
  27.    begin
  28.      ini(*arg)
  29.    rescue Errno::ENOENT
  30.      filename=[*arg][0]
  31.      unless $need_file_bitmap.include?(filename)
  32.        $need_file_bitmap.push(filename)
  33.      end
  34.      ini(32,32)
  35.    end
  36. end
  37. end

  38. $need_file_audio = []
  39. end

  40. module Audio
  41. @me_play = method("me_play")
  42. def self.me_play(*arg)
  43.    begin
  44.      @me_play.call(*arg)
  45.    rescue Errno::ENOENT
  46.      filename=[*arg][0]
  47.      unless $need_file_audio.include?(filename)
  48.        $need_file_audio.push(filename)
  49.      end
  50.      me_stop
  51.    end
  52. end
  53. @bgm_play = method("bgm_play")
  54. def self.bgm_play(*arg)
  55.    begin
  56.      @bgm_play.call(*arg)
  57.    rescue Errno::ENOENT
  58.      filename=[*arg][0]
  59.      unless $need_file_audio.include?(filename)
  60.        $need_file_audio.push(filename)
  61.      end
  62.      bgm_stop
  63.    end
  64. end
  65. @se_play = method("se_play")
  66. def self.se_play(*arg)
  67.    begin
  68.      @se_play.call(*arg)
  69.    rescue Errno::ENOENT
  70.      filename=[*arg][0]
  71.      unless $need_file_audio.include?(filename)
  72.        $need_file_audio.push(filename)
  73.      end
  74.      se_stop
  75.    end
  76. end
  77. @bgs_play = method("bgs_play")
  78. def self.bgs_play(*arg)
  79.    begin
  80.      @bgs_play.call(*arg)
  81.    rescue Errno::ENOENT
  82.      filename=[*arg][0]
  83.      unless $need_file_audio.include?(filename)
  84.        $need_file_audio.push(filename)
  85.      end
  86.      bgs_stop
  87.    end
  88. end
  89. end
复制代码

http://rpg.blue/thread-175056-1-2.html
PVZ型塔防物一个
http://rpg.blue/thread-155199-1-2.html
RMXP技术讨论区手动认可帖,得到答案请认可
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-22 04:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表