搜索公共事件,队伍,事件,移动路线内的开关操作.......
cz = 1 #搜索的开关号
f = File.open("搜索开关.txt","w")
troops = load_data("Data/Troops.rxdata")
# 搜索全部页的战斗事件
for troop in troops
Graphics.update if troop.id % 50 == 49
next if troop == nil
pageshu = 0
for page in troop.pages
pageshu += 1
# 事件条件可以参考 c
c = page.condition
# 确认开关条件
if c.switch_valid
if c.switch_id == cz
f.write("\n")
f.write("敌人队伍:"+ troop.id.to_s + ",页数:" + pageshu.to_s + ",开关")
end
end
listshu = 0
for list in page.list
listshu += 1
if list.code == 111
if list.parameters[0] == 0
if list.parameters[1] == cz
f.write("\n")
f.write("敌人队伍:"+ troop.id.to_s + ",页数:" + pageshu.to_s + ",第"+listshu.to_s+ "行"+",条件分歧")
end
end
end
if list.code == 121
if list.parameters[0] <= cz and list.parameters[1] >= cz
f.write("\n")
f.write("敌人队伍:"+ troop.id.to_s + ",页数:" + pageshu.to_s + ",第"+listshu.to_s+ "行"+",开关操作")
end
end
if list.code == 209
move_route = list.parameters[1]
comshu = 0
for command in move_route.list
comshu += 1
if command.code == 27 or command.code == 28
if command.parameters[0] == cz
f.write("\n")
f.write("敌人队伍:"+ troop.id.to_s + ",页数:" + pageshu.to_s + ",第"+listshu.to_s+ "行"+",移动路线,第"+comshu.to_s+ "行"+",开关操作")
end
end
end
end
end
end
end
common_events = load_data("Data/CommonEvents.rxdata")
c_event_shu = -1
for c_event in common_events
c_event_shu += 1
Graphics.update if c_event_shu %50 == 49
next if c_event == nil
if c_event.trigger != 0
if c_event.switch_id == cz
f.write("\n")
f.write("公共事件:"+ c_event_shu.to_s + ",开关")
end
end
listshu = 0
for list in c_event.list
listshu += 1
if list.code == 111
if list.parameters[0] == 0
if list.parameters[1] == cz
f.write("\n")
f.write("公共事件:"+ c_event_shu.to_s + ",第"+listshu.to_s+ "行"+",条件分歧")
end
end
end
if list.code == 121
if list.parameters[0] <= cz and list.parameters[1] >= cz
f.write("\n")
f.write("公共事件:"+ c_event_shu.to_s + ",第"+listshu.to_s+ "行"+",开关操作")
end
end
if list.code == 209
move_route = list.parameters[1]
comshu = 0
for command in move_route.list
comshu += 1
if command.code == 27 or command.code == 28
if command.parameters[0] == cz
f.write("\n")
f.write("公共事件:"+ c_event_shu.to_s + ",第"+listshu.to_s+ "行" +",移动路线,第"+comshu.to_s+ "行"+",开关操作")
end
end
end
end
end
end
for map_id in 1..999
Graphics.update if map_id %50 == 49
# 地图 ID 记录到 map_id
map = load_data(sprintf("Data/Map%03d.rxdata", map_id)) rescue next
# 设置地图事件数据
for i in map.events.keys
event = map.events[i]
pageshu = event.pages.size
for page in event.pages.reverse
# 可以参考事件条件 c
c = page.condition
# 确认开关条件 1
if c.switch1_valid
if c.switch1_id == cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + "," + event.y.to_s + ")" + ",页数:" + pageshu.to_s + ",开关1" )
end
end
# 确认开关条件 2
if c.switch2_valid
if c.switch2_id == cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + ","+ event.y.to_s + ")" + ",页数:" + pageshu.to_s + ",开关2")
end
end
if page.move_type == 3
comshu = 0
for command in page.move_route.list
comshu += 1
if command.code == 27 or command.code == 28
if command.parameters[0] == cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + "," + event.y.to_s + ")" + ",页数:"+ pageshu.to_s + ",移动路线,第"+comshu.to_s+ "行"+",开关操作")
end
end
end
end
listshu = 0
for list in page.list
listshu += 1
if list.code == 111
if list.parameters[0] == 0
if list.parameters[1] == cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + "," + event.y.to_s + ")" + ",页数:"+ pageshu.to_s + ",第"+listshu.to_s+ "行"+",条件分歧")
end
end
end
if list.code == 121
if list.parameters[0] <= cz and list.parameters[1] >= cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + "," + event.y.to_s + ")" + ",页数:"+ pageshu.to_s + ",第"+listshu.to_s+ "行"+",开关操作")
end
end
if list.code == 209
move_route = list.parameters[1]
comshu = 0
for command in move_route.list
comshu += 1
if command.code == 27 or command.code == 28
if command.parameters[0] == cz
f.write("\n")
f.write("地图:"+ map_id.to_s + ",事件:" + event.id.to_s + ",位置:(" + event.x.to_s + "," + event.y.to_s + ")" + ",页数:"+ pageshu.to_s + ",第"+listshu.to_s+ "行" + ",移动路线,第"+comshu.to_s+ "行"+",开关操作")
end
end
end
end
end
pageshu -= 1
end
end
end
f.close