MCPcopy Create free account
hub / github.com/6dylan6/jdpro / run

Method run

function/jdValidate.js:204–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 this.n = 0;
203 }
204 async run() {
205 const tryRecognize = async () => {
206 const x = await this.recognize();
207 if (x > 0) {
208 return x;
209 }
210 // retry
211 return await tryRecognize();
212 };
213 const puzzleX = await tryRecognize();
214 console.log(puzzleX);
215 const pos = new MousePosFaker(puzzleX).run();
216 const d = getCoordinate(pos);
217 // console.log(pos[pos.length-1][2] -Date.now());
218 await sleep(3000);
219 //await sleep(pos[pos.length - 1][2] - Date.now());
220 const result = await JDJRValidator.jsonp('/slide/s.html', {
221 d,
222 ...this.data
223 });
224 if (result.message === 'success') {
225 // console.log(result);
226 // console.log('JDJRValidator: %fs', (Date.now() - this.t) / 1000);
227 return result;
228 } else {
229 if (this.n > 60) {
230 return;
231 }
232 this.n++;
233 return await this.run();
234 }
235 }
236 async recognize() {
237 const data = await JDJRValidator.jsonp('/slide/g.html', {
238 e: ''

Callers

nothing calls this directly

Calls 4

getCoordinateFunction · 0.70
sleepFunction · 0.70
logMethod · 0.45
jsonpMethod · 0.45

Tested by

no test coverage detected