mirror of https://github.com/KingRan/KR.git
parent
0c1e0e167a
commit
7a7063a79e
|
@ -532,10 +532,10 @@ def charge(charge_targe_id,cookies,sid,account):
|
||||||
for i in range(10):
|
for i in range(10):
|
||||||
response = requests.post(url=url, verify=False, headers=headers,data=data.encode()) #data中有汉字,需要encode为utf-8
|
response = requests.post(url=url, verify=False, headers=headers,data=data.encode()) #data中有汉字,需要encode为utf-8
|
||||||
result = response.json()
|
result = response.json()
|
||||||
# print(result)
|
print(result)
|
||||||
user_coins = result['user_coins'] #剩余能量
|
user_coins = result['user_coins'] #剩余能量
|
||||||
coins = result['plant_info']['coins'] #消耗能量
|
coins = result['plant_info']['coins'] #消耗能量
|
||||||
msg ("充能成功,消耗【{1}】能量,剩余能量【{2}】".format (coins,user_coins))
|
msg ("充能成功,消耗【{0}】能量,剩余能量【{1}】".format (coins,user_coins))
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -590,9 +590,10 @@ def start():
|
||||||
taskName, taskId, taskToken_list = get_task2 (cookie,sid, account)
|
taskName, taskId, taskToken_list = get_task2 (cookie,sid, account)
|
||||||
for i in taskToken_list:
|
for i in taskToken_list:
|
||||||
do_task2 (cookie, taskName, taskId, i, sid,account)
|
do_task2 (cookie, taskName, taskId, i, sid,account)
|
||||||
charge (charge_targe_id, cookie,sid, account)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
charge (charge_targe_id, cookie, sid, account)
|
||||||
else:
|
else:
|
||||||
printT("请检查变量plant_cookie是否已填写")
|
printT("请检查变量plant_cookie是否已填写")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue