仙剑之十里坡
标题:
容错脚本 第3版
[打印本页]
作者:
月下独孤
时间:
2011-6-11 19:24
标题:
容错脚本 第3版
#==============================================================================
# ■ 容错脚本第3版(070816修订) BY 轮回者
#------------------------------------------------------------------------------
# 本脚本基于星大叔的容错脚本第2版,区别只是“下手”的地方不同而已。
# 说明请参看星大叔的容错脚本第2版。
#------------------------------------------------------------------------------
# 07.08.16
# 修正了按下F12重启后的错误
# 附,出错原因:重启后RMXP封装的类没有重置
#==============================================================================
begin
result = Graphics::Transition.nil?
rescue
result = true
end
if result
$need_file_bitmap = []
if FileTest.exist?("log_bitmap.txt")
f = File.open("./log_bitmap.txt","r")
$need_file_bitmap = f.read.split(/\n/)
f.close
end
module Graphics
Transition = method("transition")
def self.transition(*arg)
begin
Transition.call(*arg)
rescue Errno::ENOENT
ary=[*arg]
filename=ary[1]
unless $need_file_bitmap.include?(filename)
$need_file_bitmap.push(filename)
f = File.open("./log_bitmap.txt","a")
f.write(filename + "\n")
f.close
end
Transition.call(ary[0])
end
end
end
class Bitmap < Object
alias ini_Fx initialize
def initialize(*args)
begin
ini_Fx(*args)
return
rescue Errno::ENOENT
filename=[*args][0]
unless $need_file_bitmap.include?(filename)
$need_file_bitmap.push(filename)
f = File.open("./log_bitmap.txt","a")
f.write(filename + "\n")
f.close
end
ini_Fx(32,32)
end
end
end
$need_file_audio = []
if FileTest.exist?("log_audio.txt")
f = File.open("./log_audio.txt","r")
$need_file_audio = f.read.split(/\n/)
f.close
end
module Audio
Me_play = method("me_play")
def self.me_play(*arg)
begin
Me_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
end
me_stop
end
end
Bgm_play = method("bgm_play")
def self.bgm_play(*arg)
begin
Bgm_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
end
bgm_stop
end
end
Se_play = method("se_play")
def self.se_play(*arg)
begin
Se_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
end
se_stop
end
end
Bgs_play = method("bgs_play")
def self.bgs_play(*arg)
begin
Bgs_play.call(*arg)
rescue Errno::ENOENT
filename=[*arg][0]
unless $need_file_audio.include?(filename)
$need_file_audio.push(filename)
f = File.open("./log_audio.txt","a")
f.write(filename + "\n")
f.close
end
bgs_stop
end
end
end
end
复制代码
作者:
冷剑随风
时间:
2011-6-11 23:00
本帖最后由 冷剑随风 于 2011-6-11 23:02 编辑
此附容错脚本的范例工程,如果不懂这个脚本意思的可以下载。
下载请点我
作者:
御剑天河
时间:
2011-6-12 15:14
我不懂...下载
作者:
BlackFeather
时间:
2011-6-13 16:59
我到现在还不知道是容的啥错
作者:
恨思归
时间:
2012-1-20 18:14
容得啥错- -
作者:
天莫邪
时间:
2015-1-31 18:42
不懂,下了再说
欢迎光临 仙剑之十里坡 (http://palslp.com/BBS/)
Powered by Discuz! X2.5