MCPcopy Create free account
hub / github.com/Semporia/Scripts / getUserInfo

Function getUserInfo

jd_nzmh.js:131–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129}
130
131function getUserInfo() {
132 return new Promise(resolve => {
133 $.get(taskUrl('query'), async (err, resp, data) => {
134 try {
135 if (err) {
136 console.log(`${err},${jsonParse(resp.body)['message']}`)
137 console.log(`${$.name} API请求失败,请检查网路重试`)
138 } else {
139 $.userInfo = JSON.parse(data.match(/query\((.*)\n/)[1]).data
140 // console.log(`您的好友助力码为${$.userInfo.shareid}`)
141 console.log(`当前幸运值:${$.userInfo.bless}`)
142 for (let task of $.info.config.tasks) {
143 if (!$.userInfo.complete_task_list.includes(task['_id'])) {
144 console.log(`去做任务${task['_id']}`)
145 await doTask(task['_id'])
146 await $.wait(500)
147 }
148 }
149 }
150 } catch (e) {
151 $.logErr(e, resp)
152 } finally {
153 resolve(data);
154 }
155 })
156 })
157}
158
159function doTask(taskId) {
160 let body = `task_bless=10&taskid=${taskId}`

Callers 1

jdMhFunction · 0.70

Calls 7

taskUrlFunction · 0.70
jsonParseFunction · 0.70
doTaskFunction · 0.70
getMethod · 0.45
logMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected