MCPcopy Index your code
hub / github.com/NobyDa/Script / Wait

Function Wait

JD-DailyBonus/JD_DailyBonus.js:1615–1628  ·  view source on GitHub ↗
(readDelay, ini)

Source from the content-addressed store, hash-verified

1613}
1614
1615function 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
1630function CookieMove(oldCk1, oldCk2, oldKey1, oldKey2, newKey) {
1631 let update;

Callers 2

allFunction · 0.85
JD_DailyBonus.jsFile · 0.85

Calls 1

logMethod · 0.45

Tested by

no test coverage detected