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

Method run

jd_validate.js:152–178  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

150 }
151
152 async run(tag) {
153 const tryRecognize = async () => {
154 const x = await this.recognize();
155
156 if (x > 0) {
157 return x;
158 }
159 // retry
160 return await tryRecognize();
161 };
162 const puzzleX = await tryRecognize();
163 const pos = new MousePosFaker(puzzleX).run();
164 const d = getCoordinate(pos);
165 await sleep(pos[pos.length - 1][2] - Date.now());
166 const result = await JDJRValidator.jsonp('/slide/s.html', {d, ...this.data});
167
168 if (result.message === 'success') {
169 console.log(result);
170 console.log('JDJRValidator: %fs', (Date.now() - this.t) / 1000);
171 return result;
172 } else {
173 process.stdout.write(`Thread-${tag}`)
174 console.count(JSON.stringify(result));
175 await sleep(300);
176 return await this.run(tag);
177 }
178 }
179
180 async recognize() {
181 const data = await JDJRValidator.jsonp('/slide/g.html', {e: ''});

Callers 1

jd_validate.jsFile · 0.45

Calls 5

writeMethod · 0.80
getCoordinateFunction · 0.70
sleepFunction · 0.70
jsonpMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected