本帖最后由 enghao_lim 于 2021-2-4 23:20 编辑
maps = load_data("Data/MapInfos.rxdata") typ = ["决定键", "角色接触", "事件接触", "自动", "并行"] f = File.open("events.txt", "w") f.write("地图\t事件编号\t事件名称\t启动方式\tX坐标\tY坐标\r\n") maps.each{|m| id = m[0]; name = m[1].name; data = load_data(sprintf("Data/Map%03d.rxdata", id)) events = data.events events.each{|e| f.write(name + "\t" + e[0].to_s + "\t" + e[1].name + "\t" + typ[e[1].pages[0].trigger] + "\t" + e[1].x.to_s + "\t" + e[1].y.to_s + "\r\n") } } f.close() exit
maps = load_data("Data/MapInfos.rxdata")
typ = ["决定键", "角色接触", "事件接触", "自动", "并行"]
f = File.open("events.txt", "w")
f.write("地图\t事件编号\t事件名称\t启动方式\tX坐标\tY坐标\r\n")
maps.each{|m|
id = m[0];
name = m[1].name;
data = load_data(sprintf("Data/Map%03d.rxdata", id))
events = data.events
events.each{|e|
f.write(name + "\t" + e[0].to_s + "\t" + e[1].name + "\t" + typ[e[1].pages[0].trigger] + "\t" + e[1].x.to_s + "\t" + e[1].y.to_s + "\r\n")
}
}
f.close()
exit
|