设为首页收藏本站

仙剑之十里坡

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 7248|回复: 6
打印 上一主题 下一主题

容错脚本 第3版

[复制链接]

194

主题

2

听众

2632

积分

威镇一方

会员等级: 6

  • TA的每日心情
    郁闷
    2013-6-19 14:36
  • 签到天数: 281 天

    [LV.8]以坛为家I

    精华
    0
    积分
    2632
    历练
    1
    声望
    8
    人气
    16

    黑色羽翼 转帖之王

    单身中……
    帮我摆脱单身吧
    跳转到指定楼层
    1
    发表于 2011-6-11 19:24:32 |只看该作者 |倒序浏览

    1. #==============================================================================
    2. # ■ 容错脚本第3版(070816修订)                                   BY 轮回者
    3. #------------------------------------------------------------------------------
    4. #  本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
    5. #  说明请参看星大叔的容错脚本第2版。
    6. #------------------------------------------------------------------------------
    7. #  07.08.16
    8. #     修正了按下F12重启后的错误
    9. #     附,出错原因:重启后RMXP封装的类没有重置
    10. #==============================================================================
    11. begin
    12.   result = Graphics::Transition.nil?
    13. rescue
    14.   result = true
    15. end
    16. if result
    17.   
    18.   $need_file_bitmap = []
    19.   if FileTest.exist?("log_bitmap.txt")
    20.     f = File.open("./log_bitmap.txt","r")
    21.     $need_file_bitmap = f.read.split(/\n/)
    22.     f.close
    23.   end
    24.   module Graphics
    25.     Transition = method("transition")
    26.     def self.transition(*arg)
    27.       begin
    28.         Transition.call(*arg)
    29.       rescue Errno::ENOENT
    30.         ary=[*arg]
    31.         filename=ary[1]
    32.         unless $need_file_bitmap.include?(filename)
    33.           $need_file_bitmap.push(filename)
    34.           f = File.open("./log_bitmap.txt","a")
    35.           f.write(filename + "\n")
    36.           f.close
    37.         end
    38.         Transition.call(ary[0])
    39.       end
    40.     end
    41.   end
    42.   class Bitmap < Object
    43.     alias ini_Fx initialize
    44.      
    45.     def initialize(*args)
    46.       begin
    47.         ini_Fx(*args)
    48.         return
    49.       rescue Errno::ENOENT
    50.         filename=[*args][0]
    51.         unless $need_file_bitmap.include?(filename)
    52.           $need_file_bitmap.push(filename)
    53.           f = File.open("./log_bitmap.txt","a")
    54.           f.write(filename + "\n")
    55.           f.close
    56.         end
    57.         ini_Fx(32,32)
    58.       end
    59.     end
    60.   end
    61.   $need_file_audio = []
    62.   if FileTest.exist?("log_audio.txt")
    63.     f = File.open("./log_audio.txt","r")
    64.     $need_file_audio = f.read.split(/\n/)
    65.     f.close
    66.   end
    67.   
    68.   module Audio
    69.     Me_play = method("me_play")
    70.     def self.me_play(*arg)
    71.       begin
    72.         Me_play.call(*arg)
    73.       rescue Errno::ENOENT
    74.         filename=[*arg][0]
    75.         unless $need_file_audio.include?(filename)
    76.           $need_file_audio.push(filename)
    77.           f = File.open("./log_audio.txt","a")
    78.           f.write(filename + "\n")
    79.           f.close
    80.         end
    81.         me_stop
    82.       end
    83.     end
    84.     Bgm_play = method("bgm_play")
    85.     def self.bgm_play(*arg)
    86.       begin
    87.         Bgm_play.call(*arg)
    88.       rescue Errno::ENOENT
    89.         filename=[*arg][0]
    90.         unless $need_file_audio.include?(filename)
    91.           $need_file_audio.push(filename)
    92.           f = File.open("./log_audio.txt","a")
    93.           f.write(filename + "\n")
    94.           f.close
    95.         end
    96.         bgm_stop
    97.       end
    98.     end
    99.     Se_play = method("se_play")
    100.     def self.se_play(*arg)
    101.       begin
    102.         Se_play.call(*arg)
    103.       rescue Errno::ENOENT
    104.         filename=[*arg][0]
    105.         unless $need_file_audio.include?(filename)
    106.           $need_file_audio.push(filename)
    107.           f = File.open("./log_audio.txt","a")
    108.           f.write(filename + "\n")
    109.           f.close
    110.         end
    111.         se_stop
    112.       end
    113.     end
    114.     Bgs_play = method("bgs_play")
    115.     def self.bgs_play(*arg)
    116.       begin
    117.         Bgs_play.call(*arg)
    118.       rescue Errno::ENOENT
    119.         filename=[*arg][0]
    120.         unless $need_file_audio.include?(filename)
    121.           $need_file_audio.push(filename)
    122.           f = File.open("./log_audio.txt","a")
    123.           f.write(filename + "\n")
    124.           f.close
    125.         end
    126.         bgs_stop
    127.       end
    128.     end
    129.   end
    130. end

    复制代码
    分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    转播转播0 分享淘帖0 分享分享0 收藏收藏0

    32

    主题

    2

    听众

    3354

    积分

    威镇一方

    英俊潇洒、风流倜傥的无敌斑竹

    会员等级: 6

  • TA的每日心情
    无聊
    2013-2-27 21:53
  • 签到天数: 321 天

    [LV.8]以坛为家I

    精华
    1
    积分
    3354
    历练
    3
    声望
    45
    人气
    617

    黑色羽翼 神仙眷侣

    寻仙
    幸福:48℃
    2
    发表于 2011-6-11 23:00:52 |只看该作者
    本帖最后由 冷剑随风 于 2011-6-11 23:02 编辑

    此附容错脚本的范例工程,如果不懂这个脚本意思的可以下载。
    下载请点我
    回复

    使用道具 举报

    488

    主题

    2

    听众

    5458

    积分

    名扬四海

    会员等级: 7

  • TA的每日心情
    擦汗
    2024-2-23 10:28
  • 签到天数: 1851 天

    [LV.Master]伴坛终老

    精华
    0
    积分
    5458
    历练
    0
    声望
    246
    人气
    62

    黑色羽翼 神仙眷侣 转帖之王

    最爱菱纱
    幸福:65℃
    3
    发表于 2011-6-12 15:14:00 |只看该作者
    我不懂...下载
    回复

    使用道具 举报

    1008

    主题

    5

    听众

    2万

    积分

    返璞归真

    不器用な星の瞬き

    会员等级: 10

  • TA的每日心情
    擦汗
    7 天前
  • 签到天数: 1362 天

    [LV.10]以坛为家III

    精华
    2
    积分
    23735
    历练
    3
    声望
    133
    人气
    2536

    转帖之王 金融巨子 黑色羽翼

    单身中……
    帮我摆脱单身吧
    4
    发表于 2011-6-13 16:59:45 |只看该作者
    我到现在还不知道是容的啥错
    夜空の星に 捧げた願いの
    欠片積めて 爆誕する奇跡
    回复

    使用道具 举报

    23

    主题

    1

    听众

    579

    积分

    寻仙问道

    会员等级: 4

  • TA的每日心情
    擦汗
    2016-1-15 13:30
  • 签到天数: 280 天

    [LV.8]以坛为家I

    精华
    0
    积分
    579
    历练
    0
    声望
    2
    人气
    397

    黑色羽翼

    单身中……
    帮我摆脱单身吧
    5
    发表于 2012-1-20 18:14:21 |只看该作者
    容得啥错- -
    红颜月 君莫悲
    第一部作品 月如續傳製作中
    回复

    使用道具 举报

    37

    主题

    3

    听众

    220

    积分

    路见不平

    会员等级: 3

  • TA的每日心情
    开心
    2015-6-1 18:23
  • 签到天数: 414 天

    [LV.9]以坛为家II

    精华
    0
    积分
    220
    历练
    0
    声望
    0
    人气
    831
    单身中……
    帮我摆脱单身吧
    6
    发表于 2015-1-31 18:42:46 |只看该作者
    不懂,下了再说
    大梦几千秋,今夕是何年.梦影雾花,尽是虚空,因心想杂乱,方随逐诸尘——不如万般皆散!
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 加入我们

    手机版|Archiver|仙剑之十里坡 ( 苏ICP备11022766号 )  

    GMT+8, 2024-4-24 08:21 , Processed in 0.323161 second(s), 59 queries .

    Powered by Discuz! X2.5

    © 2001-2012 Comsenz Inc.

    回顶部