| 赞 | 58 |
| VIP | |
| 好人卡 | |
| 积分 | 12 |
| 经验 | |
| 最后登录 | 2023-5-29 |
| 在线时间 | 1017 小时 |
- 梦石
- 0
- 星屑
- 1232
- 在线时间
- 1017 小时
- 注册时间
- 2011-4-30
- 回帖
- 1464
|
发表于 2015-10-21 19:45:59
|
显示全部楼层
本帖最后由 汪汪 于 2015-10-21 22:39 编辑
添加 公共事件搜索
返回文件版
[pre lang="ruby"]
cz = 1 #搜索的开关号
f = File.open("搜索开关.txt","w")
common_events = load_data("Data/CommonEvents.rxdata")
c_event_shu = -1
for c_event in common_events
c_event_shu += 1
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
end
end
for map_id in 1..999
# 地图 ID 记录到 map_id
map = load_data(sprintf("Data/Map%03d.rxdata", map_id)) rescue next
# 设置地图事件数据
for i in map.events.keys
Graphics.update
event = map.events
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
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
end
pageshu -= 1
end
end
end
f.close
[/pre]
额,总之会很慢的拉.......
简化版....大概应该会快一点.....
[pre lang="ruby"]
cz = 1 #搜索的开关号
f = File.open("搜索开关.txt","w")
common_events = load_data("Data/CommonEvents.rxdata")
c_event_shu = -1
for c_event in common_events
c_event_shu += 1
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 )
next
end
end
for list in c_event.list
if list.code == 111
if list.parameters[0] == 0
if list.parameters[1] == cz
f.write("\n")
f.write("公共事件:"+ c_event_shu.to_s )
break
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 )
break
end
end
end
end
for map_id in 1..999
# 地图 ID 记录到 map_id
map = load_data(sprintf("Data/Map%03d.rxdata", map_id)) rescue next
# 设置地图事件数据
for i in map.events.keys
Graphics.update
event = map.events
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 + ")" )
break
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 + ")" )
break
end
end
nr = false
for list in page.list
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 + ")")
nr = true
break
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 + ")" )
nr = true
break
end
end
end
if nr == true
break
end
end
end
end
f.close
[/pre]
额,无用的最终版,搜索公共事件,队伍,事件,移动路线,内的开关操作.......[pre lang="ruby"]
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
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
[/pre]
|
评分
-
查看全部评分
|