请滑至最后查看该说明文档的个人翻译版!
Please scroll to the bottom of the page to check out the translated version of README!
以下说明仅适用于本分支。其它说明详见原分支下的说明文档。
The following explanations only apply to the current branch. For other details (installation and prospects), please visit the README in the main branch.
本程序集仅供学习和个人娱乐,不得用于商业用途!
本程序集支持创建自定义房间(包括5v5训练模式)、检查可用电脑玩家和游戏模式以及其它探索性功能的开发。
关于自定义房间创建之外的脚本,请参阅第5点注意事项。
- 本程序集现仅支持创建召唤师峡谷经典模式、嚎哭深渊和训练模式的自定义房间。各模式包含离线版、在线版与一个简化版py文件。
- 离线版采用的电脑玩家数据为主目录下的
available-bots.xlsx文件。因此请勿移动任何离线版文件和该xlsx文件。- 该工作簿共包含3个工作表:
- Sheet1为训练模式中官方允许添加的电脑玩家信息。
- Sheet2为训练模式中可以添加到房间内的电脑玩家信息。
- 相比Sheet1,Sheet2中包含一般难度的人机对战中的所有电脑玩家信息。需要通过自定义脚本4来更新。
- Sheet3为英雄联盟全英雄信息。
- 该工作簿共包含3个工作表:
- 在线版采用的电脑玩家数据为官方提供的可用电脑玩家。因此在嚎哭深渊、百合与莲花的神庙和聚点危机中,使用在线版程序无法添加电脑玩家。
- 简化版分设于每一个模式中,仅需双击即可自动生成随机电脑玩家,实现大大简化开房过程的目的。
- 离线版采用的电脑玩家数据为主目录下的
- 本程序集还提供所有模式与电脑玩家难度设置的整合版。
- 整合简化版提供以下功能:
- 游戏模式选择
- 电脑玩家自动随机生成
- 整合版提供以下功能:
- 队列房间循环创建
- 自定义房间游戏模式选择
- 游戏类型选择
- 游戏地图选择
- 允许观战策略选择
- 对局名设置
- 队伍规模选择
- 密码(可选)设置
- 电脑玩家难度选择
在该文件中可以选择是否设定电脑玩家难度一致。 - 电脑玩家数量设置
- 模拟客户端行为
- 另外一个py文件允许用户在已经创建好的房间内添加电脑玩家而不覆盖原房间。仅此文件允许访问非官方电脑玩家数据。
- 在极限闪击正式开放之前,整合版不可创建极限闪击房间。请尝试整合简化版或
极限闪击下属程序。
- 整合简化版提供以下功能:
- 本程序集中的
check_available_bots.py和check_available_gameMode.py分别提供检查可用电脑玩家和可用游戏模式的功能。- 请勿在前者运行过程中创建自定义房间,否者可能输出重复的电脑玩家序号和错误的统计结果。
- 请勿在后者运行过程中创建自定义房间,否则可能输出实际不可创建的房间信息。(但可利用这一点查看当前程序的运行进度。)
- 本程序设置了默认的检测上下限。如有需要,请自行修改上下限。
- 本程序集中的
get_lobby_information.py提供反复获取房间信息的功能。 - 本程序集提供了可以通过LCU API创建的房间的信息,位于
可创建房间数据Available Lobby Data中。(该想法源于多人训练模式开启游戏失败的调试工作中。)- 由于软件更新延误,未记录云顶之弈的恭喜发财模式的房间信息。
- 目前已有办法通过非LCU API途径创建官方未开放、但是存在于代码中的怀旧模式,如红月决。(但是我不会😂)
- 本程序集起源于主目录下的
create_custom_lobby.py。
- 本程序集全部为Python程序,需要从Python官网中下载最新版本的Python。(不是最新版本也可,但不要太古早~)
- 初次安装Python,切记勾选
Add Python to PATH选项。 - 如果因为某些原因,系统环境变量PATH中没有Python的工作目录,可以按照如下步骤添加环境变量。
- 在Windows搜索框中输入
path,单击编辑系统环境变量,弹出系统属性窗口。 - 单击
环境变量(N),弹出环境变量窗口。 - 在
用户变量中,找到Path变量。双击,进入编辑环境变量对话框。 - 通过点击
新建(N)按钮,添加3个地址。这些地址是Python的工作目录。如果已存在类似的地址,就没有必要再加了。
C:\Users\[用户名]\AppData\Local\Programs\Python\Launcher\
C:\Users\[用户名]\AppData\Local\Programs\Python\Python[版本号]\
C:\Users\[用户名]\AppData\Local\Programs\Python\Python[版本号]\Scripts
如我的用户名是19250,使用的Python版本是3.11.4,则PATH中包含:
C:\Users\19250\AppData\Local\Programs\Python\Launcher\
C:\Users\19250\AppData\Local\Programs\Python\Python311\
C:\Users\19250\AppData\Local\Programs\Python\Python311\Scripts\ - 保险起见,可以在
系统变量的Path中也添加这三个地址。 - 重启已经打开的命令提示符或终端,即可正常使用Python工具。如pip。
- 在Windows搜索框中输入
- 安装完成并配置好环境变量后,需要使用
pip install [库名]命令安装本程序集所需的一些Python库。在科学上网的网络环境下,下载Python库应当会比国内环境快很多。本程序集所需的Python库有:- lcu_driver
- openpyxl
- pandas
- requests
- 初次安装Python,切记勾选
- 为提高响应速度,请在命令行环境中,而不是Python IDLE中使用本程序集。
- 为方便查看程序的返回信息,避免命令行一闪而过,建议先打开命令提示符(或终端),使用cd命令切换到程序集所在目录,再输入命令
python [文件名]以使用某个程序。
- 为方便查看程序的返回信息,避免命令行一闪而过,建议先打开命令提示符(或终端),使用cd命令切换到程序集所在目录,再输入命令
- 所有程序必须在登录英雄联盟客户端后运行。
- 本程序集所有打开的py文件均可通过Ctrl + C提前结束进程。一次不行来十次!
- 对库文件进行的修改。注意,如果修改后无法解决问题,请第一时间撤销对库文件进行的修改!
- 12.23版本以后,对lcu_driver库中的utils.py文件,将
key, value = cmdline_arg[2:].split('=')修改为lst = cmdline_arg[2:].split('=')、key = lst[0]和value = lst[1]共3个语句。
- 12.23版本以后,对lcu_driver库中的utils.py文件,将
- 本程序集提供了一些自定义房间创建之外的功能,仅供娱乐。欢迎各位志同道合的小伙伴补充完善!
- 声明:请按照顺序为后来添加的脚本命名,格式为
Customized Program [数字] - [功能].py。 - 自定义脚本1返回通过lcu_driver库获取到的连接信息。
- 自定义脚本2参考了Mario开发的图形化界面的LeagueLobby中根据Json创建房间按钮的功能。使用时,需要先在文本编辑器中修改该文件中create_custom_lobby函数中的各参数的值,保存后再双击该文件以尝试创建房间。
(图片待完善)
- 若要查看创建房间后的返回信息,请选择先打开命令提示符或终端再输入
python [文件名]。
- 若要查看创建房间后的返回信息,请选择先打开命令提示符或终端再输入
- 自定义脚本3为探索LCU API提供了一个基础工具,将格式化的返回结果输出到同目录下的
temporary data.txt中。该程序中列出了一些参考的网络请求命令。所有可用API来自LCU Explorer。- 该程序无法发送稍微复杂一些的网络请求。如需要附带json数据的网络请求。
- 要在网页端而不是软件端查看所有LCU API,请访问Swagger。(如在浏览器中使用Ctrl + F以搜索API。)
- 自定义脚本4用于更新主目录下的
available-bots.xlsx文件。使用时,请先将结果复制粘贴到记事本中,再进行合适的整理,将其汇入已有的Excel文件中。- 一般情况下不需要用户自行更新英雄数据。我会保持更新。每次更新的依据是新英雄的发布。
- 该程序允许在客户端未运行时使用。此时只能获取全英雄信息,但可以设置输出语言。
- 自定义脚本5(☆)用于查询和导出召唤师战绩。
- 由于使用的是LCU API,在国服环境下,即使召唤师生涯不可见,仍然能够查询到该召唤师的全部对局记录和段位信息。
- 在选择导出全部数据的情况下,生成的Excel文件中包含五大部分:
- 人物简介(单工作簿)
- 排位信息(单工作簿)
- 英雄成就(单工作簿)
- 对局记录(单工作簿)
- 各对局详细信息(双工作簿——对局统计信息和时间轴)
- 在运行扫描模式(【本地重查】)之前,请先运行【一键查询】,以避免遗漏最新的对局。(要查看一些名词的含义,请看相应的提交记录描述。)
- 不建议使用该程序导出超过2500场正常对局(或5000场斗魂竞技场对局)的信息。
- 在运行扫描模式之前,先删除工作簿(到回收站),这样防止原有文件较大而导致程序读取文件和导出工作表的时间过长。
- 该程序需要依据实际遇到的报错来更新异常修复部分的代码。欢迎各位开发者分享爬取过程中遇到的报错问题👏
- 未来计划完善符文信息。符文信息的添加较为复杂,需要为目前的所有符文赋予独特的字符串,来正确地表示其参数的含义。
- 自定义脚本6用于在美测服一键开启云顶之弈1V0模式,以获取3000点券。双击即可。
- 对于非北美洲用户,即使使用了加速器,也要在游戏大厅的PLAY按钮高亮3秒之后,再双击本程序。否则会导致召唤师状态异常(实际为在线状态,却显示为正在排队,并有“正在匹配”的计时器)。这时只能通过重启客户端来解决。
- 自定义脚本7用于获取商店中上架的商品信息。
- 该程序将商品信息输出到
Store items.txt中,需要通过json转换工具将字符串转化为易于查看的形式。
- 该程序将商品信息输出到
- 自定义脚本8从来没有被寄予统计一个服务器上所有召唤师的数量的厚望。(因为人实在是太多了,并且遍历是最盲目的!)
- 自定义脚本9用于查询和导出当前服务器存在的游戏模式。
- 尝试在多个服务器上运行此程序,并比较开放的游戏模式。兴许你会发现自己可以在国测服玩到卡莎打一般难度的1v1人机的云顶之弈1v0狂暴模式。
- 自定义脚本10用于搜索指定召唤师进行过的对局。可以与自定义脚本5联动。
- 自定义脚本11用于查询与指定召唤师最近玩过的召唤师。
- 该脚本的大部分代码继承自自定义脚本5,包括扫描模式。但是该脚本只涉及结果的输出,不会修改自定义脚本5生成的任何中间文件(文本文档)。
- 该脚本设置了【生成模式】和【检测模式】。
- 该脚本不支持在一次生命周期中切换模式。
- 【生成模式】用于将某召唤师最近若干场对局中遇到的玩家保存到本地文件。将保存到前缀为“Summoner Profile”的工作簿的“Recently Player Summoners”工作表中,并导出8张关于玩家的游戏时长和对局数的柱状图。
- 【检测模式】用于在英雄选择阶段查询队友是否在以前的对局中遇到过。
- 如有,返回该召唤师在历史对局中的信息。格式参考了自定义脚本5生成的对局历史的每一条记录。
- 该模式仅支持查询用户在英雄选择阶段遇到的队友。不能查询其它召唤师在英雄选择阶段遇到的队友。
- 由于英雄选择阶段具有临时性,因此在该模式下,程序只会在主目录生成一个临时文件。
- 如果用户在英雄选择阶段因为某些原因(如命令行一闪而过、历史记录无法正常获取)未能通过【检测模式】获取队友是否曾遇到过的信息,那么只能在对局结束后通过【生成模式】手动查询。
清除临时文件.bat用于清除自定义脚本产生的临时文件。目前可以清除自定义脚本3、4、7和10产生的临时文件。- 为方便理解自定义脚本中一些大型数据框的结构,在主目录中添加了一个工作簿
Customized Program Main Dataframe Structure.xlsx,以解释其生成过程。- 下面对自定义脚本11中的
recent_players_df的结构进行说明,以便说明一些设定。一些设定在后续解释中不再赘述。- 工作表
11 - recent_players_header共有5列,其中前3列是主要数据区域。Index代表recent_players_data的键的索引。Key代表recent_players_data的键。Value代表recent_players_data的值。DirectlyImport?代表从LCU API中获取数据导入工作表中时是否需要对数据进行加工。打勾表示直接引用。OutputOrder代表输出为工作表时各数据的排列顺序。
- 在该工作表中,主要数据区域设置了5种颜色。
- 绿色代表
Key可以直接作为game_info的索引。 - 黄色代表
Key作为game_info["participantIdentities"][participantId]的索引。 - 蓝色代表
Key作为game_info["participants"][participantId]的索引。 - 橙色代表
Key作为game_info["participants"][participantId]["stats"]的索引。 - 粉红色代表
Key不作为LCU API中任何变量的索引。- 目前粉红色区域只包含
ally?,表示查询的玩家是否是主玩家的队友。在导出的工作表中,打勾表示该玩家是主玩家的队友。
- 目前粉红色区域只包含
- 绿色代表
- 一些键被标记为白色。这样的键不作为LCU API中任何变量的索引,但仍来自其填充色所代表的变量的索引。如
ornament不曾出现在对局信息的json对象中,但是实际上来自game_info["participants"][participantId]["stats"],对应的是索引"item6"。
- 工作表
- 下面对查战绩脚本中的
mastery_df的结构进行说明。- 工作表
05 - mastery_header的主要数据区域设置了一种颜色。- 白字只包含
champion和alias,分别表示英雄的称号和名字。LCU API只提供了英雄序号。 - 蓝色代表
Key可以直接作为mastery[champion_iter]的索引。
- 白字只包含
- 工作表
- 下面对查战绩脚本中的
ranked_df的结构进行说明。- 工作表
05 - ranked_header的Key都可作为ranked["queues"][Id]的索引。 - 注意到
OutputOrder列存在重复数据。造成这个现象的根本原因是云顶之弈狂暴模式的段位和其它排位模式的段位被记录在两个变量中,但是输出表格时期望输出在一列中,所以有一些原键的输出顺序相同。
- 工作表
- 下面对查战绩脚本中的
game_info_df的结构进行说明。- 工作表
05 - game_info_header的主要数据区域设置了5种颜色。- 浅蓝色代表
Key可以作为game_info["participantIdentities"][participantId]的索引。 - 深蓝色代表
Key可以作为game_info["participantIdentities"][participantId]["player"]的索引。 - 绿色代表
Key可以作为game_info["participants"][participantId]的索引。 - 橙色代表
Key可以作为game_info["participants"][participantId]["stats"]的索引。 - 紫色代表
Key可以作为game_info["teams"][teamId]的索引。
- 浅蓝色代表
- 工作表
- 下面对查战绩脚本中的
game_timeline_df的结构进行说明。- 工作表
05 - game_timeline_header的主要数据区域设置了4种颜色。- 蓝色代表
Key可以作为frames[frameId]的索引。 - 灰色代表
Key对应的值是自动生成的,不依赖于LCU API。 - 绿色代表
Key来自game_info的一些信息。 - 橙色代表
Key来自frames[frameId]["participantFrames"][participantId]的索引。
- 蓝色代表
- 工作表
- 下面对查模式脚本中的
queues_df的结构进行说明。- 工作表
09 - queues_header的主要数据区域设置了4种颜色。- 绿色代表
Key可以直接作为queues[id]的索引。 - 橙色代表
Key可以作为queues[id]["gameTypeConfig"]的索引。 - 蓝色代表
Key可以作为queues[id]["queueRewards"]的索引。 - 白色代表
Key曾经存在,但后来被删除了。
- 绿色代表
- 工作表
- 下面对自定义脚本11中的
- 声明:请按照顺序为后来添加的脚本命名,格式为
- 一般情况下,本程序集生成的包含json数据的文本文档都是带缩进的。如果需要根据这些文件复现python运行环境中的字典变量,只需要向json库中的load函数传入一个由open函数创建的文件指针即可。如
fp = open("{文件名}.txt", "r", encoding = "utf-8")和d = json.load(fp)。- 若要在运行环境中将dumps函数生成的带缩进的json字符串转换成不带缩进的json字符串,只需要将dumps函数生成的字符串传入loads函数即可。如
formatted = json.dumps({字典变量}, indent = 8, ensure_ascii = False)和d = json.loads(formatted)。
- 若要在运行环境中将dumps函数生成的带缩进的json字符串转换成不带缩进的json字符串,只需要将dumps函数生成的字符串传入loads函数即可。如
作为初学者,我只学习到了Python的一些基本语法,还是在基于结构化程序设计的思想来实现每一个功能,而没有用到类和对象的概念,导致代码的整合程度不高,存在大量冗余的代码。例如查询召唤师战绩的脚本中,存在大量复制的现象。对于长字符串,我的处理方法是一行写到底,是基于缩减代码行数的考虑,可能不利于代码的浏览,还请见谅!另外,本程序集的注释尚不充足,还需要进一步完善。由于尚未学习图形化界面相关的知识(唯一学过的就是VB了😂),我只能设计这种通过命令行来实现功能的程序。(y1s1,现在并没有设计图形化界面的打算。)
整个程序集中的程序,除了参考知乎博主XHXIAIEIN的学习心得和拳头官方公布的接口,其实没有什么创新点,主要就是一个数据的调用、爬取和整理。如果大家有什么好玩的想法,也欢迎复刻本存储库,并创建属于你自己的分支和提交拉取请求!
(The following content is the English version of README.)
This program set only supports study use or personal entertainment. Any commercial use is forbidden!
This program set allows creating custom lobbies (including 5V5 Practice Tool), checking available bot players and game modes and development of other exploratory functions.
For details about customized programs that is beyond the scope of creating a custom lobby, please check the fifth instruction.
- This program set only supports creating custom lobbies of Summoner's Rift Classic, Howling Abyss and Practice Tool. Each mode includes offline-data version, online-data version and simplied version.
- The offline-data version takes
available-bots.xlsxin the home directory as the bot player data. For its sake, don't move any files for offline-data version (including this file).- This workbook contains 3 sheets:
- Sheet1 contains information of bot players officially available in Practice Tool lobbies.
- Sheet2 contains information of bot players that can be added in Practice Tool lobbies.
- Compared with Sheet1, Sheet2 includes information of all bot players in Co-op vs. Ai matches of intermediate difficulty. Updates come from Customized Program 4.
- Sheet3 contains information of all champions in League of Legends.
- This workbook contains 3 sheets:
- The online-data version takes officially available bots as the bot player information. Therefore, online-data version can't be used to add bot players in Howling Abyss, Temple of Lily and Lotus and Convergence lobbies.
- The simplified version exists in each mode. A simple double-click should be able to generate bot players randomly, hence simplifying lobby creation greatly.
- The offline-data version takes
- This program set also provides the consolidated version for all game modes and all levels of bot difficulity.
- The simplified consolidated version has the following features:
- Game mode selection
- Random generation of bot players
- The consolidated version has the following features:
- Queue lobby over-creation
- Custom game mode selection
- Game mutator selection
- Game map selection
- Spectator policy selection
- Lobby name configuration
- Team size selection
- Password (optional) configuration
- Bot difficulty selection
By this file, the user may decide whether to set all bots' difficulty the same. - Bot number configuration
- Client behavior simulation
- Another py file allows users to add bot players to already created lobbies, instead of recreating another lobby and clearing all players. Only this file is allowed to visit unofficial bot player information.
- Before Nexus Blitz formally returns, the consolidated version can't be used to create the Nexus Blitz lobbies. Please try the simplified consolidated version or programs that belong to
Nexus Blitzdirectory.
- The simplified consolidated version has the following features:
- In this program set,
check_available_bots.pyandcheck_available_gameMode.pyprovide the functions of checking available bot players and game modes, respectively.- Please don't create any custom lobby while the former program is running, in case wrong botIDs and wrong statistics are output.
- Please don't create any custom lobby while the latter program is running, in case unavailable lobbies may be output. (Neverthelss, this feature may be used to check the running process.)
- In both programs, ranges for check have been set to some values by default. For users' own requirements, please modify the ranges.
- In this program set,
get_lobby_information.pyallows repeatedly getting lobby information. - This program set provides historically available lobbies' information through LCU API, archived in
可创建房间数据Available Lobby Data. (This idea originated from the debugging procedure of failure in starting multiplayer Practice Tool.)- Sorry for the delay of program update, TFT - Fortune's Favor lobby information isn't recorded.
- There're other approaches to creating commemorative unavailable lobbies yet existing in the code, e.g. Hunt of the Blood Moon, without using LCU API. (I haven't learned anything about it, though 😂)
- The program set is adapted from
create_custom_lobby.pyin the home directory.
- The whole program set is made of Python programs. Users are highly suggested to download the latest version of Python from Python official website. (A version that isn't latest is also OK, but please make sure it's not too early, either [xD])
- For this first time of installation of Python, please tick on
Add Python to PATHoption. - If the working directories of Python aren't present in the environment variable Path, the following steps can be adopted to add Python to Path.
- Type in
pathin Windows search bar and click编辑系统环境变量.系统属性window will pop up. - Click
环境变量(N)button and the环境变量window will occur. - In
用户变量, Find the variablePathand double-click it to enter the编辑环境变量dialog box. - Add 3 addresses by clicking the
新建(N)button. These addresses are working directories of Python. If some similar addresses already exist, there's no need to add them.
C:\Users\[Username]\AppData\Local\Programs\Python\Launcher\
C:\Users\[Username]\AppData\Local\Programs\Python\Python[Version]\
C:\Users\[Username]\AppData\Local\Programs\Python\Python[Version]\Scripts
For example, my username is19250, and my Python version is 3.11.4. Then the updated PATH should include
C:\Users\19250\AppData\Local\Programs\Python\Launcher\
C:\Users\19250\AppData\Local\Programs\Python\Python311\
C:\Users\19250\AppData\Local\Programs\Python\Python311\Scripts\ - Basically, adding the three addresses to
Pathin系统变量is of no harm. - Restart Command Prompt or Terminal. In that case, Python tools, e.g. pip, can be used as normal.
- Type in
- After installation and environment variable configuration of Python, use
pip install [LibraryName]command to install required libraries for this program set. For Chinese mainland users, using proxies to ignore the GFW should accelerate the downloading stage of Python libraries. Required libraries for this program set are:- lcu_driver
- openpyxl
- pandas
- requests
- For this first time of installation of Python, please tick on
- To improve the speed of reponses, please open any program in this program set by Command Prompt or Terminal, instead of Python IDLE.
- To prevent the window from flashing quickly, it's suggested that users first open Command Prompt (or Terminal), switch to the directory of the program set using
cdcommand and then open some program bypython [Filename]. In this way, it's easy check the returned information.
- To prevent the window from flashing quickly, it's suggested that users first open Command Prompt (or Terminal), switch to the directory of the program set using
- All programs must run after the user logs in the LoL client.
- All opened .py files can be aborted by Ctrl + C while running. (Press for any times you want, until the program exits.)
- Modification note on the library. Note: If the modification doesn't solve the problem, please redo the modification at first!
- After Patch 12.23, in utils.py in lcu_driver library, substitute
key, value = cmdline_arg[2:].split('=')with the three statements:lst = cmdline_arg[2:].split('='),key = lst[0]andvalue = lst[1].
- After Patch 12.23, in utils.py in lcu_driver library, substitute
- This program set provides some functions besides creating custom lobbies, just for entertainment. Anyone willing to make supplements and perfection is welcome!
- Declaration: Please name the subsequent customized programs in order, following the format
Customized Program [Number] - [Function].py. - Customized Program 01 returns the connection information by lcu_driver library.
- Customized Program 02 refers to the 根据Json创建房间 button in the GUI LeagueLobby software by Mario. When using, users need first modify the values of parameters in create_custom_lobby function and then double-click the file after saving the change.
(A picture to add)
- To check the returned lobby information after creating a lobby, please first open Command Prompt or Terminal and then type
python [Filename].
- To check the returned lobby information after creating a lobby, please first open Command Prompt or Terminal and then type
- Customized Program 03 provides a basic tool for exploration into LCU API, which saved formatted returned result as
temporary data.txtin the same directory. Some reference requests are listed in this program. All available APIs are from LCU Explorer.- This program isn't designed to send any complex requests. E.g. requests with json data slot.
- To view all LCU APIs in a web instead of in an APP, please visit swagger. (For example, you may use Ctrl + F to search for certain API.)
- Customized Program 04 is designed to update
available-bots.xlsxin the home directory. For use, please copy the result to notepad and then sort it out to adjust to the existing xlsx file.- Usually users aren't needed to update the champion data. I'll keep updating it if any new champion is released.
- This program can be run without logging into LoL client, but it only returns information of all champions. Nevertheless, users may choose the output language.
- Customized Program 05 (☆) is designed to search and export summoners' profile.
- Thanks to LCU API, even if a summoner sets its profile private, its whole match history and rank data can still be found.
- If all data are exported, the generated xlsx file contains 5 parts of sheets:
- Profile (Single sheet)
- Rank (Single sheet)
- Champion Mastery (Single sheet)
- Match history (Single sheet)
- Details for each match (Double sheets for each match - game information and timeline)
- Before running the scan mode ([Local Recheck]), please run [One-Key Query] first, in case latest matches are neglected. (For the definition of some terms, check the description of corresponding commit.)
- The user isn't advised to export the information and timelines of more than 2500 normal matches (or the information of 5000 Arena matches) using this program.
- Right before running the scan mode, please delete the xlsx workbook (into Recycle Bin), in case the original workbook is too big for this program to quickly read and export sheets into.
- This program relies on any encountered errors to update the exception handling code. Welcome for any developer to share the http errors when crawling the data 👏
- Future Plan: Supplement the perk (runes) information. It's relatively complex, for each rune should be given a specific string to express its exact meaning.
- Customized Program 06 is designed to one-key start the TFT 1v0 mode on PBE to gain 3000 RP. A simple double-click will work.
- For users not in North America (in terms of location), despite any accerelator used, please don't double-click this program until several seconds after the PLAY button highlights. Otherwise, the summoner status will come into an unexpected state (the client will show that the summoner is in queue and display the "Finding Match" timer, but actually it's online). A restart for client is the only way to solve this problem.
- Customized Program 07 is designed to get information of items on sale in the store.
- This program exports information to
Store items.txt, which a Json formatter can transform into a more understandable form.
- This program exports information to
- Customized Program 08 is never expected to count the number of summoners on a server. (since the number is too large, let alone the brute-force traversal of summonerId)!
- Customized Program 09 is designed to search and export the existing game modes on the current server.
- Try running this program on multiple servers, and compare the available game modes on different servers. If lucky, you may find that on Chinese PBE server, you'll use Kai'Sa to solo with a bot player of intermediate difficulty in TFT Turbo 1v0.
- Customized Program 10 is designed to search for matches a specified summoner has played. The user may combine its use with Customized Program 5.
- Customized Program 11 is designed to search summoners that have recently played with the specific summoner.
- A large part of code in this program is inherited from Customized Program 5, including the scan mode. Nevertheless, this program only outputs the result and doesn't change any intermediate files (txt files) generated by Customized Program 5.
- This program allows [Generate Mode] and [Detect Mode].
- Mode switch isn't supported during a life cycle of this program.
- [Generate Mode] saves information of players that a specific player have played with in recent matches into the Sheet "Recently Played Summoners" in the workbook whose name is prefixxed with "Summoner Profile" and save 9 bar charts with regard to players' game time and match counts.
- [Detect Mode] checks whether allies during champ select have been encountered before.
- If any of them does, information of this summoner in past matches will be returned. The format of output refers to that of each record in the match history table generated by Customized Program 5.
- This mode only supports checking allies of the user (current summoner). The user may not use it to check allies of other summoners in champ select.
- Considering temporariness of champ select, this mode will only generate a temporary file in the home directory.
- If for some reason (like the CMD window pops up and disappears immediately, or the match history fails to be fetched), the user fails to get whether the allies have been encountered before using [Detect Mode], then the user must check again by [Generate Mode] after the match is over.
清除临时文件.batis used to remove temporary files generated by customized programs. At present it can delete temporary files from customized programs 3, 4, 7 and 10.- To let user understand the structure of the large dataframes, a workbook
Customized Program Main Dataframe Structure.xlsxis added in the home directory to illustrate how the dataframes are organized.- The following is the illustration on the structure of
recent_players_dfin Customized Program 11, to explain some settings, which will not be repeated in the later explanation:- There're 5 columns in the sheet
05 - mastery_header, and the first 3 columns are the main data area.Indexrepresents the index of the keys of the dictionary variablerecent_players_data.Keyrepresents the keys of the dictionary variablerecent_players_data.Valuerepresents the values of the dictionary variablerecent_players_data.DirectlyImport?represents whether to analyze the data being imported from LCU API into the worksheet. A tick means reference without any change.OutputOrderrepresents the order to arrange the data when they're output into a worksheet.
- 5 colors are used to divide the main data area in this sheet.
- Data in the green area means
Keyis the direct index of the variablegame_info. - Data in the orange area means
Keyis the index ofgame_info["participantIdentities"][participantId]. - Data in the blue area means
Keyis the index ofgame_info["participants"][participantId]. - Data in the yellow area means
Keyis the index ofgame_info["participants"][participantId]["stats"]. - Data in the purple area means
Keydoesn't serve as the index of any variables of LCU API.- Currently, the purple area only contains
ally?, a judgement whether the queried player is an ally of the main player. In the exported sheet, a tick means the queried player is the ally of the main player.
- Currently, the purple area only contains
- Data in the green area means
- Some keys are colored white. These keys don't belong to the indices of any variable in LCU API, but actually come from them. For example,
ornamentnever occurs in the json object of the game information, but actually originates fromgame_info["participants"][participantId]["stats]and corresponds to the key"item6".
- There're 5 columns in the sheet
mastery_dfin Customized Program 5:- 1 color is used to divide the main data area in the sheet
05 - mastery_header.- Data in the blue area means
Keyis the direct index of the variablemastery[champion_iter]. - Keys in white only include
championandalias, representing the titles and aliases of champions, respectively. Only championIds are provided in LCU API.
- Data in the blue area means
- 1 color is used to divide the main data area in the sheet
ranked_dfin Customized Program 5:Keyin the sheet05 - ranked_headercan all be the index ofranked["queues"][id].- Note that redundancy exists in the
OutputOrdercolumn. The essential reason for this is that the tier of TFT turbo and that of other rank modes are recorded into 2 variables separately, while the two tiers are expected to be stored in a single column. Therefore, theOutputOrderof some keys are the same.
game_info_dfin Customized Program 5:- 5 colors are used to divide the main data area in the sheet
05 - game_info_header.- Data in the light blue area means
Keyis the index ofgame_info["participantIdentities"][participantId]. - Data in the dark blue area means
Keyis the index ofgame_info["participantIdentities"][participantId]["player"]. - Data in the green area means
Keyis the index ofgame_info["participants"][participantId]. - Data in the orange area means
Keyis the index ofgame_info["participants"][participantId]["stats"]. - Data in the purple area means
Keyis the index ofgame_info["teams"][teamId].
- Data in the light blue area means
- 5 colors are used to divide the main data area in the sheet
game_timeline_dfon Customized Program 5:- 4 colors are used to divide the main data area in the sheet
05 - game_timeline_header.- Data in the blue area means
Keyis the index offrames[frameId]. - Data in the grey area means the value corresponding to
Keyis generated automatically and isn't related to LCU API. - Data in the green area means
Keycomes fromgame_info. - Data in the orange area means
Keyis the index offrames[frameId]["participantFrames"][participantId].
- Data in the blue area means
- 4 colors are used to divide the main data area in the sheet
queues_dfon Customized Program 9:- 4 colors are used to divide the main data area in the sheet
09 - queues_header.- Data in the blue area means
Keyis the directly index of the variablequeues[id]. - Data in the orange area means
Keyis the directly index of the variablequeues[id]["gameTypeConfig"]. - Data in the blue area means
Keyis the directly index of the variablequeues[id]["queueRewards"]. - Data in the white area means
Keyonce existed but was deleted later.
- Data in the blue area means
- 4 colors are used to divide the main data area in the sheet
- The following is the illustration on the structure of
- Declaration: Please name the subsequent customized programs in order, following the format
- Normally, text files generated by this program set are organized with indents. If the original dictionary variable in python runtime environment is required to recur, then simply pass a file pointer created by
openfunction to theloadfunction injsonlibrary, such asfp = open("{filename}.txt", "r", encoding = "utf-8")andd = json.load(fp).- If the user wants to transform a json string with indents generated by
dumpsfunction into a json string without indents just in the runtime environment, he/she only needs to pass the string generated bydumpsfunctin intoloadsfunction, such asformatted = json.dumps({dictvariable}, indent = 8, ensure_ascii = False)andd = json.loads(formatted).
- If the user wants to transform a json string with indents generated by
As a beginner in programming, I've just learned some basic usage of Python, and each function is implemented based on structured programming, without using the concepts of classes and objects, which may explain the code redundancy and low level of integration. For example, in Customized Program 5, a number of lines of codes are actually copied from some other part of the code. Moreover, for long strings, I choose to write them in single lines, considering decreasing the number of code lines, which is not friendly for a glance, and I apologize for this. In addition, I realized that more annotations are needed for the codes. Last but not least, since I haven't learned anything about GUI (the only one I've ever used is Visual Basic 😂), I'm only capable of designing programs that interact with CMD. (Actually and sadly, I haven't planned to design the graphics interface for now and in the near future.)
To be honest, there're not any really innovative ideas besides ZhiHu Author XHXIAIEIN's perception and Riot's official API. The program set mainly calls API, crawls and sorts out data. If any interesting idea pops up in your mind, welcome to fork this repository, create your own branch and submit pull requests!