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

Function UsePropCard

jd_cfd.js:334–358  ·  view source on GitHub ↗
(strCardTypeIndex)

Source from the content-addressed store, hash-verified

332 })
333}
334function UsePropCard(strCardTypeIndex) {
335 return new Promise((resolve) => {
336 let dwCardType = strCardTypeIndex.split("_")[0];
337 $.get(taskUrl(`user/UsePropCard`, `dwCardType=${dwCardType}&strCardTypeIndex=${encodeURIComponent(strCardTypeIndex)}`), (err, resp, data) => {
338 try {
339 if (err) {
340 console.log(JSON.stringify(err))
341 console.log(`${$.name} UsePropCard API请求失败,请检查网路重试`)
342 } else {
343 data = JSON.parse(data.replace(/\n/g, "").match(new RegExp(/jsonpCBK.?\((.*);*\)/))[1]);
344 if (data.iRet === 0) {
345 let cardName = strCardTypeIndex.split("_")[1];
346 console.log(`使用道具卡【${cardName}】成功`)
347 } else {
348 console.log(`使用道具卡失败:${JSON.stringify(data)}`)
349 }
350 }
351 } catch (e) {
352 $.logErr(e, resp);
353 } finally {
354 resolve();
355 }
356 })
357 })
358}
359
360// 寻宝
361function TreasureHunt(strIndex) {

Callers 1

GetPropCardCenterInfoFunction · 0.85

Calls 4

taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected