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

Function PickUpComponent

jd_dreamFactory.js:817–852  ·  view source on GitHub ↗
(index, encryptPin)

Source from the content-addressed store, hash-verified

815//收取地下随机零件电力API
816
817function PickUpComponent(index, encryptPin) {
818 return new Promise(resolve => {
819 $.get(taskurl('usermaterial/PickUpComponent', `placeId=${index}&pin=${encryptPin}`, `_time,pin,placeId,zone`), (err, resp, data) => {
820 try {
821 if (err) {
822 console.log(`${JSON.stringify(err)}`)
823 console.log(`${$.name} API请求失败,请检查网路重试`)
824 } else {
825 if (safeGet(data)) {
826 data = JSON.parse(data);
827 // if (data['ret'] === 0) {
828 // data = data['data'];
829 // if (help) {
830 // console.log(`收取好友[${encryptPin}]零件成功:获得${data['increaseElectric']}电力\n`);
831 // $.pickFriendEle += data['increaseElectric'];
832 // } else {
833 // console.log(`收取自家零件成功:获得${data['increaseElectric']}电力\n`);
834 // $.pickEle += data['increaseElectric'];
835 // }
836 // } else {
837 // if (help) {
838 // console.log(`收好友[${encryptPin}]零件失败:${JSON.stringify(data)}`)
839 // } else {
840 // console.log(`收零件失败:${JSON.stringify(data)}`)
841 // }
842 // }
843 }
844 }
845 } catch (e) {
846 $.logErr(e, resp)
847 } finally {
848 resolve(data);
849 }
850 })
851 })
852}
853//偷好友的电力
854async function stealFriend() {
855 // if (!$.pickUpMyselfComponent) {

Callers 1

PickUpFunction · 0.85

Calls 5

taskurlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected