2025年11月14日星期五

战马能量星球任务脚本(2025年11月更新)

1.购买服务器阿里云:服务器购买地址https://t.aliyun.com/U/Bg6shY若失效,可用地址

1.购买服务器

阿里云:

服务器购买地址

https://t.aliyun.com/U/Bg6shY

若失效,可用地址

https://www.aliyun.com/daily-act/ecs/activity_selection?source=5176.29345612&userCode=49hts92d

腾讯云:

https://curl.qcloud.com/wJpWmSfU

若失效,可用地址

https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=ad201ee2ef3b771157f72ee5464b1fea&from=console

华为云

https://activity.huaweicloud.com/cps.html?fromacct=64b5cf7cc11b4840bb4ed2ea0b2f4468&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905

2.部署教程

2024年最新青龙面板跑脚本教程(一)持续更新中

3.代码如下

# cron: 15 8 * * *
import requestsimport os,sys,timeimport json,refrom notify import send
def pr(message):    msg.append(message + "\n")    print(message)
msg = []
def index(safe): #登录信息   try    url = f"https://wxx.ball.warhorsechina.com.cn/api/getuserinfo.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         pr(f"登陆成功,用户名:{info['nickname']}")         infos(safe)         print("签到")         time.sleep(3)         checkin(safe)         print("加入排行榜")         time.sleep(3)         joinxcx(safe)         print("点赞")         time.sleep(3)         subrank(safe)         print("分享小程序")         time.sleep(3)         share(safe)         time.sleep(3)         print("摇一摇")         sendbattle(safe)         print("领马")         time.sleep(3)         starthorse(safe)         print("登录游戏")         time.sleep(3)         horselogin(safe)         print("抚摸小马")         time.sleep(3)         strokehorse(safe)         print("领取签到任务")         time.sleep(3)         gethorsetaskcenter(safe)         print("分享小游戏")         time.sleep(3)         sharehorse(safe)         print("摇一摇信息")         time.sleep(3)         getbattlemsg(safe)            print("偷饲料")         time.sleep(3)         subhorseplayer(safe)                        print("喂马")         time.sleep(3)         horseeat(safe)         print("送饲料")         time.sleep(3)         subhorseplayer1(safe)         print("查询题库")         time.sleep(3)         getquesbackstatus(safe)         print("刷新题库")         time.sleep(3)         getques(safe)         print("答题")         time.sleep(3)         getques1(safe)         print("答题")         time.sleep(3)         getques2(safe)         print("答题")         time.sleep(3)         getques3(safe)         time.sleep(3)         infos(safe)    else:        print("失败")     except Exception as e:        pr(f"执行错误: {e}")
def headers():#请求头    header = {            "Host""wxx.ball.warhorsechina.com.cn",            "Connection""keep-alive",            "User-Agent""Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/8555",            "Content-Type""application/x-www-form-urlencoded",            "Referer""https://servicewechat.com/wx94dca6ef07a54c55/152/page-frame.html",            }    return headerdef infos(safe): #积分,能量信息    url = f"https://wxx.ball.warhorsechina.com.cn/api/getusercenter.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         pr(f"积分:{info['nowscore']}")           else:        pr("失败")  
def checkin(safe): #签到    url = f"https://wxx.ball.warhorsechina.com.cn/api/checkin.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print(info["msg"])           else:        print(info["msg"])  
def joinxcx(safe): #排行榜请求    url = f"https://wxx.ball.warhorsechina.com.cn/api/joinxcx.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])  
def getranklist(safe): #好友列表    url = f"https://wxx.ball.warhorsechina.com.cn/api/getranklist.php?safe={safe}&type=1&fromsafe"    header = headers()    wx_zm_uid = []    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:        listid = info['data']        for rw_id in listid:            wx_zm_uid.append(rw_id['id'])      else:        print(info)      return wx_zm_uid
# def getotherhorseinfo(safe): #添加好友#     wx_zm_tsl = sicxs_uid()#     wx_zm = []#     for wx_zm_id in wx_zm_tsl:#         time.sleep(5)#         url = f"https://wxx.ball.warhorsechina.com.cn/api/getranklist.php?safe={safe}&type=1&fromsafe={wx_zm_id}"#         header = {#             "Host": "wxx.ball.warhorsechina.com.cn",#             "Connection": "keep-alive",#             "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/8555",#             "Content-Type": "application/x-www-form-urlencoded",#             "Referer": "https://servicewechat.com/wx94dca6ef07a54c55/152/page-frame.html",#             }#         response = requests.get(url=url,headers=header)#         time.sleep(3)#         response.encoding = "utf-8"#         info = json.loads(response.text)#         if 1 == info['status']:#             wx_zm.append(wx_zm_id)   #         else:#             print(f"添加好友{wx_zm_id} 失败: {info}")#     print(f"添加{wx_zm}成功")  
def subrank(safe): #点赞互动    wx_zm_tsl =getranklist(safe)    for wx_zm_id in wx_zm_tsl:        time.sleep(5)        url = f"https://wxx.ball.warhorsechina.com.cn/api/subrank.php?safe={safe}&id={wx_zm_id}&type=1"        header = headers()        response = requests.get(url=url,headers=header)        time.sleep(3)        response.encoding = "utf-8"        info = json.loads(response.text)        if 1 == info['status']:            print(f"点赞{wx_zm_id}成功")            else:            print(f"点赞{wx_zm_id} 失败: {info['msg']}")     def share(safe): #分享小程序    url = f"https://wxx.ball.warhorsechina.com.cn/api/share.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])  
def saveuserinfo(safe,wx_zm_avatar,wx_zm_nickname,wx_zm_sex,wx_zm_birthday,wx_zm_tel): #完善信息任务    url = f"https://wxx.ball.warhorsechina.com.cn/api/saveuserinfo.php?safe={safe}&avatar={wx_zm_avatar}&nickname={wx_zm_nickname}&uname={wx_zm_nickname}&sex={wx_zm_sex}&birthday={wx_zm_birthday}&tel={wx_zm_tel}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print(info)           else:        print(info["msg"])  def gzhkl(safe): #公众号口令    msg = "有能量 当燃战马!"    url = f"https://wxx.ball.warhorsechina.com.cn/api/gzhkl.php?safe={safe}&kl={msg}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print(info)           else:        print(info["msg"])   def starthorse(safe): #领养马    url = f"https://wxx.ball.warhorsechina.com.cn/api/starthorse.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def horselogin(safe): #登录养马    url = f"https://wxx.ball.warhorsechina.com.cn/api/horselogin.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def strokehorse(safe): #抚摸马儿    url = f"https://wxx.ball.warhorsechina.com.cn/api/strokehorse.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def horseeat(safe): #喂马    url = f"https://wxx.ball.warhorsechina.com.cn/api/horseeat.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])  def subhorseplayer(safe): #偷饲料    header = headers()    wx_zm_tsl =getranklist(safe)    for wx_zm_id in wx_zm_tsl:        time.sleep(5)        url = f"https://wxx.ball.warhorsechina.com.cn/api/subhorseplayer.php?safe={safe}&friendid={wx_zm_id}&type=1"
        response = requests.get(url=url,headers=header)        time.sleep(3)        response.encoding = "utf-8"        info = json.loads(response.text)        if 1 == info['status']:            print(f"偷饲料{wx_zm_id}成功")            else:           print(f"偷饲料{wx_zm_id} 失败: {info['msg']}")def subhorseplayer1(safe): #送饲料    wx_zm_ssl =getranklist(safe)    for wx_zm_id in wx_zm_ssl:        time.sleep(5)        url = f"https://wxx.ball.warhorsechina.com.cn/api/subhorseplayer.php?safe={safe}&friendid={wx_zm_id}&type=2"        header = headers()        response = requests.get(url=url,headers=header)        time.sleep(3)        response.encoding = "utf-8"        info = json.loads(response.text)        if 1 == info['status']:               print(f"送饲料{wx_zm_id}成功")        else:           print(f"送饲料{wx_zm_id} 失败: {info['msg']}")

def gethorsetaskcenter(safe): #领取饲料任务签到    url = f"https://wxx.ball.warhorsechina.com.cn/api/gethorsetaskcenter.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print(f"领取饲料:{info['checkData']['feed']},领取天数:{info['checkData']['day']}")           else:        print(info["msg"]) def checkslgift(safe): #领互助饲料    url = f"https://wxx.ball.warhorsechina.com.cn/api/checkslgift.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def sharehorse(safe): #分享公众号    url = f"https://wxx.ball.warhorsechina.com.cn/api/sharehorse.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"]) 
def getquesbackstatus(safe): #查询题库    url = f"https://wxx.ball.warhorsechina.com.cn/api/getquesbackstatus.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:
         print("请求成功")           else:        print(info["msg"])
def getques(safe): #刷新题库    url = f"https://wxx.ball.warhorsechina.com.cn/api/getques.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         qid = info['qid']         question =info['question']         options =info['options']         sicxs_tk_up(qid,question,options)       #  print(info)           else:        print(info["msg"])  
def getques1(safe): #答题1    url = f"https://wxx.ball.warhorsechina.com.cn/api/subques.php?safe={safe}&qid=126&val=C"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def getques2(safe): #答题2    url = f"https://wxx.ball.warhorsechina.com.cn/api/subques.php?safe={safe}&qid=138&val=C"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   
def getques3(safe): #答题3    url = f"https://wxx.ball.warhorsechina.com.cn/api/subques.php?safe={safe}&qid=119&val=A"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   
def sendbattle(safe):  #摇一摇    url = f"https://wxx.ball.warhorsechina.com.cn/api/sendbattle.php?safe={safe}&id=2"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"])   def getbattlemsg(safe):  #摇一摇接收信息    url = f"https://wxx.ball.warhorsechina.com.cn/api/getbattlemsg.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:         print("成功")           else:        print(info["msg"]) def getmyhorseinfo(safe): #获取id    url = f"https://wxx.ball.warhorsechina.com.cn/api/getmyhorseinfo.php?safe={safe}"    header = headers()    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if 1 == info['status']:        return info['friendid']      else:        print(info["msg"]) 

def sicxs_tk_up(qid,question,options): #上传题库    response = requests.get(url=f"https://api.com/i/zm/tk/qs?qid={qid}&question={question}&options={options}")    response.encoding = "utf-8"    info = json.loads(response.text)

def sicxs():    config_path = 'config.py'    if os.path.exists(config_path):      import config      else:      with open(config_path, 'w'as f:         pr("首次运行,已创建配置文件 config.py,请按照说明填写相关变量后再次运行脚本。")        f.write('#可以在此文件中添加配置变量,例如:\nsfsy = ""\n')    try:        env_cookie = os.environ.get("wx_zmnlxq")        si_cookie = getattr(config, 'wx_zmnlxq'''        if env_cookie and si_cookie:            cookies = env_cookie + "\n" + si_cookie        elif env_cookie:            cookies = env_cookie        elif si_cookie:            cookies = si_cookie        else:            pr("请设置变量 export wx_zmnlxq='' 或在 config.py 中设置 wx_zmnlxq")            sys.exit()    except Exception as e:        pr("请设置变量 export wx_zmnlxq='' 或在 config.py 中设置 wx_zmnlxq")        sys.exit()    list_cookie = [c for c in re.split(r'\n|&', cookies) if c.strip()]    total_cookies = len(list_cookie)    for i, list_cookie_i in enumerate(list_cookie):        try:            print(f'----------- 账号【{i + 1}/{total_cookies}】执行 -----------')            pr(f"账号【{i + 1}】开始执行")            index(list_cookie_i)            checkslgift(list_cookie_i)        except Exception as e:            pr(f"账号执行出错,已跳过该账号:{e}")        finally:            send("战马能量星球"''.join(msg))            msg.clear()         print(f'\n-----------  执 行  结 束 -----------')if __name__ == '__main__':  sicxs()
解析

该脚本为登录【战马能量星球】小程序账号,自动做每天的积分 / 能量任务,然后把执行结果通过通知推送出去。

主要方法

1. 基础工具

  • pr(message)

    • 同时 print 到控制台,并把日志内容收集进全局 msg,用于最后推送通知。

  • headers()

    • 生成通用请求头(User-Agent、Referer 等),所有接口复用。

2. 主流程入口

  • sicxs()

    • 调用 index(safe) 执行整套任务。

    • 调用 checkslgift(safe) 领取互助饲料。

    • 调用 send("战马能量星球", ''.join(msg)) 推送执行结果。

    • 清空日志,处理下一个账号。

    • 读取环境变量或 config.py 里的 wx_zmnlxq,支持多账号(以换行 / & / @ 分隔)。

    • 对每个账号的 safe 参数:

  • index(safe)

    • infos 查询积分

    • checkin 签到

    • joinxcx 加入排行榜

    • subrank 给好友点赞

    • share 分享小程序

    • sendbattle 摇一摇

    • starthorse 领养马

    • horselogin 登录小游戏

    • strokehorse 抚摸马

    • gethorsetaskcenter 领取饲料/签到任务奖励

    • sharehorse 分享相关任务

    • getbattlemsg 获取摇一摇信息

    • subhorseplayer 偷好友饲料

    • horseeat 喂马

    • subhorseplayer1 给好友送饲料

    • getquesbackstatus 查询答题状态

    • getques 刷新题库并上报到自家接口

    • getques1/2/3 提交预设题目答案

    • 再调一次 infos 查看最新积分

    • 这是整个脚本的"总控"方法。

    • 用 safe 调 getuserinfo.php 验证登录。

    • 如果成功:
      依次调用一大串任务函数(签到、互动、养马、答题等),最后再查一次信息:

3. 账户 / 积分相关

  • infos(safe)

    • 调 getusercenter.php

    • 获取当前积分,打印用于展示执行结果。

4. 日常任务相关

  • checkin(safe)

    • 每日签到任务。

  • joinxcx(safe)

    • 加入小程序排行榜一类的活跃任务。

  • share(safe)

    • "分享小程序"任务上报。

  • getranklist(safe)

    • 获取排行榜 / 好友列表,返回用户 ID,用于点赞、偷/送饲料等互动任务。

  • subrank(safe)

    • 遍历排行榜用户,对其进行点赞互动任务。

5. 养马玩法相关

  • starthorse(safe)

    • 领养小马。

  • horselogin(safe)

    • 登录养马小游戏。

  • strokehorse(safe)

    • 抚摸马,完成对应任务。

  • horseeat(safe)

    • 喂马,消耗饲料完成任务。

  • subhorseplayer(safe)

    • 从好友那偷饲料(基于 getranklist 的好友 ID)。

  • subhorseplayer1(safe)

    • 向好友送饲料,完成对应任务。

  • gethorsetaskcenter(safe)

    • 领取签到/任务赠送的饲料奖励。

  • checkslgift(safe)

    • 领取互助饲料奖励。

  • sharehorse(safe)

    • 分享与养马相关内容的任务。

  • getbattlemsg(safe) / sendbattle(safe)

    • 摇一摇相关任务:发起 & 获取结果。

6. 答题 / 题库相关

  • getquesbackstatus(safe)

    • 查询当前答题状态。

  • getques(safe)

    • 拉取当日题目(qid、题干、选项),然后调用 sicxs_tk_up 上传到自有题库接口。

  • getques1(safe) / getques2(safe) / getques3(safe)

    • 对三个固定 qid 提交写死的选项,用于完成答题任务(依赖活动没变)。

  • sicxs_tk_up(qid, question, options)

    • 将题目数据提交到 api,用于积累题库。



注意

本文部分变量已做脱敏处理,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。技术层面需要提供帮助,可以通过打赏的方式进行探讨。


历史脚本txt文件获取>>
服务器搭建,人工服务咨询>>
【相关文章】
战马能量星球任务脚本

没有评论:

发表评论

战马能量星球任务脚本(2025年11月更新)

1.购买服务器阿里云:服务器购买地址https://t.aliyun.com/U/Bg6shY若失效,可用地址 1.购买服务器 阿里云: 服务器购买地址 https : //t.aliyun.com/U/Bg6shY 若失效,可用地址 https ://www.aliyun....