From 4272cbb3fa4fa0ae22ca2d0823bd05643d7ef7aa Mon Sep 17 00:00:00 2001 From: poll <> Date: Fri, 13 Jan 2023 14:31:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=BB=91=E5=9D=97=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=AF=8F=E6=97=A5=E7=AD=94?= =?UTF-8?q?=E9=A2=98=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\275\225\344\273\245\345\274\272\345\233\275.js" | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git "a/\344\270\215\345\255\246\344\271\240\344\275\225\344\273\245\345\274\272\345\233\275.js" "b/\344\270\215\345\255\246\344\271\240\344\275\225\344\273\245\345\274\272\345\233\275.js" index d7df57f..574d37a 100644 --- "a/\344\270\215\345\255\246\344\271\240\344\275\225\344\273\245\345\274\272\345\233\275.js" +++ "b/\344\270\215\345\255\246\344\271\240\344\275\225\344\273\245\345\274\272\345\233\275.js" @@ -94,6 +94,10 @@ function closeWin() { } +async function sleep( timeMS ) { + return new Promise( res => setTimeout( res, time ) ); +} + /** 模拟鼠标移动 改方法来自https://blog.csdn.net/Wuzihui___/article/details/79952068 * @param id * @param clientX 相对窗口横坐标 @@ -105,7 +109,7 @@ function dragandDrop(btn_hk, clientX, clientY, distance) { k = 0, interval; iME(elem,"mousedown",0, 0, clientX, clientY); - let waitTime = Math.floor(Math.random() * (0.5 * 1000 - 0.1 * 1000) + 0.1 * 1000) + let waitTime = Math.floor(Math.random() * (0.005 * 1000 - 0.09 * 1000) + 0.09 * 1000) interval = setInterval(function() { k++; iter(k); @@ -881,7 +885,6 @@ async function doingExam() { } } if (!hasButton) { - //没找到按钮,随便选一个 allbuttons[0].click(); } break; @@ -910,7 +913,11 @@ async function doingExam() { } } else { //没答案,随便选一个 - allbuttons[0].click(); + try { + allbuttons[0].click(); + } catch(e) { + console.log(e); + } } break; }