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

Function getFriends

jd_factory_component.js:129–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129function getFriends() {
130 return new Promise(async resolve => {
131 $.get(taskUrl('friend/QueryFactoryManagerList'), async (err, resp, data) => {
132 try {
133 const { msg, data: { list = [] } = {} } = JSON.parse(data);
134 $.log(`\n获取工厂好友:${msg}\n${$.showLog ? data : ''}`);
135 let statusArr = [];
136 for (let i = 0; i < list.length; i++) {
137 const { encryptPin } = list[i];
138 let status = [false];
139 if (!status[0]) {
140 await $.wait(5000);
141 status[0] = await pickUserComponents(encryptPin);
142 statusArr.push(status[0]);
143 }
144 if (status[0]) {
145 break;
146 }
147 }
148 if (!statusArr[statusArr.length - 1] && $.authExecute) {
149 await $.wait(5000);
150 await getFriends();
151 }
152 } catch (e) {
153 $.logErr(e, resp);
154 } finally {
155 resolve();
156 }
157 });
158 });
159}
160
161function pickUserComponents(pin, isMe) {
162 return new Promise(async resolve => {

Callers 1

Calls 6

pickUserComponentsFunction · 0.85
taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected