MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / lq_fd

Function lq_fd

wxapp/quanmianshidai.py:358–387  ·  view source on GitHub ↗
(code, token, tid)

Source from the content-addressed store, hash-verified

356
357
358def lq_fd(code, token, tid): # 三餐福袋和签到
359 # 确保tid为整数类型
360 tid = int(tid) # 将tid转换为整型以确保与整数进行比较
361
362 task_name = "未知任务"
363 if tid == 4:
364 task_name = "三餐福袋" #7-12 14-17 18-22
365 elif tid == 1:
366 task_name = "签到"
367
368 url = "https://sg01.purcotton.com/api/task/complete-task"
369 headers = create_headers(code, token)
370 data = {"tid": tid} # 使用传入的任务ID
371 try:
372 response = requests.post(url, headers=headers, json=data)
373 response.raise_for_status() # 检查响应状态码
374
375 # 解析响应数据
376 response_data = response.json()
377 if response_data.get("code") == 200:
378 print(f"{task_name} 奖励领取成功。")
379 # 打印sy_water和get_water
380 data = response_data.get("data", {})
381 sy_water = data.get("sy_water", "未知")
382 get_water = data.get("get_water", "未知")
383 print(f"{task_name} 剩余水量:{sy_water}, 获取水量:{get_water}")
384 else:
385 print(f"{task_name}:{response_data.get('msg')}")
386 except requests.exceptions.RequestException as e:
387 print(f"请求失败: {e}")
388
389# 任务 完
390

Callers 1

pdrwFunction · 0.85

Calls 4

create_headersFunction · 0.85
printFunction · 0.50
postMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected