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

Function getReadyCard

jd_factory_component.js:277–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

275}
276
277function getReadyCard() {
278 return new Promise(async resolve => {
279 $.get(taskStroyUrl('userinfo/ReadyCard'), async (err, resp, data) => {
280 try {
281 const { ret, data: { cardInfo = [] } = {}, msg } = JSON.parse(data);
282 $.log(`\n获取翻倍列表 ${msg},总共${cardInfo.length}个卡片!${cardInfo.length ? '随机选择一个卡片' : ''}`);
283 if (cardInfo.length > 0) {
284 await selectCard(cardInfo);
285 }
286 } catch (e) {
287 $.logErr(e, resp);
288 } finally {
289 resolve();
290 }
291 });
292 });
293}
294
295function selectCard(cardInfo) {
296 return new Promise(async resolve => {

Callers 1

finishCardFunction · 0.85

Calls 5

taskStroyUrlFunction · 0.85
selectCardFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected