<p >
<p >王者荣耀 -很火的手游-简直老少通吃-令人发指-虽然 *** 作简单-但为什么你还是会被虐, 其实 是有技巧的--本文Python大神带你研究王者荣耀各类英雄的出装小技巧,让你成为大神般的存在<p >前期准备<p >环境:python3+ windows<p >IDE:随意<p >模块:<p ><pre ># 武器URL地址weapon_url = "http://gamehelper.gm825.com/wzry/equip/List?channel_ID=90009a&app_ID=h9044j&game_ID=7622&game_name=%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80&vcode=12.0.3&version_code=1203&cuID=2654CC14D2D3894DBF5808264AE2DAD7&ovr=6.0.1&device=Xiaomi_MI+5&net_type=1&clIEnt_ID=1Yfyt44QSqu7PcVdDdubYQ%3D%3D&info_ms=fBzJ%2BCu4ZDAtl4CyHuZ%2FJQ%3D%3D&info_ma=XshbgIgi0V1HxXTqixI%2BKbgXtNtop0%2Fn1WZtMWRWj5o%3D&mno=0&info_la=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&info_ci=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&mcc=0&clIEntversion=&bssID=VY%2BeiuZRJ%2FwaXmolLVUrMODX1ZTf%2F2dzsWn2AOEM0I4%3D&oslevel=23&osID=dc451556fc0eeadb&resolution=1080_1920&dpi=480&clIEnt_ip=192.168.0.198&pdunID=a83d20d8"<p >第二个是英雄列表接口<pre ># 英雄列表URL地址heros_url = "http://gamehelper.gm825.com/wzry/hero/List?channel_ID=90009a&app_ID=h9044j&game_ID=7622&game_name=%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80&vcode=12.0.3&version_code=1203&cuID=2654CC14D2D3894DBF5808264AE2DAD7&ovr=6.0.1&device=Xiaomi_MI+5&net_type=1&clIEnt_ID=1Yfyt44QSqu7PcVdDdubYQ%3D%3D&info_ms=fBzJ%2BCu4ZDAtl4CyHuZ%2FJQ%3D%3D&info_ma=XshbgIgi0V1HxXTqixI%2BKbgXtNtop0%2Fn1WZtMWRWj5o%3D&mno=0&info_la=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&info_ci=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&mcc=0&clIEntversion=&bssID=VY%2BeiuZRJ%2FwaXmolLVUrMODX1ZTf%2F2dzsWn2AOEM0I4%3D&oslevel=23&osID=dc451556fc0eeadb&resolution=1080_1920&dpi=480&clIEnt_ip=192.168.0.198&pdunID=a83d20d8"<p >第三个是英雄出装的接口<p >第三个接口有点特殊,需要前面的英雄ID,也就是hero_ID<pre ># 英雄出装URLhero_url = "http://gamehelper.gm825.com/wzry/hero/detail?hero_ID={}&channel_ID=90009a&app_ID=h9044j&game_ID=7622&game_name=%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80&vcode=12.0.3&version_code=1203&cuID=2654CC14D2D3894DBF5808264AE2DAD7&ovr=6.0.1&device=Xiaomi_MI+5&net_type=1&clIEnt_ID=1Yfyt44QSqu7PcVdDdubYQ%3D%3D&info_ms=fBzJ%2BCu4ZDAtl4CyHuZ%2FJQ%3D%3D&info_ma=XshbgIgi0V1HxXTqixI%2BKbgXtNtop0%2Fn1WZtMWRWj5o%3D&mno=0&info_la=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&info_ci=9AChhtmC3uW%2BfY8%2BCFhcFw%3D%3D&mcc=0&clIEntversion=&bssID=VY%2BeiuZRJ%2FwaXmolLVUrMODX1ZTf%2F2dzsWn2AOEM0I4%3D&oslevel=23&osID=dc451556fc0eeadb&resolution=1080_1920&dpi=480&clIEnt_ip=192.168.0.198&pdunID=a83d20d8".format(hero_ID)<p >下面就是愉快的代码之旅了~<p ><p >运行后下载图片:<p ><p >接下来是获取英雄的名字和ID,代码如下:<p ><p >运行效果如图所示:<p ><p >接下来就是出装的最主要部分<p >根据用户输入的英雄ID,查询出英雄的出装,以及总价<p >代码如下:<p ><p >这个时候运行会有一些问题,seek_weapon函数还没有定义,接下来定义seek_weapon,代码如下:<pre ># 根据equip_ID查询武器名字和价格# weapon_info - 存储所有武器的字典def seekweapon(equipID,weapon_info):for each_weapon in weapon_info: if eachweapon['equipID'] == str(equip_ID):weapon_name = each_weapon['name']weapon_price = eachweapon['price'] return weaponname,weapon_price<p >seek_weapon函数在调用的时候,需要weapon_info,也就是所有武器的字典,这个时候就需要在定义一个函数来获取武器的字典<p ><p >最终的运行效果下图:<p ><p >源代码获取地址<p >欢迎关注我的博客或者公众号:https://home.cnblogs.com/u/Python1234/ Python学习交流<p ><span > 总结以上是内存溢出为你收集整理的用Python开发一款王者荣耀的“脚本”!上王者轻轻松!全部内容,希望文章能够帮你解决用Python开发一款王者荣耀的“脚本”!上王者轻轻松!所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)