#自动替换地图指定事件SE文件名 by asperta
asperta = {
"001-System01"=>"002-System02",
"003-System03"=>"004-System04",
"替换前"=>"替换后"}
Dir.mkdir("Data1") unless File.directory?("Data1")
ary = Dir.entries("Data/")
str = ""
for a in ary
if a =~ /Map\d\d\d/
@map = load_data("Data/"+a)
@map.events.each {|key, value|
for i in 0...value.pages.size
for j in 0...value.pages[i].list.size
if value.pages[i].list[j].code == 250
str += "地图:" + a + " 事件:" + key.to_s
str += " SE名字:" + value.pages[i].list[j].parameters[0].name + "\n"
if !asperta.empty?
asperta.each {|k, v|
if k == value.pages[i].list[j].parameters[0].name
value.pages[i].list[j].parameters[0].name = v
end
}
end
end
end
end
}
save_data(@map,"Data1/"+a)
end
end
File.open("se.txt","w").write(str)
exit