(readDelay, ini)
| 1613 | } |
| 1614 | |
| 1615 | function Wait(readDelay, ini) { |
| 1616 | if (!readDelay || readDelay === '0') return 0 |
| 1617 | if (typeof(readDelay) == 'string') { |
| 1618 | var readDelay = readDelay.replace(/"|"|'|'/g, ''); //prevent novice |
| 1619 | if (readDelay.indexOf('-') == -1) return parseInt(readDelay) || 0; |
| 1620 | const raw = readDelay.split("-").map(Number); |
| 1621 | const plan = parseInt(Math.random() * (raw[1] - raw[0] + 1) + raw[0], 10); |
| 1622 | if (ini) console.log(`\n初始化随机延迟: 最小${raw[0]/1000}秒, 最大${raw[1]/1000}秒`); |
| 1623 | // else console.log(`\n预计等待: ${(plan / 1000).toFixed(2)}秒`); |
| 1624 | return ini ? readDelay : plan |
| 1625 | } else if (typeof(readDelay) == 'number') { |
| 1626 | return readDelay > 0 ? readDelay : 0 |
| 1627 | } else return 0 |
| 1628 | } |
| 1629 | |
| 1630 | function CookieMove(oldCk1, oldCk2, oldKey1, oldKey2, newKey) { |
| 1631 | let update; |
no test coverage detected