加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 流川枫 于 2013-4-17 11:22 编辑
下面的腳本只是針對 腳本 指令,而條件分歧等處的 腳本 也需要改。 於是再也不用猜測到底是哪個事件的哪個位置的哪行腳本出錯了……
$msgbeep = Win32API.new("user32","MessageBeep",["l"],"l") #-------------------------------------------------------------------------- # ● 脚本 #-------------------------------------------------------------------------- def command_355 script = @list[@index].parameters[0] + "\n" loop do if @list[@index+1].code == 655 # 下一个事件指令在脚本2行以上的情况下 script += @list[@index+1].parameters[0] + "\n" else break end @index += 1 end begin eval(script) rescue Exception $!.message.scan(/\(eval\):([-,0-9]+)/) line_id_szk = $1.to_i text_szk = $!.message + "\n@event_id = " + @event_id. to_s + "\n@index = " + @index.to_s + "\n@map_id = " + @map_id. to_s + "\n\nscript:\n" i = 0 script.each_line do |line| next if line.empty? i += 1 text_szk += "☆" if i == line_id_szk text_szk += line end $msgbeep.call(48) sleep(0.1) print text_szk #$msgbox.call(0,text_szk,nil,64) end return true end
$msgbeep = Win32API.new("user32","MessageBeep",["l"],"l")
#--------------------------------------------------------------------------
# ● 脚本
#--------------------------------------------------------------------------
def command_355
script = @list[@index].parameters[0] + "\n"
loop do
if @list[@index+1].code == 655 # 下一个事件指令在脚本2行以上的情况下
script += @list[@index+1].parameters[0] + "\n"
else
break
end
@index += 1
end
begin
eval(script)
rescue Exception
$!.message.scan(/\(eval\):([-,0-9]+)/)
line_id_szk = $1.to_i
text_szk = $!.message + "\n@event_id = " + @event_id.
to_s + "\n@index = " + @index.to_s + "\n@map_id = " + @map_id.
to_s + "\n\nscript:\n"
i = 0
script.each_line do |line|
next if line.empty?
i += 1
text_szk += "☆" if i == line_id_szk
text_szk += line
end
$msgbeep.call(48)
sleep(0.1)
print text_szk
#$msgbox.call(0,text_szk,nil,64)
end
return true
end
|