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

Function pdrw

wxapp/quanmianshidai.py:237–326  ·  view source on GitHub ↗

根据任务完成情况执行任务

(code, token)

Source from the content-addressed store, hash-verified

235
236
237def pdrw(code, token): # 判断任务
238 """根据任务完成情况执行任务"""
239 try:
240 task_user_info = task_list(code, token)
241
242 task_completion_limits = {
243 6: 4,# 任务ID为6的任务只能完成4次 逛甄选好棉品
244 13: 2, # 任务ID为13的任务只能完成2次 浏览新用户专区
245 15: 1, # 假设任务ID为15的任务只能完成1次 棉花工厂
246 4: 3, # 4 3次三餐福袋 7-12 14-17 18-22
247 16: 1, # ID 16 社区送福利
248 10: 1, # ID 10 订阅奖励提醒
249 14: 1, #ID14 #庄园小课堂
250 1: 1, #ID #签到
251 }
252
253 # 先检查所有指定的任务是否已经存在于任务列表中
254 existing_task_ids = [task['task_id'] for task in task_user_info]
255 #print(existing_task_ids)
256 # 遍历每个任务ID,检查是否需要执行任务
257 for task_id, max_completes in task_completion_limits.items():
258 task_info = next((task for task in task_user_info if task['task_id'] == task_id), None)
259
260 if task_info:
261 complete_num = task_info['complete_num']
262 if complete_num < max_completes:
263 #print(f"任务ID: {task_id}, 当前完成次数: {complete_num}, 将执行任务并尝试领取奖励。")
264 print()
265 if task_id == 6:
266 llhmp(code, token, 'browse_venue', '6')
267 #today_water(code, token)
268 elif task_id == 13:
269 llhmp(code, token, 'browse_new_user_zone', '13')
270 today_water(code, token)
271 sj_yg(code, token)#收集阳光
272 syyg(code, token)#使用阳光
273 # 这里可以添加其他任务ID的逻辑
274 elif task_id == 15:
275 # 对于任务ID 15的特定处理
276 complete_task(code, token, '15')
277 elif task_id == 16:
278 llhmp(code, token, 'browse_community', '16')
279
280 elif task_id == 10:
281 llhmp(code, token, 'subscibe', '10')
282 elif task_id == 14:
283 hdwt_box(code, token, '14')
284 elif task_id == 4:
285 # 对于任务ID 15的特定处理
286 lq_fd(code, token, '4')
287
288 elif task_id == 1:
289 lq_fd(code, token, '1')
290 time.sleep(random.randint(1, 5))
291
292
293 elif task_id not in existing_task_ids:
294 #print(f"任务ID: {task_id}, 未在列表中,将尝试执行并领取奖励。")

Callers 1

mainFunction · 0.85

Calls 10

task_listFunction · 0.85
llhmpFunction · 0.85
today_waterFunction · 0.85
sj_ygFunction · 0.85
syygFunction · 0.85
complete_taskFunction · 0.85
hdwt_boxFunction · 0.85
lq_fdFunction · 0.85
sleepMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected