注册会员 登录
Project1 返回首页

汪汪的个人空间 https://rpg.blue/?171386 [收藏] [复制] [分享] [RSS]

日志

【脚本】开关搜索最终版

热度 1已有 62 次阅读2015-10-21 22:44 |个人分类:脚本·修改·整合·胡编


搜索公共事件,队伍,事件,移动路线内的开关操作.......
  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 



1

鸡蛋

鲜花

刚表态过的朋友 (1 人)

发表评论 评论 (4 个评论)

回复 jiushiainilip19 2015-11-13 04:40
好赞的脚本!抢走了!
回复 jiushiainilip19 2015-11-13 04:42
在那里可以设定 第一行改为1到999呢 这样好像要一个一个的查找 很累啊
回复 汪汪 2015-11-13 08:28
jiushiainilip19: 在那里可以设定 第一行改为1到999呢 这样好像要一个一个的查找 很累啊
这个是搜索整个游戏所有有关开关的操作的。包括战斗事件,移动路线,等等。精简的话可以搜索6r,我应该发精简版的……不过因为是逐行搜索……速率肯定是非常差的。
回复 jiushiainilip19 2015-11-13 14:31
嗯 !3Q!

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-11 17:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部